diff --git a/integrations/events/event_common.yaml b/integrations/events/event_common.yaml index c2ad34a7..a7cf0df9 100644 --- a/integrations/events/event_common.yaml +++ b/integrations/events/event_common.yaml @@ -51,7 +51,7 @@ automation: {%- if event_hour < 6 %} {{ high_school_day }} {%- else %} - {{ high_school_day_tomorrow or high_school_day_tomorrow }} + {{ high_school_day_tomorrow }} {%- endif %} {%- elif id == "bedtime_boys_daysoff" %} {%- if event_hour < 6 %} @@ -118,7 +118,6 @@ automation: event_enabled: '{{ is_state("input_boolean.event_enabled_" + id, "on") }}' skipnext_entity: 'input_boolean.event_skipnext_{{ id }}' do_not_skipnext: '{{ is_state(skipnext_entity, "off") }}' - light_enabled: '{{ is_state("input_boolean.event_light_" + id, "on") }}' event_hour: '{{ states(entity_id)[:2]|int(default=0) }}' work_day: '{{ is_state("binary_sensor.work_day","on") }}' @@ -158,15 +157,14 @@ automation: # title: '{{ title|default("") }}' # message: | # id: {{ id }} - # light_enabled: {{ light_enabled }} # event_today: {{ event_today }} - # {{ light_enabled and event_today and event_enabled }} + # {{ event_today and event_enabled }} # {{ do_not_skipnext }} # notification_id: '{{ id|default("debug_" ~ as_timestamp(now())) }}' - - alias: 'Continue if the wakeup light is enabled, today is an event day, and the event is not deactivated.' + - alias: 'Continue when today is an event day, and the event is not deactivated.' condition: template - value_template: '{{ light_enabled and event_today and event_enabled }}' + value_template: '{{ event_today and event_enabled }}' - choose: - conditions: '{{ do_not_skipnext }}' diff --git a/integrations/events/event_wakeup_brian.yaml b/integrations/events/event_wakeup_brian.yaml index 7dd0e953..7b9c98f5 100644 --- a/integrations/events/event_wakeup_brian.yaml +++ b/integrations/events/event_wakeup_brian.yaml @@ -32,13 +32,14 @@ script: - variables: id: &id > wakeup_brian + light_enabled: '{{ states("input_boolean.event_light_" ~ id|trim) }}' light_name: &light_name > {{ states("input_select.event_light_" ~ id|trim) }} wakeup_light: &wakeup_light > {%- set entity_list = states.light | selectattr("name","eq",light_name) | map(attribute="entity_id") | list %} {{ iif(entity_list|count > 0, entity_list[0], "error") }} - if: - - '{{ wakeup_light != "error" }}' + - '{{ light_enabled == "on" and wakeup_light != "error" }}' then: - service: script.event_light continue_on_error: true diff --git a/integrations/events/event_wakeup_kyle.yaml b/integrations/events/event_wakeup_kyle.yaml index 3c9e4cf3..a77e50fe 100644 --- a/integrations/events/event_wakeup_kyle.yaml +++ b/integrations/events/event_wakeup_kyle.yaml @@ -2,23 +2,15 @@ script: event_wakeup_kyle: sequence: - # - service: light.turn_on - # target: - # entity_id: light.kyle_bedside - # data: - # brightness: 26 - # - delay: - # seconds: 1 - # - service: light.turn_on - # target: - # entity_id: light.kyle_bedside - # data: - # brightness: 26 - - - service: script.event_light - data: - light: light.kyle_bedside - id: wakeup_kyle + - if: + - condition: state + entity_id: input_boolean.event_light_wakeup_kyle + state: "on" + then: + - service: script.event_light + data: + light: light.kyle_bedside + id: wakeup_kyle event_timeout_wakeup_kyle: sequence: diff --git a/integrations/events/event_wakeup_lucas.yaml b/integrations/events/event_wakeup_lucas.yaml index afa6b03c..39396da6 100644 --- a/integrations/events/event_wakeup_lucas.yaml +++ b/integrations/events/event_wakeup_lucas.yaml @@ -2,17 +2,21 @@ script: event_wakeup_lucas: sequence: - - service: climate.set_hvac_mode data: hvac_mode: "off" target: entity_id: climate.lucas_room_thermostat - - service: script.event_light - data: - entity_id: light.lucas_room - id: wakeup_lucas + - if: + - condition: state + entity_id: input_boolean.event_light_wakeup_lucas + state: "on" + then: + - service: script.event_light + data: + entity_id: light.lucas_room + id: wakeup_lucas event_timeout_wakeup_lucas: sequence: diff --git a/integrations/events/event_wakeup_lucas_late_start.yaml.disabled b/integrations/events/event_wakeup_lucas_late_start.yaml.disabled deleted file mode 100644 index c013b8e6..00000000 --- a/integrations/events/event_wakeup_lucas_late_start.yaml.disabled +++ /dev/null @@ -1,69 +0,0 @@ ---- -script: - event_wakeup_lucas_late_start: - sequence: - - service: homeassistant.turn_off - target: - entity_id: climate.lucas_room_thermostat - - - service: light.turn_on - target: - entity_id: light.lucas_room - data: - brightness: 26 - - - service: script.event_light - data: - light: light.lucas_room - id: wakeup_lucas_late_start - - event_timeout_wakeup_lucas_late_start: - sequence: - - service: homeassistant.turn_off - target: - entity_id: light.lucas_room - -input_boolean: - event_enabled_wakeup_lucas_late_start: - name: Active - icon: mdi:alarm-check - event_skipnext_wakeup_lucas_late_start: - name: Skip next event - icon: mdi:alarm-check - event_announcement_wakeup_lucas_late_start: - name: Announcements? - icon: mdi:cast-audio - event_light_wakeup_lucas_late_start: - name: Wakeup light? - icon: mdi:lamp - -input_datetime: - event_1st_wakeup_lucas_late_start: - name: First announcement - has_date: false - has_time: true - event_2nd_wakeup_lucas_late_start: - name: Second announcement - has_date: false - has_time: true - event_light_wakeup_lucas_late_start: - name: Light fade-up start - has_date: false - has_time: true - -input_select: - event_speakers_wakeup_lucas_late_start: - name: Announce in which areas? - options: !include tts_rooms.txt - icon: mdi:cast-audio - -input_text: - event_1st_wakeup_lucas_late_start: - name: First announcement - event_2nd_wakeup_lucas_late_start: - name: Second announcement - -timer: - event_timeout_wakeup_lucas_late_start: - duration: "01:00:00" - restore: true diff --git a/integrations/events/event_wakeup_nerene.yaml b/integrations/events/event_wakeup_nerene.yaml index a1b23e56..4c6ae1ad 100644 --- a/integrations/events/event_wakeup_nerene.yaml +++ b/integrations/events/event_wakeup_nerene.yaml @@ -21,13 +21,14 @@ script: - variables: id: &id > wakeup_nerene + light_enabled: '{{ states("input_boolean.event_light_" ~ id|trim) }}' light_name: &light_name > {{ states("input_select.event_light_" ~ id|trim) }} wakeup_light: &wakeup_light > {%- set entity_list = states.light | selectattr("name","eq",light_name) | map(attribute="entity_id") | list %} {{ iif(entity_list|count > 0, entity_list[0], "error") }} - if: - - '{{ wakeup_light != "error" }}' + - '{{ light_enabled == "on" and wakeup_light != "error" }}' then: - service: script.event_light data: diff --git a/integrations/events/event_wakeup_nerene_modified.yaml b/integrations/events/event_wakeup_nerene_modified.yaml index 3562e0fd..44684b21 100644 --- a/integrations/events/event_wakeup_nerene_modified.yaml +++ b/integrations/events/event_wakeup_nerene_modified.yaml @@ -21,13 +21,14 @@ script: - variables: id: &id > wakeup_nerene_modified + light_enabled: '{{ states("input_boolean.event_light_" ~ id|trim) }}' light_name: &light_name > {{ states("input_select.event_light_" ~ id|trim) }} wakeup_light: &wakeup_light > {%- set entity_list = states.light | selectattr("name","eq",light_name) | map(attribute="entity_id") | list %} {{ iif(entity_list|count > 0, entity_list[0], "error") }} - if: - - '{{ wakeup_light != "error" }}' + - '{{ light_enabled == "on" and wakeup_light != "error" }}' then: - service: script.event_light continue_on_error: true