From 4045dad406ac9a6101ffba6b423caa7035ab7a0b Mon Sep 17 00:00:00 2001 From: Tony Stork Date: Thu, 20 Jan 2022 03:25:48 -0500 Subject: [PATCH] Removed binary_sensor.night, changed to using sunset offsets --- automations.yaml | 25 ------------------------- binary_sensor.yaml | 5 ----- scripts.yaml | 6 +++--- 3 files changed, 3 insertions(+), 33 deletions(-) diff --git a/automations.yaml b/automations.yaml index 1a9bd0a..f4683d6 100644 --- a/automations.yaml +++ b/automations.yaml @@ -250,28 +250,3 @@ - light.living_room_lights - light.mud_room_overhead mode: single -- alias: Set State Night - description: Set the state of binary_sensor.night accurately on HA startup - trigger: - - platform: homeassistant - event: start - action: - - choose: - - conditions: - - condition: sun - after: sunset - before_offset: -00:30 - sequence: - - service: python_script.hass_entities - data: - action: set_state - entity_id: binary_sensor.night - state: 'on' - default: - - service: python_script.hass_entities - data: - action: set_state - entity_id: binary_sensor.night - state: 'off' - hide_entity: true - initial_state: 'on' diff --git a/binary_sensor.yaml b/binary_sensor.yaml index 3d5e56d..86299b6 100644 --- a/binary_sensor.yaml +++ b/binary_sensor.yaml @@ -2,11 +2,6 @@ country: US province: OH workdays: [mon, tue, wed, thu, fri] -- platform: tod - name: Night - after: sunset - after_offset: "-00:30" - before: sunrise - platform: tod name: School after: "09:00" diff --git a/scripts.yaml b/scripts.yaml index b7b53ee..c745a0d 100644 --- a/scripts.yaml +++ b/scripts.yaml @@ -195,9 +195,9 @@ family_is_home: entity_id: - switch.basement_echo_dot_do_not_disturb_switch - switch.living_room_echo_dot_do_not_disturb_switch - - condition: state - entity_id: binary_sensor.night - state: 'on' + - condition: sun + after: sunset + after_offset: -00:30 - service: light.turn_on data: {} target: