- id: '1628956688014' alias: 'Alarm: Disarmed' description: '' trigger: - trigger: state entity_id: alarm_control_panel.house_alarm to: disarmed conditions: - condition: state entity_id: input_boolean.enable_alarm_automations state: 'on' actions: - parallel: - action: script.send_to_home_log data: message: ':no_bell: disarmed.' title: ':bell: Alarm' log_level: Normal - action: script.send_to_home_log data: message: ':camera: Turning off indoor cameras.' log_level: Debug - action: script.set_central_heating_to_home_mode mode: single - id: '1587680439012' alias: 'Alarm: Arm Overnight Home Mode' description: '' trace: stored_traces: 10 triggers: - trigger: state entity_id: - schedule.alarm_scheduled_home_mode from: 'off' to: 'on' - trigger: time at: 00:00:00 - trigger: time_pattern hours: '0' minutes: /30 - trigger: time at: 01:00:00 - trigger: time_pattern hours: '1' minutes: /30 - trigger: time at: 02:00:00 conditions: - or: - condition: state entity_id: alarm_control_panel.house_alarm state: disarmed - not: - condition: state entity_id: lock.front_door state: locked - condition: state entity_id: input_boolean.enable_alarm_automations state: 'on' actions: - parallel: - choose: - conditions: - condition: state entity_id: binary_sensor.alarmed_doors_and_windows state: 'on' sequence: - action: script.send_direct_notification data: message: ':clock{{ now().strftime(''%I'') | int }}{% if now().minute | int > 25 and now().minute | int < 35 %}30{% else %}{% endif %}: The following entrances are still open: {% for entity in state_attr(''binary_sensor.alarmed_doors_and_windows'',''entity_id'') %}{% if states(entity) == ''on'' %}{{ ''\n* '' ~ state_attr(entity, ''friendly_name'') }} {% endif %}{% endfor %}" Trying again later.' title: ':warning: :bell: Alarm' people: entity_id: - person.danny - person.terina default: - parallel: - action: script.arm_alarm_overnight data: message: It's late. - action: script.lock_front_door data: {} mode: single - id: '1587680439015' alias: 'Alarm: Arm Overnight Home Mode Final Check' description: '' triggers: - trigger: time at: 02:05:00 conditions: - condition: state entity_id: alarm_control_panel.house_alarm state: disarmed - condition: state entity_id: input_boolean.enable_alarm_automations state: 'on' actions: - choose: - conditions: - condition: state entity_id: binary_sensor.alarmed_doors_and_windows state: 'on' sequence: - parallel: - action: script.send_direct_notification data: message: ':clock{{ now().strftime(''%I'') | int }}{% if now().minute | int > 25 and now().minute | int < 35 %}30{% else %}{% endif %}: Did not turned on because the following: {% for opening in state_attr(''binary_sensor.alarmed_doors_and_windows'', ''entity_id'') %}{% if states(opening) == ''on'' %} {{ ''* '' ~ state_attr(opening, ''friendly_name'') ~ ''\n'' }}{% endif %}{% endfor %}' title: ':warning: :bell: Alarm :warning:' people: entity_id: - person.danny - person.terina - alias: Turn on bedroom light to warn not all doors/windows are closed. action: light.turn_on data: rgb_color: - 17 - 0 - 255 brightness: 255 target: entity_id: - light.under_bed_left - light.under_bed_right - light.bedroom_lamp_left - light.bedroom_lamp_right - conditions: - condition: state entity_id: binary_sensor.alarmed_doors_and_windows state: 'off' sequence: - choose: - alias: Danny not home and not long distance after last check conditions: - not: - condition: state entity_id: person.danny state: home - condition: template value_template: '{{ states(''sensor.danny_home_nearest_distance'')|float(0) > states(''input_number.long_distance_away_from_home'')|int(0) - 1 }}' - condition: state entity_id: person.terina state: home for: minutes: '5' sequence: - parallel: - action: script.send_direct_notification data: message: 'Final check for people failed. :running: :house_with_garden: Danny is not home and this is the final check. :no_bell: Alarm turned on.' title: ':warning: :bell: Alarm' people: entity_id: - person.danny - person.terina - action: script.set_alarm_to_home_mode - action: script.lock_front_door - alias: Terina not home and not long distance and after last check conditions: - condition: state entity_id: person.danny state: home for: minutes: '5' - not: - condition: state entity_id: person.terina state: home - condition: template value_template: '{{ states(''sensor.terina_home_nearest_distance'')|float(0) > states(''input_number.long_distance_away_from_home'')|int(0) - 1 }}' sequence: - parallel: - action: script.send_direct_notification data: message: 'Final check for people failed. :house_with_garden: :woman_dancing: Terina is not home and this is the final check. :no_bell: Alarm turned on.' title: ':bell: Alarm' people: entity_id: - person.danny - person.terina - action: script.set_alarm_to_home_mode - action: script.lock_front_door default: [] mode: single - id: '1587680439013' alias: 'Alarm: Arm Overnight When Doors And Windows Shut' description: '' triggers: - trigger: state entity_id: - binary_sensor.alarmed_doors_and_windows from: 'on' to: 'off' for: 00:00:30 conditions: - condition: state entity_id: group.adult_people state: home - condition: state entity_id: alarm_control_panel.house_alarm state: disarmed - condition: state entity_id: binary_sensor.alarmed_doors_and_windows state: 'off' - condition: state entity_id: schedule.alarm_scheduled_home_mode state: 'on' - condition: state entity_id: input_boolean.enable_alarm_automations state: 'on' actions: - action: script.arm_alarm_overnight data: message: 'All alarmed :door: doors and :window: windows are now closed.' mode: single - id: '1630366065607' alias: 'Alarm: Armed' description: '' triggers: - trigger: state entity_id: alarm_control_panel.house_alarm to: armed_away conditions: - condition: state entity_id: input_boolean.enable_alarm_automations state: 'on' actions: - parallel: - action: script.send_to_home_log data: message: ' Set to away mode (all sensors on). Turning on all :camera_with_flash: cameras.' title: ':bell: Alarm' log_level: Normal mode: single - id: '1614197981954' alias: 'Alarm: Disconnected' description: '' triggers: - trigger: state entity_id: alarm_control_panel.house_alarm to: unavailable for: hours: 0 minutes: 1 seconds: 0 conditions: - condition: state entity_id: input_boolean.enable_alarm_automations state: 'on' actions: - parallel: - action: script.send_direct_notification data: title: ':bell: Alarm' message: ':warning: Disconnected from Home Assistant :warning:' people: entity_id: - person.danny mode: single - id: '1658658845650' alias: 'Alarm: Disconnected For A Period Of Time' description: '' triggers: - trigger: state entity_id: - alarm_control_panel.house_alarm to: unavailable for: hours: 0 minutes: 5 seconds: 0 conditions: - condition: state entity_id: input_boolean.enable_alarm_automations state: 'on' actions: - action: script.send_to_home_log data: message: Alarm has been unavailable for 5 minutes. Restarting Ring MQTT add-on. title: ':bell: Alarm' log_level: Normal - action: hassio.addon_restart data: addon: fdb328a7_ring_mqtt - wait_for_trigger: - trigger: state entity_id: - alarm_control_panel.house_alarm from: unavailable timeout: '{{ states(''input_text.restart_ring_mqtt_add_on_timeout'') }}' continue_on_timeout: true - choose: - conditions: - condition: state entity_id: alarm_control_panel.house_alarm state: unavailable sequence: - action: script.send_to_home_log data: message: Restarting Ring MQTT add-on failed. title: ':bell: Alarm' log_level: Normal - conditions: - condition: not conditions: - condition: state entity_id: alarm_control_panel.house_alarm state: unavailable sequence: - action: script.send_to_home_log data: message: Ring MQTT restarted successfully. title: ':bell: Alarm' log_level: Normal default: [] mode: single - id: '1589026420341' alias: 'Alarm: Triggered' description: '' triggers: - trigger: state entity_id: alarm_control_panel.house_alarm to: triggered conditions: - condition: state entity_id: input_boolean.enable_alarm_automations state: 'on' actions: - parallel: - action: script.send_direct_notification data: message: Has triggered! title: ':rotating_light: Alarm' people: entity_id: - person.danny - person.terina - person.leo - action: script.send_actionable_notification_with_2_buttons data: message: Triggered! Turn off? title: ':rotating_light: Alarm' people: entity_id: - person.danny - person.terina action1_title: 'Yes' action1_name: switch_off_alarm action2_title: 'No' action2_name: ignore - action: script.post_home_assistant_direct_notification data: message: Has triggered! title: π¨ Alarm people: entity_id: - person.danny - person.terina - person.leo priority: high mode: single - id: '1676493888411' alias: 'Attic: Hatch Opened' description: '' triggers: - trigger: state entity_id: - binary_sensor.attic_hatch_contact from: 'off' to: 'on' conditions: [] actions: - parallel: - action: script.send_to_home_log data: message: Attic hatch opened. Turning lights on. title: Attic log_level: Debug - action: light.turn_on data: {} target: entity_id: light.attic mode: single - id: '1676493961946' alias: 'Attic: Hatch Closed' description: '' triggers: - trigger: state entity_id: - binary_sensor.attic_hatch_contact from: 'on' to: 'off' conditions: [] actions: - parallel: - action: script.send_to_home_log data: message: Attic hatch opened. Turning lights off. title: Attic log_level: Debug - action: light.turn_off data: {} target: entity_id: light.attic mode: single - id: '1664827040573' alias: 'Attic: Lights On' description: '' triggers: - trigger: state entity_id: - light.attic to: 'on' for: hours: 0 minutes: 30 seconds: 0 conditions: [] actions: - action: script.send_actionable_notification_with_2_buttons data: message: Lights have been on for 15 minutes. Turn off? title: Attic people: entity_id: - person.danny - person.terina action1_title: 'Yes' action1_name: switch_off_attic_lights action2_title: 'No' action2_name: ignore mode: single - id: '1590564595890' alias: 'Living Room: UPS Below 5 Minutes Run time' description: '' triggers: - trigger: numeric_state entity_id: sensor.lounge_ups_battery_runtime below: '301' condition: - condition: state entity_id: sensor.lounge_ups_status_data state: OB DISCHRG actions: - action: script.send_direct_notification data: message: ':warning: Less than 5 minutes left on :battery: :warning:' title: ':battery: Living Room UPS' people: entity_id: - person.danny - person.terina mode: single - id: '1591705795121' alias: 'Office: Server UPS On Battery With Less Than 5 Minutes' description: '' triggers: - trigger: numeric_state entity_id: sensor.server_ups_battery_runtime below: '301' condition: - condition: state entity_id: sensor.server_ups_status_data state: OB DISCHRG actions: - action: script.send_direct_notification data: message: ':warning: Less than 5 minutes left on :battery: battery :warning:' title: ':battery: Server UPS' people: entity_id: - person.danny - person.terina mode: single - id: '1604998439600' alias: 'House: Water detected' description: '' triggers: - trigger: state entity_id: binary_sensor.water_leak_sensors to: 'on' condition: [] actions: - action: script.send_to_home_log data: message: ':warning: :droplet: Potential leak detected :droplet: :warning:' log_level: Normal mode: single - id: '1604998512525' alias: 'House: Water Not Detected' description: '' triggers: - trigger: state entity_id: binary_sensor.water_leak_sensors from: 'on' to: 'off' condition: [] actions: - action: script.send_to_home_log data: message: Potential leak has stopped log_level: Normal mode: single - id: '1613246359438' alias: 'Office: Computer UPS On Battery With Less Than 5 Minutes' description: '' triggers: - trigger: numeric_state entity_id: sensor.computer_ups_battery_runtime below: '301' condition: - condition: state entity_id: sensor.computer_ups_status_data state: OB DISCHRG actions: - action: script.send_direct_notification data: message: ':warning: Less than 5 minutes left on :battery: battery :warning:' title: ':battery: PC UPS' people: entity_id: - person.danny - person.terina mode: single - id: '1613264719942' alias: 'Office: Alarm Armed Home Mode & Motion Detected' description: '' triggers: - trigger: state entity_id: binary_sensor.office_area_motion to: 'on' condition: - condition: state entity_id: alarm_control_panel.house_alarm state: armed_home - condition: state entity_id: group.jd_computer state: 'off' actions: - action: script.send_to_home_log data: message: ':paw_prints: Motioned detected in the office!' log_level: Normal mode: single - id: '1613264961246' alias: 'Kitchen: Alarm Armed Home Mode & Motion Detected' description: '' triggers: - trigger: state entity_id: binary_sensor.kitchen_area_motion to: 'on' condition: - condition: state entity_id: alarm_control_panel.house_alarm state: armed_home - condition: state entity_id: group.jd_computer state: 'off' actions: - action: script.send_to_home_log data: message: ':paw_prints: Motioned detected in the kitchen!' log_level: Normal mode: single - id: '1617395256574' alias: 'Leo''s Room: Bed Occupied At Night' description: '' triggers: - trigger: state entity_id: binary_sensor.leos_bed_occupied to: 'on' condition: - condition: state entity_id: cover.leos_bedroom_blinds state: open - condition: time after: '18:30:00' - condition: state entity_id: input_boolean.enable_leos_blind_automations state: 'on' - condition: state entity_id: input_boolean.enable_leos_bed_sensor state: 'on' actions: - action: script.send_to_home_log data: message: ':city_sunrise: :bed: Someone is in Leo''s bed. Closing blinds.' - choose: - conditions: - condition: state entity_id: binary_sensor.leos_bedroom_window_contact state: 'on' sequence: - action: script.send_to_home_log data: message: ':warning: :window: Leo''s bedroom window is still open. Waiting until it''s closed before closing blinds. :warning:' log_level: Normal default: - action: cover.close_cover target: entity_id: cover.leos_bedroom_blinds - wait_for_trigger: - trigger: state entity_id: binary_sensor.leos_bedroom_window_contact to: 'off' timeout: 03:00:00 - action: script.send_to_home_log data: message: ':white_check_mark: :window: Leo''s window closed. Closing blinds.' log_level: Normal - action: cover.close_cover target: entity_id: cover.leos_bedroom_blinds mode: single - id: '1622973276606' alias: 'Office: Arm Office Door' description: '' triggers: - trigger: state entity_id: input_boolean.alarm_office_door from: 'off' to: 'on' condition: [] actions: - choose: - conditions: - condition: state entity_id: binary_sensor.office_door_contact state: 'on' sequence: - action: script.send_to_home_log data: message: ':warning: :alarm: Unable to arm office door because the door is not closed. Disabling alarm.' log_level: Normal - action: input_boolean.turn_off target: entity_id: input_boolean.alarm_office_door default: - action: script.send_to_home_log data: message: ':bell: :door: Office door armed.' log_level: Normal mode: single - id: '1622973478458' alias: 'Office: Trigger Armed Door' description: '' triggers: - trigger: state entity_id: binary_sensor.office_door_contact from: 'off' to: 'on' condition: - condition: state entity_id: input_boolean.alarm_office_door state: 'on' actions: - action: script.send_to_home_log data: message: ':rotating_light: :door: Office door armed and was opened:rotating_light:' - action: input_boolean.turn_off target: entity_id: input_boolean.alarm_office_door mode: queued max: 10 - id: '1627509008928' alias: Enter No Children Mode description: '' triggers: - trigger: state entity_id: input_select.home_mode to: No Children condition: [] actions: - action: script.send_to_home_log data: message: ':repeat: Entering No Children mode.' log_level: Normal mode: single - id: '1634576629865' alias: 'NFC Tag: Scanned Locked By User' description: '' triggers: - trigger: event event_type: tag_scanned context: user_id: - 06cbf6deafc54cf0beffa49552a396b1 - 2df8a2a6e0be4d5d902aad2d39ed4c9b condition: [] actions: - choose: - conditions: - condition: template value_template: '{{ trigger.event.data.tag_id == ''47e42f4c-3ffa-463f-ae2f-ed0b97a4fe9c''}}' sequence: - action: script.send_to_home_log data: message: ':door: :label: Front door tag scanned by {{ states.person|selectattr(''attributes.user_id'', ''=='', trigger.event.context.user_id)|map(attribute=''attributes.friendly_name'')|first }}.' log_level: Normal - action: script.nfc_front_door - conditions: - condition: template value_template: '{{ trigger.event.data.tag_id == ''8b6d6755-b4d5-4b23-8e8b-cf224d221bb7''}}' sequence: - action: script.send_to_home_log data: message: ':door: :label: Bedroom right tag scanned by {{ states.person|selectattr(''attributes.user_id'', ''=='', trigger.event.context.user_id)|map(attribute=''attributes.friendly_name'')|first }}.' log_level: Normal - action: script.nfc_bedroom_right default: [] mode: single - id: '1636203020481' alias: 'Porch: Some One Leaving' description: '' triggers: - trigger: state entity_id: binary_sensor.front_door from: 'off' to: 'on' condition: [] actions: - choose: - conditions: - condition: state entity_id: binary_sensor.porch_motion_occupancy state: 'on' sequence: - action: script.send_to_home_log data: message: ':door: Someone leaving.' - conditions: - condition: state entity_id: binary_sensor.porch_motion_occupancy state: 'off' sequence: - action: script.send_to_home_log data: message: ':test_tube: :door: Someone entering.' log_level: Normal default: [] mode: single - id: '1647094935963' alias: Exit Naughty Step Mode description: '' triggers: - trigger: state entity_id: input_boolean.naughty_step_mode from: 'on' to: 'off' condition: [] actions: - action: script.send_to_home_log data: message: Exiting naught step mode. log_level: Normal - action: input_boolean.turn_on data: {} target: entity_id: - input_boolean.enable_living_room_motion_triggers - input_boolean.enable_stairs_motion_triggers mode: single - id: '1653857006776' alias: 'Porch: Heating Turned On Check Entrances' description: '' triggers: - trigger: state entity_id: - climate.thermostat attribute: hvac_action to: heating from: idle condition: - condition: state entity_id: climate.thermostat state: auto actions: - choose: - conditions: - condition: state entity_id: binary_sensor.front_door state: 'on' sequence: - action: script.send_direct_notification data: message: Consider closing the front door or turning the heating off. title: 'Heating turned on and front :door: door is open.' default: [] mode: single - id: '1659198098255' alias: 'House: Turn On Fake Presence' description: '' triggers: - trigger: sun event: sunset offset: 0 - trigger: time_pattern hours: '17' minutes: /15 - trigger: time_pattern hours: '18' minutes: /15 - trigger: time_pattern hours: '19' minutes: /15 - trigger: time_pattern hours: '20' minutes: /15 - trigger: time_pattern hours: '21' minutes: /15 - trigger: time_pattern hours: '22' minutes: /15 condition: - condition: state entity_id: alarm_control_panel.house_alarm state: armed_away - condition: state entity_id: group.tracked_people state: not_home - condition: sun after: sunset after_offset: -02:00:00 - or: - condition: template value_template: '{{ states(''sensor.terina_home_nearest_distance'')|float(0) > states(''input_number.long_distance_away_from_home'')|int(0) - 1 }}' - condition: template value_template: '{{ states(''sensor.danny_home_nearest_distance'')|float(0) > states(''input_number.long_distance_away_from_home'')|int(0) - 1 }}' actions: - action: script.send_to_home_log data: message: Changing lights to pretend someone is at home. log_level: Normal - action: script.downstairs_random_light data: {} - action: script.upstairs_random_lights data: {} mode: single - id: '1660326219450' alias: 'Weather: Morning Check For Hot Day Forecast' description: '' triggers: - trigger: time at: 09:00:00 condition: - condition: not conditions: - condition: state entity_id: input_select.home_mode state: Holiday - condition: time weekday: - fri - thu - tue - mon - wed actions: - action: script.send_to_home_log data: message: Checking if hot water needs to be turned off. title: ':sun_small_cloud: Weather' log_level: Normal - action: script.set_how_water_to_away_mode data: {} mode: single - id: '1660326219451' alias: 'Weather: Afternoon Check For Hot Day Forecast' description: '' triggers: - trigger: time at: '14:00:00' condition: - condition: not conditions: - condition: state entity_id: input_select.home_mode state: Holiday - condition: time weekday: - fri - thu - tue - mon - wed - condition: state entity_id: input_boolean.enable_hot_water_automations state: 'on' actions: - action: script.send_to_home_log data: message: Checking if hot water needs to be turned on. title: ':sun_small_cloud: Weather' - action: script.set_hot_water_to_home_mode data: {} mode: single - id: '1674478124534' alias: 'Conservatory: Cold Temperature' description: '' triggers: - trigger: numeric_state entity_id: sensor.conservatory_area_mean_temperature below: 3 condition: [] actions: - action: climate.set_preset_mode data: preset_mode: boost - action: script.send_to_home_log data: message: Conservatory fell below 3c. Boosting central heating. log_level: Normal mode: single - id: '1674916813112' alias: 'Bedroom: Lamps Off And Stairs Light On' description: '' triggers: - trigger: state entity_id: - light.bedroom_lamps from: 'on' to: 'off' condition: - condition: or conditions: - condition: state entity_id: light.stairs state: 'on' - condition: state entity_id: light.stairs_2 state: 'on' actions: - parallel: - action: script.send_to_home_log data: message: Bedroom light turned off. Turning stairs lights off. title: ':bed: Bedroom' debug: Debug - action: scene.turn_on data: transition: 2 target: entity_id: scene.stairs_light_off mode: single - id: '1698342875093' alias: 'Kitchen: mmWave Turned On Whilst In Holiday Mode' description: '' triggers: - trigger: state entity_id: - switch.kitchen_motion_mmwave_sensor to: 'on' condition: - condition: state entity_id: input_select.home_mode state: Holiday actions: - action: switch.turn_off data: {} target: entity_id: switch.kitchen_motion_mmwave_sensor mode: single - id: '1618158789152' alias: 'Shed: Door Closed' description: '' triggers: - trigger: state entity_id: binary_sensor.shed_door from: 'on' to: 'off' conditions: [] actions: - choose: - conditions: - not: - condition: state entity_id: alarm_control_panel.house_alarm state: disarmed - condition: state entity_id: binary_sensor.conservatory_door state: 'on' sequence: - action: script.send_to_home_log data: message: ':door: Door closed. Keeping conservatory :camera: camera on because :bell: alarm is armed and conservatory door is open.' title: ':hut: Shed' log_level: Debug - conditions: - not: - condition: state entity_id: alarm_control_panel.house_alarm state: disarmed - condition: state entity_id: binary_sensor.conservatory_door state: 'off' sequence: - action: script.send_to_home_log data: message: ':door: Door closed. Keeping conservatory camera on because :bell: alarm is armed.' title: ':hut: Shed' log_level: Debug - conditions: - condition: state entity_id: binary_sensor.conservatory_door state: 'on' sequence: - action: script.send_to_home_log data: message: ':door: Door closed. Keeping conservatory :camera: camera on because conservatory :door: door is open.' title: ':hut: Shed' log_level: Debug - conditions: - condition: state entity_id: alarm_control_panel.house_alarm state: disarmed sequence: - parallel: - action: script.send_to_home_log data: message: ':door: Door closed. Turning conservatory :camera: camera off.' title: ':hut: Shed' log_level: Debug - conditions: - not: - condition: state entity_id: alarm_control_panel.house_alarm state: disarmed sequence: - action: script.send_to_home_log data: message: ':door: Door closed. Keeping conservatory camera on because :bell: alarm is armed.' title: ':hut: Shed' log_level: Debug default: [] mode: single - id: '1618158998129' alias: 'Shed: Motion Detected When Door Is Closed' description: '' triggers: - trigger: state entity_id: binary_sensor.shed_motion from: 'off' to: 'on' conditions: - condition: state entity_id: binary_sensor.shed_door state: 'off' actions: - action: script.send_direct_notification data: message: ':paw_prints: Motion detected in the shed and the door is shut.' title: ':hut: Shed' log_level: Debug mode: single - id: '1660894232445' alias: 'Back Garden: Below Direct Sun Light' description: '' triggers: - trigger: numeric_state entity_id: sensor.back_garden_motion_illuminance for: hours: 0 minutes: 10 seconds: 0 below: input_number.close_blinds_brightness_threshold conditions: [] actions: - action: script.send_to_home_log data: message: Sun light has fallen below {{ states('input_number.close_blinds_brightness_threshold') }} ({{ states('sensor.back_garden_motion_illuminance') }}){{ state_attr('sensor.back_garden_motion_illuminance', 'unit_of_measurement') }}. Opening blinds/curtains. title: Back Garden log_level: Debug - if: - condition: numeric_state entity_id: cover.bedroom_blinds attribute: current_position below: input_number.blind_closed_position_threshold - condition: time before: input_datetime.childrens_bed_time then: - action: cover.open_cover target: entity_id: cover.leos_bedroom_blinds mode: single - id: '1754227355547' alias: 'Bathroom: Motion Detected' description: '' triggers: - trigger: state entity_id: - binary_sensor.bathroom_motion_pir - binary_sensor.bathroom_motion_2_occupancy to: 'on' conditions: [] actions: - choose: - conditions: - condition: state entity_id: light.bathroom_lights state: 'off' - condition: numeric_state entity_id: sensor.bathroom_area_mean_light_level above: input_number.bathroom_light_level_threshold sequence: - action: script.send_to_home_log data: message: ':paw_prints: Motion detected but it''s too bright ( {{ states(''sensor.bathroom_area_mean_light_level'') }} > {{ states(''input_number.bathroom_light_level_threshold'') }}). Skipping turning on lights.' title: ':bathtub: Bathroom' debug: Debug - conditions: - condition: state entity_id: light.bathroom_lights state: 'off' sequence: - parallel: - action: script.send_to_home_log data: message: ':paw_prints: Motion detected. Turning :bulb: light on.' title: ':bathtub: Bathroom' debug: Debug - action: light.turn_on metadata: {} data: {} target: entity_id: light.bathroom_lights default: - action: script.send_to_home_log data: message: ':paw_prints: Motion detected and :bulb: light is already on.' title: ':bathtub: Bathroom' debug: Debug - action: timer.cancel target: entity_id: timer.bathroom_light data: {} mode: single - id: '1754227694151' alias: 'Bathroom: No Motion Detected' description: '' triggers: - trigger: state entity_id: - binary_sensor.bathroom_area_motion to: 'off' for: hours: 0 minutes: 3 seconds: 0 conditions: [] actions: - choose: - alias: Door closed conditions: - condition: state entity_id: binary_sensor.bathroom_door_contact state: 'off' sequence: - action: script.send_to_home_log data: message: ':no_pedestrians: No motion detected and door closed. Skipping turning :bulb: light off.' title: ':bathtub: Bathroom' debug: Debug default: - choose: - alias: After midnight conditions: - condition: time after: 00:00:00 - condition: time before: 06:00:00 sequence: - parallel: - action: script.send_to_home_log data: message: ':no_pedestrians: No motion detected. Starting night :hourglass_flowing_sand: timer.' title: ':bathtub: Bathroom' debug: Debug - action: timer.start target: entity_id: timer.bathroom_light data: duration: 00:02:00 default: - parallel: - action: script.send_to_home_log data: message: ':no_pedestrians: No motion detected. Starting :hourglass_flowing_sand: timer.' title: ':bathtub: Bathroom' debug: Debug - action: timer.start target: entity_id: timer.bathroom_light data: duration: 00:05:00 mode: single - id: '1754254675071' alias: 'Bathroom: Light Turned Off' description: '' triggers: - trigger: state entity_id: - light.bathroom_lights to: 'off' conditions: [] actions: - parallel: - action: script.send_to_home_log data: message: ':bulb: Lights turned off. Cancelling light timer.' title: ':bathtub: Bathroom' debug: Debug - action: timer.cancel target: entity_id: timer.bathroom_light data: {} mode: single - id: '1754254675073' alias: 'Bathroom: Light Switch Toggled' description: '' triggers: - trigger: state entity_id: - binary_sensor.bathroom_light_input_0 conditions: [] actions: - delay: seconds: 1 - choose: - conditions: - condition: state entity_id: light.bathroom_lights state: 'on' sequence: - parallel: - action: script.send_to_home_log data: message: Light switch used title: ':bathtub: Bathroom' debug: Debug - action: timer.cancel target: entity_id: timer.bathroom_light data: {} default: [] mode: single - id: '1754254675072' alias: 'Bathroom: Light Timer Finished' description: '' triggers: - trigger: event event_type: timer.finished event_data: entity_id: timer.bathroom_light conditions: [] actions: - parallel: - action: script.send_to_home_log data: message: ':bulb: Light timer finished. Turning off lights.' title: ':bathtub: Bathroom' debug: Debug - action: light.turn_off metadata: {} data: {} target: entity_id: light.bathroom_lights mode: single - id: '1680461746985' alias: 'Bathroom: High Humidity' description: '' triggers: - trigger: numeric_state entity_id: sensor.bathroom_motion_humidity for: hours: 0 minutes: 30 seconds: 0 above: 59.9 conditions: - condition: state entity_id: binary_sensor.bathroom_window_contact state: 'off' actions: - action: script.send_direct_notification data: message: High Humidity ({{ states('sensor.bathroom_motion_humidity') }} > 59.9%) and window is closed. title: ':bathtub: Bathroom' log_level: Debug people: entity_id: - person.danny - person.terina mode: single - id: '1601641236163' alias: 'Bedroom: Close Blinds When Someone Is In Bed After Sunset' description: '' triggers: - trigger: state entity_id: binary_sensor.bed_occupied from: 'off' to: 'on' for: 00:00:30 conditions: - condition: numeric_state entity_id: cover.bedroom_blinds attribute: current_position above: input_number.blind_open_position_threshold - condition: state entity_id: input_boolean.enable_bedroom_blind_automations state: 'on' - condition: sun after: sunset - condition: state entity_id: binary_sensor.bedroom_window_contact state: 'off' - condition: state entity_id: input_boolean.enable_bed_sensor state: 'on' actions: - parallel: - action: script.send_to_home_log data: message: ':sleeping_accommodation: Someone is in bed, :window: window is closed and it''s getting late. Closing blinds.' title: ':bed: bedroom' log_level: Debug - action: cover.close_cover target: entity_id: cover.bedroom_blinds mode: single - id: '1600127180656' alias: 'Bedroom: Close Blinds Before Sunrise' description: '' triggers: - trigger: sun event: sunrise offset: -02:00:00 conditions: - condition: numeric_state entity_id: cover.bedroom_blinds attribute: current_position above: input_number.blind_open_position_threshold - condition: state entity_id: input_boolean.enable_bedroom_blind_automations state: 'on' - condition: state entity_id: binary_sensor.bedroom_window_contact state: 'off' actions: - parallel: - action: script.send_to_home_log data: message: ':clock{{ now().strftime(''%I'') | int }}{% if now().minute | int > 25 and now().minute | int < 35 %}30{% else %}{% endif %}: :sunrise: Bedroom blind is open and it''s nearly sunrise. Closing blinds.' title: ':bed: bedroom' log_level: Debug - action: cover.close_cover target: entity_id: cover.bedroom_blinds mode: single - id: '1622667464880' alias: 'Bedroom: Window Closed At Night' description: '' triggers: - trigger: state entity_id: binary_sensor.bedroom_window_contact from: 'on' to: 'off' conditions: - condition: state entity_id: input_boolean.enable_bedroom_blind_automations state: 'on' - condition: sun after: sunset - condition: sun before: sunrise - not: - condition: state entity_id: cover.bedroom_blinds state: closed actions: - parallel: - action: script.send_to_home_log data: message: ':window: Window closed and it''s after :city_sunset: sunset. Closing blinds.' title: ':bed: bedroom' log_level: Debug - action: cover.set_cover_position data: position: 50 mode: single - id: '1615689096351' alias: 'Bedroom: Window Closed And Someone Is In Bed At Night' description: '' triggers: - trigger: state entity_id: binary_sensor.bedroom_window_contact from: 'on' to: 'off' for: 00:00:30 conditions: - condition: numeric_state entity_id: cover.bedroom_blinds attribute: current_position above: input_number.blind_open_position_threshold - condition: state entity_id: input_boolean.enable_bedroom_blind_automations state: 'on' - condition: sun after: sunset actions: - parallel: - choose: - conditions: - condition: state entity_id: input_boolean.enable_bed_sensor state: 'on' - condition: state entity_id: binary_sensor.bed_occupied state: 'on' sequence: - action: script.send_to_home_log data: message: ':sleeping_accommodation: :window: Window shut, someone is in bed ({{states(''sensor.bed_sensor'')}}) and it''s after :city_sunset: sunset. Closing blinds.' title: ':bed: bedroom' log_level: Debug - action: cover.close_cover target: entity_id: cover.bedroom_blinds - conditions: - condition: state entity_id: input_boolean.enable_bed_sensor state: 'off' sequence: - action: script.send_to_home_log data: message: ':sleeping_accommodation: :window: Bedroom window shut, someone is in bed ({{states(''sensor.bed_sensor'')}}) and it''s after :city_sunset: sunset. Closing blinds.' title: ':bed: bedroom' log_level: Debug - action: cover.close_cover target: entity_id: cover.bedroom_blinds default: [] mode: single - id: '1601641292576' alias: 'Bedroom: Open Blind When No One Is In Bed' description: '' triggers: - trigger: state entity_id: binary_sensor.bed_occupied from: 'on' to: 'off' for: 00:00:30 conditions: - condition: numeric_state entity_id: cover.bedroom_blinds attribute: current_position below: input_number.blind_closed_position_threshold - condition: sun after: sunrise after_offset: -01:00:00 before: sunset - condition: state entity_id: input_boolean.enable_bedroom_blind_automations state: 'on' - condition: state entity_id: input_boolean.enable_bed_sensor state: 'on' actions: - delay: 00:01:00 - parallel: - action: script.send_to_home_log data: message: 'No one is in :bed: bed ({{states(''sensor.bed_sensor'')}}). Opening the blinds."' title: ':bed: bedroom' log_level: Debug - action: cover.open_cover target: entity_id: cover.bedroom_blinds mode: single - id: '1715955339483' alias: 'Bedroom: Door Closed' description: '' triggers: - trigger: state entity_id: - binary_sensor.bedroom_door_contact to: 'off' for: seconds: 10 conditions: [] actions: - choose: - conditions: - condition: state entity_id: binary_sensor.leos_bedroom_door_contact state: 'off' - condition: state entity_id: binary_sensor.ashlees_bedroom_door_contact state: 'off' - condition: state entity_id: binary_sensor.upstairs_area_motion state: 'off' sequence: - parallel: - action: script.send_to_home_log data: message: ':door: door closed.' title: ':bed: bedroom' log_level: Debug - if: - condition: state entity_id: light.stairs state: 'on' then: - action: light.turn_off metadata: {} data: transition: 1 target: entity_id: light.stairs - if: - condition: state entity_id: light.stairs_ambient state: 'on' then: - action: light.turn_off metadata: {} data: transition: 1 target: entity_id: light.stairs_ambient - if: - condition: state entity_id: light.stairs_2 state: 'on' then: - action: light.turn_off metadata: {} data: transition: 1 target: entity_id: light.stairs_2 mode: single - id: '1615209552353' alias: 'Bedroom: Other Bedroom Door Opens Warning' description: '' triggers: - trigger: state entity_id: binary_sensor.leos_bedroom_door_contact from: 'off' to: 'on' id: leo - trigger: state entity_id: binary_sensor.ashlees_bedroom_door_contact id: ashlee from: 'off' to: 'on' conditions: - or: - condition: state entity_id: light.bedroom_lamps state: 'on' - condition: state entity_id: light.bedroom_main_light state: 'on' - condition: time after: input_datetime.childrens_bed_time - not: - condition: state entity_id: input_select.home_mode state: Guest - condition: state entity_id: input_select.home_mode state: No Children actions: - parallel: - choose: - conditions: - condition: state entity_id: input_boolean.enable_bed_sensor state: 'on' - condition: state entity_id: binary_sensor.bed_occupied state: 'on' - condition: trigger id: leo sequence: - action: script.other_bedroom_door_opening_warning data: bedroom: leo - conditions: - condition: sun after: sunset - condition: trigger id: leo sequence: - action: script.send_to_home_log data: message: ':boy: :door: Leo''s door opened and bedroom light is on. Sending warning.' log_level: Debug - action: script.other_bedroom_door_opening_warning data: bedroom: leo - conditions: - condition: state entity_id: input_boolean.enable_bed_sensor state: 'on' - condition: state entity_id: binary_sensor.bed_occupied state: 'on' - condition: trigger id: ashlee sequence: - action: script.other_bedroom_door_opening_warning data: bedroom: ashlee - conditions: - condition: sun after: sunset - condition: trigger id: ashlee sequence: - action: script.other_bedroom_door_opening_warning data: bedroom: ashlee default: [] mode: queued max: 10 - id: '1615209552354' alias: 'Bedroom: Other Bedroom Door Closes Warning' description: '' triggers: - trigger: state entity_id: binary_sensor.leos_bedroom_door_contact from: 'on' to: 'off' id: leo - trigger: state entity_id: binary_sensor.ashlees_bedroom_door_contact id: ashlee from: 'on' to: 'off' conditions: - condition: state entity_id: light.bedroom_lamps state: 'on' - condition: time after: input_datetime.childrens_bed_time - not: - condition: state entity_id: input_select.home_mode state: Guest - condition: state entity_id: input_select.home_mode state: No Children actions: - parallel: - choose: - conditions: - condition: state entity_id: input_boolean.enable_bed_sensor state: 'on' - condition: state entity_id: binary_sensor.bed_occupied state: 'on' - condition: trigger id: leo sequence: - action: script.other_bedroom_door_closes_warning data: bedroom: leo - conditions: - condition: sun after: sunset - condition: trigger id: leo sequence: - action: script.send_to_home_log data: message: ':boy: :door: Leo''s door opened and bedroom light is on. Sending warning.' log_level: Debug - action: script.other_bedroom_door_closes_warning data: bedroom: leo - conditions: - condition: state entity_id: input_boolean.enable_bed_sensor state: 'on' - condition: state entity_id: binary_sensor.bed_occupied state: 'on' - condition: trigger id: ashlee sequence: - action: script.other_bedroom_door_closes_warning data: bedroom: ashlee - conditions: - condition: sun after: sunset - condition: trigger id: ashlee sequence: - action: script.other_bedroom_door_closes_warning data: bedroom: ashlee default: [] mode: queued max: 10 - id: '1724001157269' alias: 'Bedroom: Pause TV When Door Opens At Night' description: '' triggers: - trigger: state entity_id: - binary_sensor.bedroom_door_contact from: 'off' to: 'on' conditions: - or: - condition: time after: '22:00:00' - condition: time before: 02:00:00 - condition: state entity_id: media_player.bedroom_tv state: playing - not: - condition: state entity_id: media_player.bedroom_tv attribute: app_name state: BBC iPlayer actions: - parallel: - action: script.send_to_home_log data: message: 'Door opened and :tv: TV was playing. Pausing TV.' title: ':bed: bedroom' log_level: Debug - action: media_player.media_play_pause target: entity_id: media_player.bedroom_tv data: {} mode: single - id: '1621713217274' alias: 'Bedroom: Motion Detected' description: '' triggers: - trigger: state entity_id: - binary_sensor.bedroom_motion_occupancy from: 'off' to: 'on' conditions: - condition: state entity_id: input_boolean.enable_bedroom_motion_trigger state: 'on' - or: - condition: template value_template: '{{ state_attr(''light.under_bed_left'',''brightness'') == none }}' - condition: template value_template: '{{ state_attr(''light.under_bed_right'',''brightness'') == none }}' - condition: numeric_state entity_id: light.under_bed_left below: '100' attribute: brightness - condition: numeric_state entity_id: light.under_bed_right below: '100' attribute: brightness actions: - parallel: - choose: - conditions: - condition: numeric_state entity_id: cover.bedroom_blinds attribute: current_position below: '31' sequence: - action: script.send_to_home_log data: message: ':paw_prints: Motion detected and the blinds are down. Dimming ambient :bulb: :low_brightness: lights.' title: ':bed: bedroom' log_level: Debug - action: scene.turn_on target: entity_id: scene.bedroom_dim_ambient_light - conditions: - condition: time after: 08:00:00 - condition: sun before: sunset sequence: - action: script.send_to_home_log data: message: ':paw_prints: Motion detected at :city_sunrise: sunrise. Turning ambient :bulb: :high_brightness: lights on.' title: ':bed: bedroom' log_level: Debug - action: scene.turn_on target: entity_id: scene.bedroom_turn_on_ambient_light - conditions: - or: - condition: sun after: sunset - condition: time before: 08:00:00 - condition: state entity_id: input_boolean.enable_bedroom_motion_trigger state: 'on' sequence: - action: script.send_to_home_log data: message: ':paw_prints: Motion detected after :city_sunset: sunset. :bulb: :low_brightness: Dimming ambient lights.' title: ':bed: bedroom' log_level: Debug - action: scene.turn_on target: entity_id: scene.bedroom_dim_ambient_light default: [] - if: - condition: state entity_id: light.bedroom_clock_matrix state: 'off' then: - action: light.turn_on data: {} target: entity_id: light.bedroom_clock_matrix mode: single - id: '1621713867762' alias: 'Bedroom: No Motion' description: '' triggers: - trigger: state entity_id: - binary_sensor.bedroom_motion_occupancy from: 'on' to: 'off' for: 00:02:00 conditions: - or: - condition: state entity_id: light.under_bed_left state: 'on' - condition: state entity_id: light.under_bed_right state: 'on' - condition: state entity_id: input_boolean.enable_bedroom_motion_trigger state: 'on' actions: - parallel: - action: script.send_to_home_log data: message: ':no_pedestrians: No motion detected For 1 minute. Turning ambient lights off.' title: ' :bed: Bedroom' log_level: Debug - action: scene.turn_on target: entity_id: scene.bedroom_turn_off_ambient_light mode: single - id: '1621713867763' alias: 'Bedroom: No Motion For Long Time' description: '' triggers: - trigger: state entity_id: binary_sensor.bedroom_area_motion from: 'on' to: 'off' for: 00:30:00 conditions: - condition: state entity_id: light.bedroom_lamps state: 'off' - condition: state entity_id: input_boolean.enable_bedroom_motion_trigger state: 'on' actions: - parallel: - action: script.send_to_home_log data: message: ':no_pedestrians: No motion detected For 1 hour. Turning clock off.' title: ' :bed: Bedroom' log_level: Debug - action: light.turn_off data: {} target: entity_id: light.bedroom_clock_matrix mode: single - id: '1725207477313' alias: 'Bedroom: No Motion And Fan Is On' description: '' triggers: - trigger: state entity_id: - binary_sensor.bedroom_motion_3_presence to: 'off' for: hours: 0 minutes: 5 seconds: 0 conditions: - condition: state entity_id: switch.bedroom_fan state: 'on' actions: - parallel: - action: switch.turn_off metadata: {} data: {} target: entity_id: switch.bedroom_fan mode: single - id: '1690844451011' alias: 'Bedroom: Turn Off Fan' description: '' triggers: - trigger: state entity_id: - switch.bedroom_fan to: 'on' for: hours: 2 minutes: 0 seconds: 0 conditions: [] actions: - parallel: - action: script.send_to_home_log data: message: Bedroom light turned off. Turning stairs lights off. title: ':bed: Bedroom' log_level: Debug - action: switch.turn_off data: {} target: entity_id: switch.bedroom_fan mode: single - id: '1621875409014' alias: 'Bedroom: Morning Timed Open Blinds' description: 'TODO: Take into account high temperature.' triggers: - trigger: time at: 08:00:00 id: workday - trigger: time at: 08:30:00 id: 083000 - trigger: time at: 09:00:00 id: 090000 - trigger: time at: 09:30:00 id: 093000 conditions: - condition: numeric_state entity_id: cover.bedroom_blinds attribute: current_position below: input_number.bedroom_blind_closed_threshold - condition: state entity_id: input_boolean.enable_bedroom_blind_automations state: 'on' - condition: state entity_id: binary_sensor.bedroom_tv_powered_on state: 'off' actions: - choose: - conditions: - alias: Working day condition: state entity_id: binary_sensor.workday_sensor state: 'on' - alias: No annual leave in calendar condition: template value_template: '{{ ''Danny'' not in state_attr(''calendar.work'',''message'')|string and ''A/L'' not in state_attr(''calendar.work'',''message'')|string and states(''calendar.work'') == ''off'' }}' sequence: - action: cover.open_cover target: entity_id: cover.bedroom_blinds - action: script.send_to_home_log data: message: ':clock{{ now().strftime(''%I'') | int }}{% if now().minute | int > 25 and now().minute | int < 35 %}30{% else %}{% endif %}: Opening blinds because it''s closed on a working weekday!"' title: ':bed: bedroom' log_level: Debug - alias: Non workday and no children conditions: - condition: state entity_id: binary_sensor.workday_sensor state: 'off' alias: Non working day - not: - condition: state entity_id: input_select.home_mode state: No Children - condition: trigger id: 090000 sequence: - action: cover.open_cover target: entity_id: cover.bedroom_blinds - action: script.send_to_home_log data: message: ':clock{{ now().strftime(''%I'') | int }}{% if now().minute | int > 25 and now().minute | int < 35 %}30{% else %}{% endif %}: Opening blinds because it''s closed and its 09:00 on a weekend!"' title: ':bed: bedroom' log_level: Debug - alias: Non workday and no children conditions: - condition: state entity_id: binary_sensor.workday_sensor state: 'off' alias: Non working day - condition: state entity_id: input_select.home_mode state: No Children - condition: trigger id: 093000 sequence: - action: cover.open_cover target: entity_id: cover.bedroom_blinds - action: script.send_to_home_log data: message: ':clock{{ now().strftime(''%I'') | int }}{% if now().minute | int > 25 and now().minute | int < 35 %}30{% else %}{% endif %}: Opening blinds because it''s closed, there are no children and its 09:30 on a weekend!"' title: ':bed: bedroom' log_level: Debug - conditions: - condition: trigger id: 093000 sequence: - action: cover.open_cover target: entity_id: cover.bedroom_blinds - action: script.send_to_home_log data: message: ':clock{{ now().strftime(''%I'') | int }}{% if now().minute | int > 25 and now().minute | int < 35 %}30{% else %}{% endif %}: Opening blinds because it''s closed and its 09:30!"' title: ':bed: bedroom' log_level: Debug default: [] mode: single - id: '1621875567853' alias: 'Bedroom: Evening Timed Close Blinds' description: '' triggers: - trigger: time at: '22:00:00' conditions: - condition: state entity_id: input_boolean.enable_bedroom_blind_automations state: 'on' - condition: numeric_state entity_id: cover.bedroom_blinds attribute: current_position above: input_number.blind_closed_position_threshold actions: - parallel: - action: script.send_to_home_log data: message: ':clock{{ now().strftime(''%I'') | int }}{% if now().minute | int > 25 and now().minute | int < 35 %}30{% else %}{% endif %}: It''s after :city_sunset: sunset, closing bedroom''s blinds.' title: ':bed: bedroom' log_level: Debug - choose: - conditions: - condition: state entity_id: binary_sensor.bedroom_window_contact state: 'on' sequence: - action: script.send_to_home_log data: message: ':window: Window is still open. Waiting until it''s closed before closing blinds.' title: ':bed: bedroom' log_level: Debug default: - action: cover.close_cover target: entity_id: cover.bedroom_blinds mode: single - id: '1624194131454' alias: 'Bedroom: TV Turned On During Bright Day' description: '' triggers: - trigger: state entity_id: binary_sensor.bedroom_tv_powered_on from: 'off' to: 'on' conditions: - condition: state entity_id: input_boolean.enable_bedroom_blind_automations state: 'on' - condition: sun before: sunset after: sunrise - condition: numeric_state entity_id: cover.bedroom_blinds attribute: current_position above: input_number.blind_open_position_threshold actions: - parallel: - choose: - conditions: - condition: state entity_id: input_boolean.enable_direct_notifications state: 'on' - condition: state entity_id: binary_sensor.bedroom_window_contact state: 'on' sequence: - action: script.send_actionable_notification_with_2_buttons data: message: Do you want to close the blinds? title: πΊπTV On & Window Is Open people: entity_id: - person.danny action1_title: 'Yes' action1_name: set_bedroom_blinds_30 action2_title: 'No' action2_name: ignore - conditions: - condition: state entity_id: binary_sensor.bedroom_window_contact state: 'off' sequence: - action: script.send_to_home_log data: message: ':bed: Bedroom :tv: TV turned on and it''s bright. Lowering bedroom blinds.' title: ':bed: bedroom' log_level: Debug - action: cover.set_cover_position target: entity_id: cover.bedroom_blinds data: position: 20 default: [] mode: single - id: '1699308571385' alias: 'Bedroom: Remote Button 1' description: '' triggers: - trigger: device domain: mqtt device_id: 61ab87aac9c81fe8687771074e560f48 type: action subtype: button_1_press_release conditions: [] actions: - action: light.toggle data: {} target: entity_id: light.bedroom_main_light mode: single - id: '1699308571386' alias: 'Bedroom: Remote Button 2' description: '' triggers: - trigger: device domain: mqtt device_id: 61ab87aac9c81fe8687771074e560f48 type: action subtype: button_2_press_release conditions: [] actions: - if: - condition: state entity_id: light.bedroom_lamps state: 'off' then: - action: scene.turn_on target: entity_id: scene.bedroom_desk_lamps_on data: transition: 1 else: - action: light.turn_off target: entity_id: - light.bedroom_lamps - light.under_bed_left - light.under_bed_right data: {} mode: single - id: '1699308571387' alias: 'Bedroom: Remote Button 3' description: '' triggers: - trigger: device domain: mqtt device_id: 61ab87aac9c81fe8687771074e560f48 type: action subtype: button_3_press_release conditions: [] actions: - action: cover.open_cover target: entity_id: cover.bedroom_blinds data: {} mode: single - id: '1699308571388' alias: 'Bedroom: Remote Button 4' description: '' triggers: - trigger: device domain: mqtt device_id: 61ab87aac9c81fe8687771074e560f48 type: action subtype: button_4_press_release conditions: [] actions: - action: cover.close_cover target: entity_id: cover.bedroom_blinds data: {} mode: single - id: '1710079376648' alias: 'Bedroom: Remote Dial Action Right' description: '' triggers: - trigger: device domain: mqtt device_id: 61ab87aac9c81fe8687771074e560f48 type: action subtype: dial_rotate_right_slow - trigger: device domain: mqtt device_id: 61ab87aac9c81fe8687771074e560f48 type: action subtype: dial_rotate_right_step - trigger: device domain: mqtt device_id: 61ab87aac9c81fe8687771074e560f48 type: action subtype: brightness_step_up conditions: - condition: template value_template: '{{ states(''sensor.bedroom_dial_remote_action_time'')|float(15) > 0}}' actions: - action: light.turn_on metadata: {} data: brightness: '{{ iif((state_attr(''light.bedroom_lamps'', ''brightness'')|int(0) + (states(''sensor.bedroom_dial_remote_action_time'')|float(15)*2)) > 255, 255, state_attr(''light.bedroom_lamps'', ''brightness'')|int(0) + states(''sensor.bedroom_dial_remote_action_time'')|float(15)*2) }}' transition: 1 target: entity_id: - light.bedroom_lamps mode: queued max: 10 - id: '1710079376649' alias: 'Bedroom: Remote Dial Action Left' description: '' triggers: - trigger: device domain: mqtt device_id: 61ab87aac9c81fe8687771074e560f48 type: action subtype: dial_rotate_left_slow - trigger: device domain: mqtt device_id: 61ab87aac9c81fe8687771074e560f48 type: action subtype: dial_rotate_left_step - trigger: device domain: mqtt device_id: 61ab87aac9c81fe8687771074e560f48 type: action subtype: brightness_step_down conditions: - condition: template value_template: '{{ states(''sensor.bedroom_dial_remote_action_time'')|float(15) > 0}}' actions: - action: light.turn_on metadata: {} data: brightness: '{%- if states(''sensor.bedroom_dial_remote_action_time'')|float(15)*2 > state_attr(''light.bedroom_lamps'', ''brightness'')|int(0) -%} 0 {%- else -%} {{ state_attr(''light.bedroom_lamps'', ''brightness'')|int(0) - (states(''sensor.bedroom_dial_remote_action_time'')|float(15)*2) }} {%-endif-%}' transition: 1 target: entity_id: - light.bedroom_lamps mode: queued max: 10 - id: '1624194439043' alias: 'Bedroom: TV Turned Off' description: '' triggers: - trigger: state entity_id: binary_sensor.bedroom_tv_powered_on from: 'on' to: 'off' for: 00:01:00 conditions: - condition: numeric_state entity_id: cover.bedroom_blinds attribute: current_position below: input_number.bedroom_blind_closed_threshold - condition: state entity_id: input_boolean.enable_bedroom_blind_automations state: 'on' - condition: sun before: sunset - condition: sun after: sunrise - condition: time after: 08:30 actions: - action: weather.get_forecasts target: entity_id: weather.home data: type: hourly response_variable: weather - choose: - conditions: - or: - condition: numeric_state entity_id: weather.home attribute: temperature above: input_number.forecast_high_temperature - condition: template value_template: '{{ weather[''weather.home''].forecast[1].temperature > states(''input_number.forecast_high_temperature'')|float(25) }}' sequence: - action: script.send_to_home_log data: message: ':tv: TV turned off but above weather is above {{ states(''input_number.forecast_high_temperature'') }} ( {%- if state_attr(''weather.home'', ''temperature'')|float(0) > weather[''weather.home''].forecast[1].temperature|float(25) -%} {{ state_attr(''weather.home'', ''temperature'')|float(0) }} {%- else -%} {{ weather[''weather.home''].forecast[1].temperature }} {%-endif-%} {{ state_attr(''weather.home'', ''temperature_unit'') }} ). Keeping blinds closed.' title: ':bed: bedroom' log_level: Debug default: - parallel: - action: script.send_to_home_log data: message: ':tv: TV turned off. Opening Blinds.' title: ':bed: bedroom' log_level: Debug - action: cover.open_cover target: entity_id: cover.bedroom_blinds mode: single - id: '1627285063813' alias: 'Leo''s Bedroom: Timed Open Blinds Weekday' description: '' triggers: - trigger: time at: 07:45:00 conditions: - condition: state entity_id: input_boolean.enable_leos_blind_automations state: 'on' - condition: numeric_state entity_id: cover.leos_bedroom_blinds attribute: current_position below: input_number.blind_closed_position_threshold - not: - condition: state entity_id: input_select.home_mode state: Guest - not: - condition: state entity_id: input_select.home_mode state: No Children - condition: state entity_id: binary_sensor.workday_sensor state: 'on' actions: - parallel: - action: script.send_to_home_log data: message: Opening blinds. title: ':bed: Leo''s Bedroom' log_level: Debug - action: cover.open_cover target: entity_id: cover.leos_bedroom_blinds mode: single - id: '1627285063816' alias: 'Leo''s Bedroom: Timed Open Blinds Weekend' description: '' triggers: - trigger: time at: 08:00:00 conditions: - condition: state entity_id: input_boolean.enable_leos_blind_automations state: 'on' - condition: numeric_state entity_id: cover.leos_bedroom_blinds attribute: current_position below: input_number.blind_closed_position_threshold - not: - condition: state entity_id: input_select.home_mode state: Guest - not: - condition: state entity_id: input_select.home_mode state: No Children - condition: state entity_id: binary_sensor.workday_sensor state: 'on' actions: - parallel: - action: script.send_to_home_log data: message: Opening blinds. title: ':bed: Leo''s Bedroom' log_level: Debug - action: cover.open_cover target: entity_id: cover.leos_bedroom_blinds mode: single - id: '1627285063814' alias: 'Leo''s Bedroom: Timed Open Blinds Weekend No Children Mode' description: '' triggers: - trigger: time at: 09:00:00 conditions: - condition: state entity_id: input_boolean.enable_leos_blind_automations state: 'off' - condition: numeric_state entity_id: cover.leos_bedroom_blinds attribute: current_position below: input_number.blind_closed_position_threshold - condition: state state: No Children entity_id: input_select.home_mode - condition: state state: 'on' entity_id: binary_sensor.workday_sensor actions: - parallel: - action: script.send_to_home_log data: message: Opening blinds with {{ states('input_select.home_mode') }} on a non working day. title: ':bed: Leo''s Bedroom' log_level: Debug - action: cover.open_cover target: entity_id: cover.leos_bedroom_blinds mode: single - id: '1629844319596' alias: 'Leo''s Bedroom: Timed Close Blinds' description: '' triggers: - trigger: time at: input_datetime.childrens_bed_time - trigger: time at: '22:00:00' id: no_children conditions: - not: - condition: numeric_state entity_id: cover.leos_bedroom_blinds attribute: current_position below: input_number.blind_closed_position_threshold - condition: state entity_id: input_boolean.enable_leos_blind_automations state: 'on' actions: - parallel: - choose: - conditions: - condition: state entity_id: binary_sensor.leos_bedroom_window_contact state: 'on' sequence: - action: script.send_to_home_log data: message: ':warning: :clock{{ now().strftime(''%I'') | int }}{% if now().minute | int > 25 and now().minute | int < 35 %}30{% else %}{% endif %}: :city_sunset: :window: Leo''s window is open. Skipping closing blinds. :warning:' title: 'Leo''s :bed: bedroom' log_level: Debug - conditions: - condition: state entity_id: input_select.home_mode state: No Children - condition: trigger id: no_children sequence: - action: script.send_to_home_log data: message: ':clock{{ now().strftime(''%I'') | int }}{% if now().minute | int > 25 and now().minute | int < 35 %}30{% else %}{% endif %}: :window: Closing Leo''s blinds' title: 'Leo''s :bed: bedroom' log_level: Debug - action: cover.close_cover target: entity_id: cover.leos_bedroom_blinds - conditions: - condition: state entity_id: binary_sensor.leos_bedroom_window_contact state: 'off' sequence: - action: script.send_to_home_log data: message: ':clock{{ now().strftime(''%I'') | int }}{% if now().minute | int > 25 and now().minute | int < 35 %}30{% else %}{% endif %}: :window: Closing Leo''s blinds' title: 'Leo''s :bed: bedroom' log_level: Debug - action: cover.close_cover target: entity_id: cover.leos_bedroom_blinds default: [] mode: single - id: '1617376203344' alias: 'Leo''s Room: Close Blinds Before Sun Rise' description: '' triggers: - trigger: sun event: sunrise offset: -02:00:00 conditions: - condition: state entity_id: cover.leos_bedroom_blinds state: open - condition: numeric_state entity_id: cover.leos_bedroom_blinds attribute: current_position above: input_number.blind_open_position_threshold - condition: state entity_id: binary_sensor.leos_bedroom_window_contact state: 'off' actions: - parallel: - action: cover.close_cover target: entity_id: cover.leos_bedroom_blinds - action: script.send_to_home_log data: message: ':city_sunset: :window: closing Leo''s blinds.' title: 'Leo''s :bed: bedroom' log_level: Debug mode: single - id: '1617376413056' alias: 'Leo''s Room: Open Blinds In The Morning' description: '' triggers: - trigger: time at: 09:30:00 conditions: - condition: numeric_state entity_id: cover.leos_bedroom_blinds attribute: current_position below: input_number.blind_closed_position_threshold - condition: state entity_id: input_boolean.enable_leos_blind_automations state: 'on' actions: - parallel: - action: script.send_to_home_log data: message: ':sunrise: :window: Opening Leo''s blinds' title: 'Leo''s :bed: bedroom' log_level: Debug - action: cover.open_cover target: entity_id: cover.leos_bedroom_blinds mode: single - id: '1617458869658' alias: 'Leo''s Room: Open Blinds In The Morning When No One Is In Bed' description: '' triggers: - trigger: state entity_id: binary_sensor.leos_bed_occupied from: 'on' to: 'off' conditions: - condition: time after: 07:00:00 before: '12:00:00' - condition: numeric_state entity_id: cover.leos_bedroom_blinds attribute: current_position below: input_number.blind_closed_position_threshold - condition: state entity_id: input_boolean.enable_leos_blind_automations state: 'on' - condition: state entity_id: input_boolean.enable_leos_bed_sensor state: 'on' - not: - condition: state entity_id: input_select.home_mode state: Guest actions: - parallel: - action: script.send_to_home_log data: message: ':window: :bed: Someone is in Leo''s bed. Closing blinds.' title: 'Leo''s :bed: bedroom' log_level: Debug - action: cover.open_cover target: entity_id: cover.leos_bedroom_blinds mode: single - id: '1619254173098' alias: 'Leo''s Room: Window Closed At Night' description: '' triggers: - trigger: state entity_id: binary_sensor.leos_bedroom_window_contact to: 'off' from: 'on' conditions: - condition: numeric_state entity_id: cover.leos_bedroom_blinds attribute: current_position above: input_number.blind_open_position_threshold - condition: time after: '18:30:00' - condition: state entity_id: input_boolean.enable_leos_blind_automations state: 'on' actions: - choose: - conditions: - condition: state entity_id: input_boolean.enable_leos_bed_sensor state: 'on' - condition: state entity_id: binary_sensor.leos_bed_occupied state: 'on' sequence: - action: script.send_to_home_log data: message: ':window: :bed: Leo''s window closed and someone is in bed. Closing blinds.' title: 'Leo''s :bed: bedroom' log_level: Debug - action: cover.close_cover target: entity_id: cover.leos_bedroom_blinds - conditions: - condition: state entity_id: input_boolean.enable_leos_bed_sensor state: 'off' sequence: - action: script.send_to_home_log data: message: ':window: :bed: Leo''s window closed and someone is in bed. Closing blinds.' title: 'Leo''s :bed: bedroom' log_level: Debug - action: cover.close_cover target: entity_id: cover.leos_bedroom_blinds default: [] mode: single - id: '1699308571381' alias: 'Leo''s Bedroom: Remote Turn On' description: '' triggers: - trigger: device domain: mqtt device_id: 7da5565cc39ea45df83d982a085622b6 type: action subtype: on_press_release conditions: [] actions: - action: light.turn_on target: entity_id: light.leos_bedroom_main_light data: {} mode: single - id: '1699308571382' alias: 'Leo''s Bedroom: Remote Turn Off' description: '' triggers: - trigger: device domain: mqtt device_id: 7da5565cc39ea45df83d982a085622b6 type: action subtype: off_press_release conditions: [] actions: - action: light.turn_off data: {} target: entity_id: light.leos_bedroom_main_light mode: single - id: '1699308571383' alias: 'Leo''s Bedroom: Remote Up' description: '' triggers: - trigger: device domain: mqtt device_id: 7da5565cc39ea45df83d982a085622b6 type: action subtype: up_press_release conditions: [] actions: - action: cover.open_cover target: entity_id: cover.bedroom_blinds data: {} mode: single - id: '1699308571384' alias: 'Leo''s Bedroom: Remote Down' description: '' triggers: - trigger: device domain: mqtt device_id: 7da5565cc39ea45df83d982a085622b6 type: action subtype: down_press_release conditions: [] actions: - action: cover.close_cover target: entity_id: cover.bedroom_blinds data: {} mode: single - id: '1605925028960' alias: 'Ashlee''s Bedroom: Timed Close Blinds' description: '' triggers: - trigger: time at: input_datetime.childrens_bed_time - trigger: time at: '22:00:00' id: no_children conditions: - condition: numeric_state entity_id: cover.ashlees_bedroom_blinds attribute: current_position above: input_number.blind_closed_position_threshold - condition: state entity_id: input_boolean.enable_ashlees_blind_automations state: 'on' actions: - choose: - alias: Window is still open conditions: - condition: state entity_id: binary_sensor.ashlees_bedroom_window_contact state: 'on' sequence: - action: script.send_to_home_log data: message: ':warning: :clock{{ now().strftime(''%I'') | int }}{% if now().minute | int > 25 and now().minute | int < 35 %}30{% else %}{% endif %}: :window: Ashlee''s window is still open. Waiting until it''s closed before closing blinds. :warning:' title: 'Ashlee''s :bed: bedroom' log_level: Debug - alias: No children mode conditions: - condition: state entity_id: input_select.home_mode state: No Children - condition: trigger id: no_children - condition: state entity_id: binary_sensor.ashlees_bedroom_window_contact state: 'off' sequence: - action: script.send_to_home_log data: message: ':city_sunset: :window: It''s getting dark, closing Ashlee''s blinds.' title: 'Ashlee''s :bed: bedroom' log_level: Debug - action: cover.close_cover target: entity_id: cover.ashlees_bedroom_blinds - alias: Bed sensor enabled conditions: - condition: state entity_id: input_boolean.enable_ashlees_bed_sensor state: 'on' - condition: state entity_id: binary_sensor.ashlees_bedroom_window_contact state: 'off' - condition: trigger id: sunset sequence: - action: script.send_to_home_log data: message: ':clock{{ now().strftime(''%I'') | int }}{% if now().minute | int > 25 and now().minute | int < 35 %}30{% else %}{% endif %}: :city_sunset: :window: It''s getting dark and no one is in Ashlee''s :bed: bed, closing Ashlee''s blinds.' title: 'Ashlee''s :bed: bedroom' log_level: Debug - action: cover.close_cover target: entity_id: cover.ashlees_bedroom_blinds - alias: Bed sensor is off conditions: - condition: state entity_id: binary_sensor.ashlees_bedroom_window_contact state: 'off' - condition: state entity_id: input_boolean.enable_ashlees_bed_sensor state: 'off' sequence: - action: script.send_to_home_log data: message: ':clock{{ now().strftime(''%I'') | int }}{% if now().minute | int > 25 and now().minute | int < 35 %}30{% else %}{% endif %}: :city_sunset: :window: It''s getting dark, closing Ashlee''s blinds.' title: 'Ashlee''s :bed: bedroom' log_level: Debug - action: cover.close_cover target: entity_id: cover.ashlees_bedroom_blinds default: [] mode: single - id: '1622891806607' alias: 'Ashlee''s Bedroom: Window Closed After Dark' description: '' triggers: - trigger: state entity_id: - binary_sensor.ashlees_bedroom_window_contact from: 'on' to: 'off' for: hours: 0 minutes: 1 seconds: 0 conditions: - condition: numeric_state entity_id: cover.ashlees_bedroom_blinds attribute: current_position above: input_number.bedroom_blind_closed_threshold - condition: state entity_id: input_boolean.enable_ashlees_blind_automations state: 'on' - condition: time after: input_datetime.childrens_bed_time actions: - action: script.send_to_home_log data: message: ':window: Window closed and it''s dark. Closing blinds.' title: 'Ashlee''s :bed: bedroom' log_level: Debug - action: cover.close_cover target: entity_id: cover.ashlees_bedroom_blinds data: {} mode: single - id: '1599994669457' alias: 'Ashlee''s Bedroom: Open Blinds In The Morning' description: '' triggers: - trigger: time at: 08:00:00 id: early - trigger: time at: 09:00:00 id: late conditions: - condition: numeric_state entity_id: cover.ashlees_bedroom_blinds attribute: current_position below: input_number.blind_closed_position_threshold - condition: state entity_id: input_boolean.enable_ashlees_blind_automations state: 'on' - not: - condition: state entity_id: input_select.home_mode state: Guest - condition: state entity_id: input_select.home_mode state: No Children actions: - choose: - conditions: - condition: state entity_id: binary_sensor.workday_sensor state: 'off' - condition: trigger id: late sequence: - parallel: - action: script.send_to_home_log data: message: ':clock{{ now().strftime(''%I'') | int }}{% if now().minute | int > 25 and now().minute | int < 35 %}30{% else %}{% endif %}: :sunrise: :window: School day. Opening Ashlee''s blinds' title: 'Ashlee''s :bed: bedroom' log_level: Debug - action: cover.open_cover target: entity_id: cover.ashlees_bedroom_blinds - conditions: - condition: state entity_id: binary_sensor.workday_sensor state: 'on' - condition: trigger id: early sequence: - parallel: - action: script.send_to_home_log data: message: ':clock{{ now().strftime(''%I'') | int }}{% if now().minute | int > 25 and now().minute | int < 35 %}30{% else %}{% endif %}: :sunrise: :window: Non school day. Opening Ashlee''s blinds' title: 'Ashlee''s :bed: bedroom' log_level: Debug - action: cover.open_cover target: entity_id: cover.ashlees_bedroom_blinds default: [] mode: single - id: '1599994669458' alias: 'Ashlee''s Bedroom: Open Blinds In The Morning No Children Mode' description: '' triggers: - trigger: time at: 08:00:00 id: workday - trigger: time at: 09:00:00 id: non_workday conditions: - condition: state entity_id: input_select.home_mode state: No Children actions: - choose: - conditions: - condition: state state: 'off' entity_id: binary_sensor.workday_sensor - condition: trigger id: workday sequence: - action: script.send_to_home_log data: message: ':clock{{ now().strftime(''%I'') | int }}{% if now().minute | int > 25 and now().minute | int < 35 %}30{% else %}{% endif %}: :window: Opening blinds with {{ states(''input_select.home_mode'') }} on a non working day.' title: 'Ashlee''s :bed: bedroom' log_level: Debug - action: cover.open_cover target: entity_id: cover.ashlees_bedroom_blinds - conditions: - condition: state state: 'on' entity_id: binary_sensor.workday_sensor - condition: trigger id: non_workday sequence: - action: script.send_to_home_log data: message: ':clock{{ now().strftime(''%I'') | int }}{% if now().minute | int > 25 and now().minute | int < 35 %}30{% else %}{% endif %}: :window: Opening blinds with {{ states(''input_select.home_mode'') }} on a working day.' title: 'Ashlee''s :bed: bedroom' log_level: Debug - action: cover.open_cover target: entity_id: cover.ashlees_bedroom_blinds default: [] mode: single - id: '1655237597647' alias: 'Ashlee''s Bedroom: Someone Is In Bed' description: '' triggers: - trigger: state entity_id: - binary_sensor.ashlees_bed_occupied from: 'off' to: 'on' for: hours: 0 minutes: 0 seconds: 30 conditions: [] actions: - parallel: - choose: - conditions: - condition: state entity_id: input_boolean.enable_ashlees_bed_sensor state: 'on' - condition: state entity_id: input_boolean.enable_ashlees_blind_automations state: 'on' - condition: numeric_state entity_id: cover.ashlees_bedroom_blinds attribute: current_position below: input_number.blind_closed_position_threshold - or: - condition: time after: input_datetime.childrens_bed_time - condition: time before: 05:00:00 - condition: state entity_id: binary_sensor.ashlees_bedroom_window_contact state: 'off' sequence: - action: script.send_to_home_log data: message: 'Someone is in Ashlee''s :bed: bed after :clock730:. Closing blinds.' title: 'Ashlee''s :bed: bedroom' log_level: Debug - action: cover.close_cover data: {} target: entity_id: cover.ashlees_bedroom_blinds default: [] mode: single - id: '1655235874989' alias: 'Ashlee''s Bedroom: Turn Off Fan After 1 Hour' description: '' triggers: - trigger: state entity_id: - switch.ashlees_bedroom_fan to: 'on' for: hours: 1 minutes: 0 seconds: 0 conditions: [] actions: - parallel: - action: script.send_to_home_log data: message: ':fan: Fan has been on for an hour. Turning fan off.' title: ':bed: Ashlee''s bedroom' log_level: Debug - action: switch.turn_off data: {} target: entity_id: switch.ashlees_bedroom_fan mode: single - id: '1656355431188' alias: 'Ashlee''s Bedroom: Hue Remote On Button' description: '' triggers: - trigger: device domain: mqtt device_id: 43598aa0e01c65b2bfc26491940f3353 type: action subtype: on_press_release conditions: [] actions: - action: script.send_to_home_log data: message: 'Power button pressed. :bulb: Toggling light.' title: ':bed: Ashlee''s Bedroom' log_level: Debug - action: light.toggle data: {} target: entity_id: light.ashlees_bedroom_main_light mode: queued max: 10 - id: '1656355431189' alias: 'Ashlee''s Bedroom: Hue Remote Up Button' description: '' triggers: - trigger: device domain: mqtt device_id: 43598aa0e01c65b2bfc26491940f3353 type: action subtype: up_press_release conditions: [] actions: - parallel: - action: script.send_to_home_log data: message: 'Bright button on remote pressed. Opening :window: Ashlee''s blinds.' title: ':bed: Ashlee''s Bedroom' log_level: Debug - action: cover.open_cover data: {} target: entity_id: cover.ashlees_bedroom_blinds mode: queued max: 10 - id: '1656355431190' alias: 'Ashlee''s Bedroom: Hue Remote Down Button' description: '' triggers: - trigger: device domain: mqtt device_id: 43598aa0e01c65b2bfc26491940f3353 type: action subtype: down_press_release conditions: [] actions: - parallel: - action: script.send_to_home_log data: message: 'Dim button on remote pressed. Closing :window: Ashlee''s blinds.' title: ':bed: Ashlee''s Bedroom' log_level: Debug - action: cover.close_cover data: {} target: entity_id: cover.ashlees_bedroom_blinds mode: queued max: 10 - id: '1656355431191' alias: 'Ashlee''s Bedroom: Hue Remote Off Button' description: '' triggers: - trigger: device domain: mqtt device_id: 43598aa0e01c65b2bfc26491940f3353 type: action subtype: off_press_release conditions: [] actions: - parallel: - action: script.send_to_home_log data: message: 'Hue button on remote pressed. Toggle Ashlee''s main :bulb: light.' title: ':bed: Ashlee''s Bedroom' log_level: Debug - action: light.toggle data: {} target: entity_id: light.ashlees_bedroom_main_light mode: queued max: 10 - id: '1714779045289' alias: 'Bin: Taken Out' description: '' triggers: - trigger: numeric_state entity_id: - sensor.bin_estimated_distance for: hours: 1 minutes: 0 seconds: 0 above: 7 conditions: [] actions: - action: script.send_direct_notification metadata: {} data: message: Taken out. title: Bin people: entity_id: person.danny mode: single - id: '1654008759007' alias: 'Calendar: Family' description: https://community.home-assistant.io/t/how-to-calculate-subtract-two-date-time-from-eachother/8197/6 trace: stored_traces: 20 triggers: - trigger: calendar event: start entity_id: calendar.family offset: '-1:0:0' conditions: [] actions: - action: script.calendar_event_started data: calendar_id: entity_id: - calendar.family mode: queued - id: '1654008759008' alias: 'Calendar: Children Start Event' description: https://community.home-assistant.io/t/how-to-calculate-subtract-two-date-time-from-eachother/8197/6 trace: stored_traces: 20 triggers: - trigger: calendar event: start entity_id: calendar.tsang_children offset: '-1:0:0' conditions: [] actions: - action: script.calendar_event_started data: calendar_id: entity_id: - calendar.tsang_children mode: queued - id: '1654008759009' alias: 'Calendar: Children End Event' description: https://community.home-assistant.io/t/how-to-calculate-subtract-two-date-time-from-eachother/8197/6 trace: stored_traces: 20 triggers: - trigger: calendar event: end entity_id: calendar.tsang_children offset: -0:30:0 conditions: [] actions: - action: script.calendar_event_ended data: calendar_id: entity_id: - calendar.tsang_children mode: queued - id: '1647307174048' alias: 'Stairs: Check Magic Mirror Is Casting Home Assistant' description: '' triggers: - trigger: time_pattern minutes: '0' conditions: - or: - condition: state entity_id: input_select.home_mode state: guest - condition: state entity_id: group.tracked_people state: home - not: - condition: state entity_id: alarm_control_panel.house_alarm state: armed_away actions: - parallel: - action: script.send_to_home_log data: message: Casting Home Assistant. title: ':mirror: Magic Mirror' log_level: Debug - action: cast.show_lovelace_view data: entity_id: media_player.stairs_chromecast dashboard_path: lovelace-magicmirror view_path: home mode: single - id: '1672397019959' alias: 'Chromecast: Google TV Turned Playing' description: '' triggers: - trigger: state entity_id: - media_player.lounge_tv - media_player.bedroom_tv to: playing - trigger: state entity_id: - media_player.lounge_tv - media_player.bedroom_tv attribute: media_title to: playing - trigger: state entity_id: - media_player.lounge_tv - media_player.bedroom_tv attribute: app_name to: playing conditions: [] actions: - choose: - conditions: - condition: template value_template: '{{ state_attr(trigger.entity_id, ''media_position'') != none }}' sequence: - action: script.google_tv_playing_notification data: entity_id: '{{ trigger.entity_id }}' mode: queued max: 10 - id: '1650387098757' alias: 'Deebot: Error' description: '' triggers: - trigger: state entity_id: vacuum.t8 to: error conditions: [] actions: - action: script.send_to_home_log data: message: ':warning: :robot_face: :broom: Vacuum has encountered an error :warning:' title: ':robot_face: :broom: Vacuum' log_level: Normal mode: single - id: '1650387098756' alias: 'Deebot: Fully Charged' description: '' triggers: - trigger: numeric_state entity_id: vacuum.t8 above: '99' attribute: battery_level conditions: [] actions: - action: script.send_to_home_log data: message: ':battery: Fully charged' title: ':robot_face: :broom: Vacuum' log_level: Debug mode: single - id: '1654865901253' alias: 'Deebot: Finished Cleaning' description: '' triggers: - trigger: state entity_id: - vacuum.t8 to: docked for: hours: 0 minutes: 1 seconds: 0 not_from: unavailable conditions: [] actions: - action: script.send_home_log_with_url data: message: Cleaning complete title: ':robot_face: :broom: Vacuum' url: '{{ states(''input_text.external_url'') }}{{ state_attr(''image.t8_map'',''entity_picture'') }}' mode: single - id: '1610234394136' alias: 'Conservatory: Motion Detected And It''s Dark' description: '' triggers: - trigger: state entity_id: - binary_sensor.conservatory_area_motion - binary_sensor.conservatory_motion_occupancy from: 'off' to: 'on' conditions: - condition: numeric_state entity_id: sensor.conservatory_motion_illuminance below: input_number.conservatory_light_level_threshold - condition: state entity_id: input_boolean.enable_conservatory_motion_trigger state: 'on' - or: - condition: numeric_state entity_id: light.conservatory attribute: brightness below: '9' - condition: template value_template: '{{ state_attr(''light.conservatory'', ''brightness'') == none }}' actions: - parallel: - action: script.send_to_home_log data: message: ':paw_prints: Motion detected and it''s dark ({{ states(''sensor.conservatory_motion_illuminance'', with_unit=True) }} < ({{ states(''input_number.conservatory_light_level_threshold'', with_unit=True) }}). Turning :bulb: :high_brightness: light on.' title: Conservatory log_level: Debug - action: scene.turn_on target: entity_id: scene.conservatory_turn_on_light data: transition: 2 mode: single - id: '1610234794461' alias: 'Conservatory: No Motion Detected Dim Lights' description: '' triggers: - trigger: state to: 'off' for: 00:01:00 entity_id: binary_sensor.conservatory_area_motion from: 'on' conditions: - condition: state entity_id: light.conservatory state: 'on' - condition: state entity_id: input_boolean.enable_conservatory_motion_trigger state: 'on' actions: - parallel: - action: script.send_to_home_log data: message: ':no_pedestrians: No motion. :bulb: :low_brightness: Dimming lights.' title: Conservatory log_level: Debug - action: scene.turn_on target: entity_id: scene.conservatory_dim_light data: transition: 2 mode: single - id: '1610238960657' alias: 'Conservatory: No Motion Turning Turn Lights Off' description: '' triggers: - trigger: state entity_id: binary_sensor.conservatory_area_motion to: 'off' for: 00:01:30 conditions: - condition: state entity_id: light.conservatory state: 'on' - condition: state entity_id: input_boolean.enable_conservatory_motion_trigger state: 'on' actions: - parallel: - action: script.send_to_home_log data: message: ':no_pedestrians: No motion. Turning lights off.' title: Conservatory log_level: Debug - action: scene.turn_on target: entity_id: scene.conservatory_turn_off_light data: transition: 2 mode: single - id: '1629146628067' alias: 'Conservatory: Person Detected' description: '' triggers: - trigger: state entity_id: binary_sensor.conservatory_person_detected from: 'off' to: 'on' conditions: - condition: state entity_id: alarm_control_panel.house_alarm state: armed_away actions: - action: camera.snapshot data_template: filename: '{{ states(''input_text.latest_frigate_conservatory_person_file_path'') }}' target: entity_id: camera.conservatory_high_resolution_channel - action: script.send_home_log_with_local_attachments data_template: message: Frigate detected a person in the conservatory. title: Person detected in conservatory log_level: Normal filePath: '{{ states(''input_text.latest_frigate_conservatory_person_file_path'') }}' mode: queued max: 10 - id: '1628985027639' alias: 'Conservatory: Door Open' description: '' triggers: - trigger: state entity_id: binary_sensor.conservatory_door to: 'on' conditions: [] actions: - parallel: - action: script.send_to_home_log data: message: ':door: Door opened.' title: Conservatory log_level: Debug - if: - condition: not conditions: - condition: state entity_id: climate.thermostat state: 'off' then: - action: script.send_to_home_log data: message: Turning off the heating. title: Conservatory log_level: Debug - action: script.set_central_heating_to_off data: {} mode: single - id: '1628985156167' alias: 'Conservatory: Door Closed' description: '' triggers: - trigger: state entity_id: binary_sensor.conservatory_door to: 'off' from: 'on' conditions: [] actions: - parallel: - action: script.send_to_home_log data: message: ':door: Conservatory door closed.' log_level: Debug - action: script.set_central_heating_to_home_mode data: {} - choose: - conditions: - condition: state entity_id: binary_sensor.shed_door state: 'on' - condition: state entity_id: binary_sensor.back_garden_gate_contact state: 'on' sequence: - action: script.send_direct_notification data: message: ':door: Door closed. :hut: shed :door: door and gate is still open.' title: Conservatory people: entity_id: - person.danny - person.terina - conditions: - condition: state entity_id: binary_sensor.shed_door state: 'on' sequence: - action: script.send_direct_notification data: message: ':door: Door closed and :hut: shed :door: door is still open.' title: Conservatory people: entity_id: - person.danny - person.terina - conditions: - condition: state entity_id: binary_sensor.back_garden_gate_contact state: 'on' sequence: - action: script.send_direct_notification data: message: ':door: Door closed and gate is still open.' title: Conservatory people: entity_id: - person.danny - person.terina default: [] mode: single - id: '1733767153966' alias: 'Conservatory: Turn On Airer' description: '' triggers: - trigger: state entity_id: - binary_sensor.conservatory_airer_schedule_1 conditions: - condition: state entity_id: input_boolean.enable_conservatory_airer_schedule state: 'on' actions: - action: script.check_conservatory_airer data: {} mode: single - id: '1733767153967' alias: 'Conservatory: Turn Off Airer' description: '' triggers: - trigger: state entity_id: - binary_sensor.conservatory_airer_schedule_1 to: 'off' conditions: - condition: state entity_id: input_boolean.enable_conservatory_airer_schedule state: 'on' actions: - parallel: - action: script.send_to_home_log metadata: {} data: log_level: Normal message: Airer schedule 1 is off. Turning airer off. title: Conservatory - action: switch.turn_off metadata: {} data: {} target: entity_id: switch.airer mode: single - id: '1689437015870' alias: 'EcoFlow: Solar Below House Consumption' description: '' triggers: - trigger: numeric_state entity_id: sensor.ecoflow_solar_excess below: 0 for: hours: 0 minutes: 5 seconds: 0 conditions: - or: - condition: numeric_state entity_id: sensor.octopus_energy_electricity_current_rate above: sensor.octopus_energy_electricity_export_current_rate - condition: state entity_id: sensor.octopus_energy_electricity_current_rate state: unavailable - or: - and: - condition: numeric_state entity_id: number.ecoflow_kitchen_backup_reserve_level above: input_number.ecoflow_kitchen_minimum_backup_reserve - condition: state entity_id: switch.ecoflow_kitchen_backup_reserve_enabled state: 'on' - and: - condition: numeric_state entity_id: number.ecoflow_office_backup_reserve_level above: input_number.ecoflow_office_minimum_backup_reserve - condition: state entity_id: switch.ecoflow_office_backup_reserve_enabled state: 'on' - condition: state entity_id: input_boolean.enable_ecoflow_automations state: 'on' actions: - action: script.ecoflow_check_charging_mode data: current_electricity_import_rate: '{{ states(''sensor.octopus_energy_electricity_current_rate'') }}' current_electricity_import_rate_unit: '{{ state_attr(''sensor.octopus_energy_electricity_current_rate'', ''unit_of_measurement'') }}' current_electricity_export_rate: '{{ states(''sensor.octopus_energy_electricity_export_current_rate'') }}' - if: - condition: state entity_id: timer.check_solar_excess state: active then: - action: timer.cancel data: {} target: entity_id: timer.check_solar_excess mode: restart - id: '1689437015871' alias: 'EcoFlow: Solar Above House Consumption' description: '' triggers: - trigger: numeric_state entity_id: sensor.ecoflow_solar_excess above: input_number.ecoflow_charge_solar_threshold for: hours: 0 minutes: 5 seconds: 0 - trigger: event event_type: timer.finished event_data: entity_id: timer.check_solar_excess conditions: - condition: state entity_id: switch.ecoflow_kitchen_backup_reserve_enabled state: 'on' - condition: state entity_id: input_boolean.enable_ecoflow_automations state: 'on' actions: - parallel: - action: script.ecoflow_check_charging_mode data: current_electricity_import_rate: '{{ states(''sensor.octopus_energy_electricity_current_rate'') }}' current_electricity_import_rate_unit: '{{ state_attr(''sensor.octopus_energy_electricity_current_rate'', ''unit_of_measurement'') }}' current_electricity_export_rate: '{{ states(''sensor.octopus_energy_electricity_export_current_rate'') }}' - choose: - conditions: - condition: numeric_state entity_id: sensor.grid_power below: 0 - not: - condition: state entity_id: timer.check_solar_excess state: active sequence: - action: timer.start data: duration: 00:05:00 target: entity_id: timer.check_solar_excess mode: queued max: 10 - id: '1695566530591' alias: 'EcoFlow: Battery Low And Plug Is Off' description: '' triggers: - trigger: numeric_state entity_id: sensor.ecoflow_kitchen_battery_level below: sensor.ecoflow_kitchen_minimum_backup_reserve_low_threshold - trigger: numeric_state entity_id: sensor.ecoflow_office_battery_level below: sensor.ecoflow_office_minimum_backup_reserve_low_threshold conditions: - or: - condition: state entity_id: switch.ecoflow_kitchen_plug state: 'off' - condition: state entity_id: switch.ecoflow_office_plug state: 'off' - condition: state entity_id: input_boolean.enable_ecoflow_automations state: 'on' actions: - choose: - conditions: - condition: template value_template: '{{ trigger.entity_id == ''sensor.ecoflow_kitchen_battery_level''}}' - condition: state entity_id: switch.ecoflow_kitchen_plug state: 'off' sequence: - parallel: - action: script.send_direct_notification data: message: Fridge Freezer switch is off and battery level ({{ states('sensor.ecoflow_kitchen_battery_level') }}) below minimum ({{ states('sensor.ecoflow_kitchen_minimum_backup_reserve_low_threshold') }}). Turning on. title: EcoFlow people: entity_id: - person.danny - action: switch.turn_on metadata: {} data: {} target: entity_id: switch.ecoflow_kitchen_plug - action: script.ecoflow_set_charge_rate data: entity_id: number.ecoflow_kitchen_ac_charging_power target_charge_rate: 200 - action: script.ecoflow_set_backup_reserve data: entity_id: number.ecoflow_kitchen_backup_reserve_level target_reserve_amount: '{{ states(''input_number.ecoflow_kitchen_minimum_backup_reserve'') }}' - conditions: - condition: template value_template: '{{ trigger.entity_id == ''sensor.ecoflow_office_battery_level''}}' - condition: state entity_id: switch.ecoflow_office_plug state: 'off' sequence: - parallel: - action: script.send_direct_notification data: message: Office switch is off and battery level ({{ states('sensor.ecoflow_office_battery_level') }}) below minimum ({{ states('sensor.ecoflow_office_minimum_backup_reserve_low_threshold') }}). Turning on. title: EcoFlow people: entity_id: - person.danny - action: switch.turn_on metadata: {} data: {} target: entity_id: switch.ecoflow_office_plug default: [] mode: single - id: '1719062430507' alias: 'EcoFlow: Kitchen Plug Offline' description: '' triggers: - trigger: numeric_state entity_id: - sensor.ecoflow_kitchen_battery_level below: sensor.ecoflow_kitchen_minimum_backup_reserve_low_threshold conditions: - condition: state entity_id: input_boolean.enable_ecoflow_automations state: 'on' - condition: or conditions: - condition: state entity_id: switch.ecoflow_kitchen_plug state: unavailable - condition: state entity_id: switch.ecoflow_kitchen_plug state: unknown actions: - action: script.send_direct_notification metadata: {} data: people: entity_id: - person.danny title: EcoFlow message: Kitchen plug is offline! mode: single - id: '1719062430508' alias: 'EcoFlow: Office Plug Offline' description: '' triggers: - trigger: numeric_state entity_id: - sensor.ecoflow_office_battery_level below: sensor.ecoflow_office_minimum_backup_reserve_low_threshold conditions: - condition: state entity_id: input_boolean.enable_ecoflow_automations state: 'on' - condition: or conditions: - condition: state entity_id: switch.ecoflow_office_plug state: unavailable - condition: state entity_id: switch.ecoflow_office_plug state: unknown actions: - action: script.send_direct_notification metadata: {} data: people: entity_id: - person.danny title: EcoFlow message: Office plug is offline! mode: single - id: '1719061926981' alias: 'Ecoflow: Kitchen Battery Low And Switch Comes Online' description: '' triggers: - trigger: state entity_id: - switch.ecoflow_kitchen_plug from: unavailable to: 'off' conditions: - condition: state entity_id: input_boolean.enable_ecoflow_automations state: 'on' - condition: numeric_state entity_id: sensor.ecoflow_kitchen_battery_level below: sensor.ecoflow_kitchen_minimum_backup_reserve_low_threshold actions: - parallel: - action: script.send_direct_notification metadata: {} data: title: EcoFlow message: Kitchen Battery Below minimum threshold {{ states('sensor.ecoflow_kitchen_battery_level') }}({{ states('sensor.ecoflow_kitchen_minimum_backup_reserve_low_threshold') }}) and switch has become available. Turning switch on. people: entity_id: - person.danny - action: switch.turn_on data: {} target: entity_id: switch.ecoflow_kitchen_plug mode: single - id: '1719061926982' alias: 'Ecoflow: Office Battery Low And Switch Comes Online' description: '' triggers: - trigger: state entity_id: - switch.ecoflow_office_plug from: unavailable to: 'off' conditions: - condition: state entity_id: input_boolean.enable_ecoflow_automations state: 'on' - condition: numeric_state entity_id: sensor.ecoflow_office_battery_level below: sensor.ecoflow_office_minimum_backup_reserve_low_threshold actions: - parallel: - action: script.send_direct_notification metadata: {} data: title: EcoFlow message: Office Battery Below minimum threshold {{ states('sensor.ecoflow_office_battery_level') }}({{ states('sensor.ecoflow_office_minimum_backup_reserve_low_threshold') }}) and switch has become available. Turning switch on. people: entity_id: - person.danny - action: switch.turn_on data: {} target: entity_id: switch.ecoflow_office_plug mode: single - id: '1714563193661' alias: 'EcoFlow: Battery Ultra Low And Plug Is Off' description: '' triggers: - trigger: numeric_state entity_id: - sensor.ecoflow_kitchen_battery_level below: 6 conditions: - condition: state entity_id: switch.ecoflow_kitchen_plug state: 'off' actions: - parallel: - action: script.send_direct_notification metadata: {} data: message: Ecoflow battery is ultra low and unable to turn the plug on. title: ':cook: Kitchen' people: entity_id: - person.danny - person.terina mode: single - id: '1714641195916' alias: 'Ecoflow: Goes Offline' description: '' triggers: - trigger: state entity_id: - sensor.ecoflow_kitchen_main_battery_level to: unknown for: minutes: 30 - trigger: state entity_id: - sensor.ecoflow_kitchen_main_battery_level to: unavailable for: minutes: 30 conditions: - condition: state entity_id: input_boolean.enable_ecoflow_automations state: 'on' actions: - if: - condition: state entity_id: switch.ecoflow_kitchen_plug state: 'off' then: - parallel: - action: script.send_to_home_log data: message: Kitchen has been offline for more than 30 minutes and the plug is switched off. Turning Fridge Freeze plug on. title: EcoFlow log_level: Debug - action: switch.turn_on metadata: {} data: {} target: entity_id: switch.ecoflow_kitchen_plug mode: single - id: '1734262347581' alias: 'Ecoflow: No Power Drawn By Device' description: '' triggers: - trigger: numeric_state entity_id: - sensor.ecoflow_kitchen_power_over_12_hours below: 9.9 conditions: - condition: state entity_id: input_select.home_mode state: Holiday actions: - action: script.send_direct_notification metadata: {} data: message: Check Ecoflow In the kitchen for power. title: Kitchen people: entity_id: - person.danny mode: single - id: '1745329568830' alias: 'Ecoflow: Sunset' description: '' triggers: - trigger: sun event: sunset conditions: - not: - condition: state entity_id: input_select.home_mode state: Holiday actions: - parallel: - action: script.ecoflow_office_turn_off_plug data: {} - action: script.ecoflow_kitchen_turn_off_plug data: {} mode: single - id: '1713094180264' alias: 'Ecowitt: Offline' description: '' triggers: - trigger: state entity_id: - sensor.gw2000a_dewpoint for: minutes: 3 - trigger: state entity_id: - sensor.gw2000a_solar_lux to: unavailable for: minutes: 1 conditions: [] actions: - parallel: - action: script.send_to_home_log metadata: {} data: message: Ecowitt GW2000A({{ trigger.entity_id }}) has frozen or is unavailable. Rebooting. title: Ecowitt log_level: Debug - sequence: - action: switch.turn_off target: entity_id: switch.gw2000a_plug data: {} - delay: seconds: 2 - action: switch.turn_on target: entity_id: switch.gw2000a_plug data: {} mode: single - id: '1677762423485' alias: 'Energy: Eddi Diverting Energy' description: '' triggers: - trigger: state entity_id: - sensor.myenergi_eddi_status to: Diverting conditions: - condition: not conditions: - condition: state entity_id: sensor.myenergi_eddi_energy_consumed_session_daily state: unknown - condition: state entity_id: input_boolean.enable_hot_water_automations state: 'on' - condition: state entity_id: input_boolean.enable_eddi_automations state: 'on' actions: - action: script.send_to_home_log data: message: ':fuelpump: Eddi diverting energy. It has diverted {{ states(''sensor.myenergi_eddi_energy_consumed_session_daily'', with_unit=True) }} so far.' title: myEnergi log_level: Debug mode: queued max: 10 - id: '1685005214749' alias: 'HVAC: Eddi Turn On' description: '' triggers: - trigger: time at: 00:00:00 - trigger: time at: '13:00:00' conditions: - condition: state entity_id: select.myenergi_eddi_operating_mode state: Stopped - not: - condition: state entity_id: input_select.home_mode state: Holiday - condition: state entity_id: input_boolean.enable_hot_water_automations state: 'on' - condition: state entity_id: input_boolean.enable_eddi_automations state: 'on' actions: - parallel: - action: script.send_to_home_log data: message: ':clock{{ now().strftime(''%I'') | int }}{% if now().minute | int > 25 and now().minute | int < 35 %}30{% else %}{% endif %}: Turning :fuelpump: Eddi back on.' title: myEnergi log_level: Debug - action: timer.cancel target: entity_id: timer.eddi_max_temperature_reached data: {} - action: select.select_option data: option: Normal target: entity_id: select.myenergi_eddi_operating_mode mode: single - id: '1678578286486' alias: 'HVAC: Eddi Generated Hot Water And Hot Water Is On' description: '' triggers: - trigger: numeric_state entity_id: sensor.myenergi_eddi_energy_consumed_per_heating_cycle above: input_number.hot_water_solar_diverter_boiler_cut_off conditions: - condition: state entity_id: input_boolean.enable_hot_water_automations state: 'on' - condition: state entity_id: water_heater.thermostat state: 'on' - condition: state entity_id: input_boolean.enable_eddi_automations state: 'on' actions: - action: script.send_to_home_log data: message: 'Eddi has heated enough hot water {{ states(''sensor.myenergi_eddi_energy_consumed_per_heating_cycle'') }} in the last 6 hours (> {{ states(''input_number.hot_water_solar_diverter_boiler_cut_off'')|float(0) }}) {{ state_attr(''sensor.myenergi_eddi_energy_consumed_session'', ''unit_of_measurement'') }} and the hot water is on. Turning off hot water.' title: ':hotsprings: Central Heating' log_level: Normal - action: script.set_hot_water_to_home_mode data: {} mode: single - id: '1712238362391' alias: 'Eddi: Max Temperature Reached' description: '' triggers: - trigger: state entity_id: - sensor.myenergi_eddi_status to: Max temp reached conditions: - condition: state entity_id: input_boolean.enable_hot_water_automations state: 'on' - condition: state entity_id: input_boolean.enable_eddi_automations state: 'on' actions: - parallel: - action: script.send_to_home_log metadata: {} data: message: Hot water tank reached max temperature. title: Eddi log_level: Debug - action: timer.start target: entity_id: timer.eddi_max_temperature_reached data: duration: 04:00:00 - action: script.hvac_check_eddi_boost_hot_water data: current_electricity_import_rate: '{{ states(''sensor.octopus_energy_electricity_current_rate'') }}' mode: single - id: '1694521590171' alias: 'Front Garden: Doorbell Pressed' description: '' triggers: - trigger: state entity_id: - event.front_door_ding conditions: [] actions: - parallel: - action: script.send_direct_notification data: message: Someone pressed the door bell. title: Porch people: entity_id: - person.danny - person.terina - action: script.alexa_announce data: message: Ding dong. - action: input_boolean.turn_on target: entity_id: input_boolean.wait_for_doorbell_camera_update - alias: Delayed notification sequence: - action: todo.get_items target: entity_id: - todo.shared_notifications data: status: needs_action response_variable: todo_list - if: - condition: state entity_id: group.tracked_people state: not_home - alias: Does not already exist condition: template value_template: '{%- for t in todo_list[''todo.shared_notifications''][''items''] -%} {%- if t.summary == '':door: :bell: Someone rung the door bell.'' -%} {{ false }} {%- break -%} {%- endif-%} {%- endfor -%}' then: - action: todo.add_item data: item: ':door: :bell: Someone rung the door bell.' target: entity_id: todo.shared_notifications - alias: Take picture sequence: - wait_for_trigger: - trigger: state entity_id: - camera.front_door timeout: minutes: 1 continue_on_timeout: false - action: script.send_direct_notification_with_url data: message: Door bell pressed title: Front Door people: entity_id: - person.danny url: '{{ state_attr(''camera.front_door'', ''entity_picture'') }}' url_type: image - action: script.send_direct_notification_with_url data: message: Door bell pressed title: Front Door people: entity_id: - person.danny url: '{{ state_attr(''camera.front_door'', ''video_url'') }}' url_type: video mode: single - id: '1621070004545' alias: 'Front Garden: Doorbell Camera Updated' description: '' triggers: - trigger: state entity_id: camera.front_door not_to: unavailable conditions: - condition: template value_template: '{{ state_attr(''camera.front_door'', ''last_video_id'') | string != states(''input_text.doorbell_last_video_id'') | string}}' actions: - action: downloader.download_file data: url: '{{ state_attr(''camera.front_door'', ''video_url'') }}' subdir: front_door filename: latest.mp4 overwrite: true mode: queued max: 10 - id: '1720276673719' alias: 'Front Garden: Vehicle Detected On Driveway' description: '' triggers: - trigger: state entity_id: - binary_sensor.driveway_vehicle_detected from: 'off' to: 'on' conditions: [] actions: - action: camera.snapshot metadata: {} data: filename: '{{ states(''input_text.driveway_vehicle_latest_image_path'') }}/vehicle_latest.jpg' target: entity_id: camera.driveway_high_resolution_channel - action: gpt4vision.image_analyzer data: provider: Ollama max_tokens: 100 target_width: 3840 model: llava detail: high temperature: 0.1 include_filename: false message: Is there a Tesco van Ignoring all other vehicles found. Answer with yes or no. image_file: '{{ states(''input_text.driveway_vehicle_latest_image_path'') }}/vehicle_latest.jpg' response_variable: ai - action: script.send_home_log_with_local_attachments data: message: '{{ ai.response_text }}' title: Vehicle Detected filePath: '{{ states(''input_text.driveway_vehicle_latest_image_path'') }}/vehicle_latest.jpg' people: entity_id: - person.danny mode: single - id: '1660894232444' alias: 'Front Garden: Below Direct Sun Light' description: '' triggers: - trigger: numeric_state entity_id: sensor.front_garden_motion_illuminance for: hours: 0 minutes: 10 seconds: 0 below: input_number.close_blinds_brightness_threshold conditions: - condition: state entity_id: sensor.season state: summer actions: - action: script.send_to_home_log data: message: Sun light has fallen below {{ states('input_number.close_blinds_brightness_threshold') }} ({{ states('sensor.front_garden_motion_illuminance', with_unit=True) }}). Opening office blinds/curtains. title: Front Garden log_level: Normal - action: cover.set_cover_position data: position: 25 target: entity_id: cover.office_blinds - if: - condition: numeric_state entity_id: cover.bedroom_blinds attribute: current_position below: input_number.blind_closed_position_threshold - condition: sun before: sunset - condition: state entity_id: binary_sensor.bedroom_tv_powered_on state: 'off' then: - action: cover.open_cover target: entity_id: cover.bedroom_blinds - if: - condition: numeric_state entity_id: cover.ashlees_bedroom_blinds attribute: current_position below: input_number.blind_closed_position_threshold - condition: time before: input_datetime.childrens_bed_time then: - action: cover.open_cover target: entity_id: cover.ashlees_bedroom_blinds mode: single - id: '1714914120928' alias: 'Front Garden: Lock Box State Changed' description: '' triggers: - trigger: state entity_id: - binary_sensor.outdoor_lock_box_contact not_from: - unknown - unavailable not_to: - unknown - unavailable - trigger: state entity_id: - binary_sensor.outdoor_lock_box_contact not_from: - unknown - unavailable to: - unknown - unavailable for: hours: 0 minutes: 1 seconds: 0 conditions: [] actions: - action: script.send_direct_notification metadata: {} data: title: Lock Box message: Was {{ states('binary_sensor.outdoor_lock_box_contact') }} people: entity_id: - person.danny - person.terina mode: single - id: '1718364408150' alias: 'Front Garden: Lockbox Sensor Disconnected' description: '' triggers: - trigger: state entity_id: - binary_sensor.outdoor_lock_box_contact to: unavailable for: hours: 0 minutes: 5 seconds: 0 conditions: [] actions: - action: script.send_direct_notification metadata: {} data: message: Lockbox sensor has disconnected. people: entity_id: - person.danny mode: single - id: '1613937312554' alias: Home Assistant CI description: https://community.home-assistant.io/t/guide-to-setting-up-a-fully-automated-ci-for-hassio/51576 triggers: - trigger: webhook webhook_id: git_pull allowed_methods: - POST local_only: false conditions: - condition: state entity_id: input_boolean.enable_github_integration state: 'on' actions: - choose: - conditions: - condition: template value_template: '{{ trigger.json.key_token|string == states(''input_text.github_pull_key'') }}' sequence: - parallel: - action: script.send_to_home_log data: message: 'build :white_check_mark: passed. Pulling changes.' title: ':construction_worker: :hammer_and_wrench: GitHub' log_level: Normal - action: hassio.addon_start data: addon: core_git_pull default: - action: script.send_direct_notification data: message: 'Build :white_check_mark: passed but incorrect :key: key was sent.' title: ':warning: :construction_worker: :hammer_and_wrench: GitHub :warning:' people: entity_id: - person.danny mode: single - id: '1666470473971' alias: 'HVAC: Heating Mode Changed' description: '' triggers: - trigger: state entity_id: - sensor.thermostat_mode to: SCHEDULE - trigger: state entity_id: - water_heater.thermostat to: eco conditions: [] actions: - action: script.send_to_home_log data: message: Central heating mode changed to {{ states('sensor.thermostat_mode') }} title: ':hotsprings: :droplet: Boiler' - choose: - conditions: - condition: state entity_id: input_select.home_mode state: Holiday sequence: - action: script.send_direct_notification data: message: In holiday mode so heating should not be on. Turning heating off. title: ':hotsprings: :droplet: Boiler' people: entity_id: - person.danny - action: script.set_central_heating_to_away_mode data: {} mode: single - id: '1666470473973' alias: 'HVAC: Heating Mode Changed To Automatic' description: '' triggers: - trigger: state entity_id: - climate.thermostat to: auto conditions: - condition: state entity_id: input_boolean.enable_central_heating_automations state: 'on' actions: - action: script.send_direct_notification data: message: Thermostat switched to auto mode (again). title: ':hotsprings: :droplet: Boiler' people: entity_id: - person.danny mode: single - id: '1666470473974' alias: 'HVAC: Heating Turned On' description: Also check every 5 minutes for back to back schedules trace: stored_traces: 40 triggers: - trigger: state entity_id: - schedule.central_heating to: 'on' - trigger: time_pattern minutes: /5 conditions: - or: - condition: not conditions: - alias: Thermostat temperature is the same as schedule temperature condition: template value_template: '{{ state_attr(''climate.thermostat'', ''temperature'') == state_attr(''schedule.central_heating'', ''temperature'') }}' - condition: not conditions: - condition: state entity_id: climate.thermostat state: heat - condition: state entity_id: schedule.central_heating state: 'on' - condition: state entity_id: input_boolean.enable_central_heating_automations state: 'on' actions: - action: script.check_and_run_central_heating data: {} mode: queued max: 2 - id: '1666470473975' alias: 'HVAC: Heating Turned Off' description: '' triggers: - trigger: state entity_id: - schedule.central_heating to: 'off' conditions: - condition: state entity_id: input_boolean.enable_central_heating_automations state: 'on' actions: - choose: - conditions: - condition: state entity_id: input_select.home_mode state: Holiday sequence: - action: script.send_to_home_log data: message: In Holiday mode. Skipping turning off central heating. title: ':hotsprings: :droplet: Boiler' log_level: Normal default: - parallel: - action: script.send_to_home_log data: message: Thermostat switched off. Setting temperature to 7c. title: ':hotsprings: :droplet: Boiler' log_level: Normal - action: climate.set_temperature target: entity_id: - climate.thermostat data: hvac_mode: heat temperature: 7 mode: single - id: '1740955286496' alias: 'HVAC: Unavailable' description: '' triggers: - trigger: state entity_id: - climate.thermostat to: unavailable for: hours: 1 minutes: 0 seconds: 0 conditions: - condition: state entity_id: input_boolean.enable_central_heating_automations state: 'on' actions: - action: script.send_direct_notification metadata: {} data: people: entity_id: - person.danny - person.terina message: Hive central heating is offline. mode: single - id: '1666470473972' alias: 'HVAC: Hot Water Mode Changed' description: '' triggers: - trigger: state entity_id: - water_heater.thermostat to: eco - trigger: state entity_id: - water_heater.thermostat to: 'on' conditions: [] actions: - action: script.send_to_home_log data: message: Hot water mode changed to {{ states('water_heater.thermostat') }} title: ':hotsprings: :droplet: Boiler' - choose: - conditions: - condition: state entity_id: input_select.home_mode state: Holiday sequence: - action: script.send_direct_notification data: message: In holiday mode so hot water should not be on. Turning hot water off. title: ':hotsprings: :droplet: Boiler' people: entity_id: - person.danny - action: script.set_how_water_to_away_mode data: {} mode: single - id: '1662589192400' alias: 'Central Heating: Turn On Hot Water' description: '' triggers: - trigger: state entity_id: - schedule.hot_water to: 'on' conditions: - condition: state entity_id: input_boolean.enable_hot_water_automations state: 'on' - not: - condition: state entity_id: water_heater.thermostat state: 'on' actions: - choose: - alias: In Holiday Mode conditions: - condition: state entity_id: input_select.home_mode state: Holiday sequence: - action: script.send_to_home_log data: message: In Holiday mode. Skipping turning on hot water. title: ':hotsprings: Central Heating' log_level: Debug - alias: Already Heated Hot water conditions: - condition: template value_template: '{{ (states(''sensor.myenergi_eddi_energy_consumed_per_heating_cycle'')|float(0)) > (states(''input_number.hot_water_solar_diverter_boiler_cut_off'')|float(0)) }} ' sequence: - action: script.send_to_home_log data: message: 'Eddi has heated the hot water {{ states(''sensor.myenergi_eddi_energy_consumed_per_heating_cycle'') }} (> {{ states(''input_number.hot_water_solar_diverter_boiler_cut_off'')|float(0) }}). {{ state_attr(''sensor.myenergi_eddi_energy_consumed_session'', ''unit_of_measurement'') }} was heated today. Skipping scheduled turning on hot water.' title: ':hotsprings: Central Heating' log_level: Normal default: - action: script.send_to_home_log data: message: Turning on hot water from schedule. title: ':hotsprings: Central Heating' log_level: Debug - action: script.set_how_water_to_on data: {} mode: single - id: '1662589333109' alias: 'Central Heating: Turn Off Hot Water' description: '' triggers: - trigger: state entity_id: - schedule.hot_water to: 'off' for: hours: 0 minutes: 0 seconds: 30 conditions: - condition: state entity_id: input_boolean.enable_hot_water_automations state: 'on' - not: - condition: state entity_id: water_heater.thermostat state: 'off' actions: - choose: - conditions: - condition: state entity_id: input_select.home_mode state: Holiday sequence: - action: script.send_to_home_log data: message: In Holiday mode. Skipping turning off hot water. title: ':hotsprings: Central Heating' log_level: Normal default: - action: script.send_to_home_log data: message: Turning off hot water from schedule. title: ':hotsprings: Central Heating' log_level: Normal - action: script.set_hot_water_to_home_mode data: {} mode: single - id: '1631138390675' alias: 'Home Mode: Changed' description: '' triggers: - trigger: state entity_id: input_select.home_mode conditions: [] actions: - action: script.send_to_home_log data: message: ':repeat: Entering {{ states(''input_select.home_mode'') }} mode.' title: Home Mode log_level: Debug - choose: - conditions: - condition: state entity_id: input_select.home_mode state: Holiday sequence: - action: script.home_mode_turn_on_holiday_mode data: {} - conditions: - condition: state entity_id: input_select.home_mode state: Normal sequence: - action: script.home_mode_turn_on_normal_mode data: {} default: [] mode: single - id: '1646257483770' alias: 'Home: Privacy Mode Turned On' description: '' triggers: - trigger: state entity_id: input_boolean.privacy_mode to: 'on' conditions: [] actions: - action: script.send_to_home_log data: message: ':detective: Privacy mode enabled.' log_level: Debug - action: script.send_to_home_log data: message: ':camera: Turning conservatory camera recording and detection off.' mode: single - id: '1647094528209' alias: Enter Naughty Step Mode description: '' triggers: - trigger: state entity_id: input_boolean.naughty_step_mode from: 'off' to: 'on' conditions: [] actions: - action: script.send_to_home_log data: message: Entering naughty step mode. log_level: Debug - action: scene.turn_on data: {} target: entity_id: - scene.living_room_lights_off - scene.stairs_light_2_off - scene.stairs_light_off - action: input_boolean.turn_off data: {} target: entity_id: - input_boolean.enable_living_room_motion_triggers - input_boolean.enable_stairs_motion_triggers mode: single - id: '1608489438291' alias: 'Home Assistant: Shutdown' description: '' triggers: - trigger: homeassistant event: shutdown conditions: [] actions: - action: script.send_to_home_log data: message: ':black_square_for_stop: Shutting down.' title: Home Assistant log_level: Normal mode: single - id: '1608489396143' alias: 'Home Assistant: Start Up' description: '' triggers: - trigger: homeassistant event: start conditions: [] actions: - parallel: - action: script.send_to_home_log data: message: ':arrow_forward: Started.' title: Home Assistant log_level: Normal - alias: Check Solar Assistant action: script.solar_assistant_check_charging_mode data: event: event current_electricity_import_rate: '{{ states(''sensor.octopus_energy_electricity_current_rate'') }}' current_electricity_import_rate_unit: '{{ state_attr(''sensor.octopus_energy_electricity_current_rate'', ''unit_of_measurement'') }}' current_electricity_export_rate: '{{ states(''sensor.octopus_energy_electricity_export_current_rate'') }}' - alias: Check Zappi choose: - conditions: - condition: state entity_id: input_boolean.enable_zappi_automations state: 'on' - not: - condition: state entity_id: sensor.myenergi_zappi_plug_status state: EV Disconnected sequence: - action: script.zappi_check_ev_charge data: current_electricity_import_rate: '{{ states(''sensor.octopus_energy_electricity_current_rate'') }}' current_electricity_import_rate_unit: '{{ state_attr(''sensor.octopus_energy_electricity_current_rate'', ''unit_of_measurement'') }}' current_electricity_export_rate: '{{ states(''sensor.octopus_energy_electricity_export_current_rate'') }}' - alias: Is Terina working from home action: script.check_terinas_work_laptop_status data: {} - alias: Check 3D printer enclosure light action: script.3d_printer_check_turn_off_light data: {} - alias: Check Magic Mirror casting choose: - conditions: - or: - condition: state entity_id: input_select.home_mode state: guest - condition: state entity_id: group.tracked_people state: home - not: - condition: state entity_id: alarm_control_panel.house_alarm state: armed_away sequence: - parallel: - action: script.send_to_home_log data: message: Casting Home Assistant. title: ':mirror: Magic Mirror' log_level: Debug - action: cast.show_lovelace_view data: entity_id: media_player.stairs_chromecast dashboard_path: lovelace-magicmirror view_path: home default: [] - if: - condition: state entity_id: binary_sensor.front_door state: 'off' then: - action: light.turn_off target: label_id: dedicate_notification_light entity_id: light.porch data: {} mode: single - id: '1664657264986' alias: 'Home Assistant: Update Available' description: '' triggers: - trigger: state entity_id: update.home_assistant_core_update from: 'off' to: 'on' conditions: - not: - condition: state entity_id: input_select.home_assistant_automatic_upgrade state: Disabled actions: - action: script.upgrade_home_assistant data: {} mode: single - id: '1738875026613' alias: 'Home Assistant: Weekday Backup' description: '' triggers: - trigger: time at: '17:00:00' conditions: - condition: time weekday: - mon - tue - wed - thu - fri actions: - action: hassio.backup_full metadata: {} data: compressed: true mode: single - id: '1738875026614' alias: 'Home Assistant: Weekend Backup' description: '' triggers: - trigger: time at: '11:00:00' conditions: - condition: time weekday: - sat - sun actions: - action: hassio.backup_full metadata: {} data: compressed: true mode: single - id: '1678125037184' alias: 'HVAC: House Target Temperature Changed' description: '' triggers: - trigger: state entity_id: - sensor.thermostat_target_temperature conditions: [] actions: - action: script.send_to_home_log data: message: 'Home thermostat target temperature changed. Updating TRV from {{ state_attr(''climate.living_room_radiator'', ''temperature'')|float(22) }} to {{ state_attr(''climate.thermostat'', ''temperature'')|float(22) }}c.' title: ':hotsprings: :droplet: Boiler' log_level: Debug - action: climate.set_temperature data: temperature: '{{ states(''sensor.thermostat_target_temperature'')|float(22) }}' target: entity_id: - climate.ashlees_bedroom_radiator - climate.bedroom_radiator - climate.kitchen_radiator - climate.leos_bedroom_radiator - climate.living_room_radiator - climate.office_radiator mode: single - id: '1678271646645' alias: 'HVAC: Radiators Below Target Temperature' description: Monitor rooms below temperature with TRVs triggers: - trigger: numeric_state entity_id: sensor.bedroom_radiator_temperature for: hours: 0 minutes: 30 seconds: 0 below: sensor.bedroom_radiator_minimum_target_temperature - trigger: numeric_state entity_id: sensor.leos_radiator_temperature for: hours: 0 minutes: 30 seconds: 0 below: sensor.leos_radiator_minimum_target_temperature - trigger: numeric_state entity_id: sensor.living_room_radiator_temperature for: hours: 0 minutes: 30 seconds: 0 below: sensor.living_room_radiator_minimum_target_temperature - trigger: numeric_state entity_id: sensor.office_radiator_temperature for: hours: 0 minutes: 30 seconds: 0 below: sensor.office_radiator_minimum_target_temperature id: office conditions: - not: - condition: state entity_id: climate.thermostat attribute: hvac_action state: heating actions: - choose: - conditions: - condition: trigger id: - office - condition: state entity_id: binary_sensor.office_windows state: 'off' - condition: state entity_id: binary_sensor.conservatory_door state: 'off' sequence: - action: script.send_direct_notification data: message: Radiator to call for heat. title: ':office: Office' people: entity_id: - person.danny default: - action: script.send_direct_notification data: message: Radiator call for heat in. title: '{%- if trigger.entity_id == ''sensor.bedroom_radiator_temperature'' -%} :bed: bedroom {%- elif trigger.entity_id == ''sensor.leos_radiator_temperature'' -%} Leo''s :bed: bedroom {%- elif trigger.entity_id == ''sensor.living_room_radiator_temperature'' -%} :couch_and_lamp: Living Room {%- elif trigger.entity_id == ''sensor.office_radiator_temperature'' -%} :office: Office {%- else -%} Unknown location {%- endif -%}' people: entity_id: - person.danny mode: single - id: '1583797341647' alias: 'Kitchen: Turn Off Lights At Night' description: '' triggers: - trigger: time at: '23:30:00' conditions: - condition: state entity_id: light.kitchen_lights state: 'on' actions: - action: script.send_to_home_log data: message: ':clock{{ now().strftime(''%I'') | int }}{% if now().minute | int > 25 and now().minute | int < 35 %}30{% else %}{% endif %}: Turning main lights off"' title: ':cook: Kitchen' log_level: Debug - action: scene.turn_on target: entity_id: scene.kitchen_main_lights_off data: transition: 2 mode: single - id: '1606652871369' alias: 'Kitchen: No Motion' description: '' triggers: - trigger: state entity_id: binary_sensor.kitchen_area_motion from: 'on' to: 'off' for: 00:05:00 conditions: - condition: state entity_id: input_boolean.enable_kitchen_motion_triggers state: 'on' actions: - parallel: - action: script.send_to_home_log data: message: ':no_pedestrians: No motion after :city_sunrise: and before :city_sunset:. Turning main lights off.' title: ':cook: Kitchen' log_level: Debug - action: scene.turn_on target: entity_id: scene.kitchen_main_lights_dim data: transition: 2 - choose: - conditions: - condition: time after: 00:00:00 - condition: sun before: sunset sequence: - action: script.send_to_home_log data: message: ':no_pedestrians: No motion after :city_sunrise: and before :city_sunset:. Turning ambient lights off.' title: ':cook: Kitchen' log_level: Debug - action: scene.turn_on target: entity_id: scene.kitchen_ambient_lights_off data: transition: 2 - conditions: - and: - condition: sun after: sunset - condition: time before: '23:59:59' sequence: - action: script.send_to_home_log data: message: ':no_pedestrians: No motion after :city_sunset: and before :city_sunrise:. :low_brightness: Dimming ambient :bulb: :low_brightness: lights.' title: ':cook: Kitchen' log_level: Debug - action: scene.turn_on target: entity_id: scene.kitchen_ambient_lights_dim default: [] mode: single - id: '1606652871370' alias: 'Kitchen: No Motion Turn Off Lights' description: '' triggers: - trigger: state from: 'on' to: 'off' for: 00:07:00 entity_id: binary_sensor.kitchen_area_motion conditions: - condition: state entity_id: input_boolean.enable_kitchen_motion_triggers state: 'on' actions: - parallel: - action: script.send_to_home_log data: message: ':no_pedestrians: No motion after :city_sunrise: and before :city_sunset:. Turning main lights off.' title: ':cook: Kitchen' log_level: Debug - action: scene.turn_on target: entity_id: scene.kitchen_main_lights_off data: transition: 2 - choose: - conditions: - and: - condition: sun after: sunset - condition: time before: '23:59:59' sequence: - action: script.send_to_home_log data: message: ':no_pedestrians: No motion after :city_sunset: and before :city_sunrise:. Turning ambient lights off.' title: ':cook: Kitchen' log_level: Debug - action: scene.turn_on target: entity_id: scene.kitchen_ambient_lights_off data: transition: 2 default: [] mode: single - id: '1606294735952' alias: 'Kitchen: Turn Off Lights In The Morning' description: '' triggers: - trigger: time at: 09:00:00 id: weekend - trigger: time at: 08:50:00 id: weekday conditions: - condition: time weekday: - sat - sun - condition: state entity_id: light.kitchen_lights state: 'on' - condition: state entity_id: input_boolean.enable_kitchen_motion_triggers state: 'on' actions: - parallel: - choose: - conditions: - condition: time weekday: - mon - tue - wed - thu - fri - condition: trigger id: weekday sequence: - action: script.send_to_home_log data: message: ':clock{{ now().strftime(''%I'') | int }}{% if now().minute | int > 25 and now().minute | int < 35 %}30{% else %}{% endif %}: Turning ambient lights off.' title: ':cook: Kitchen' log_level: Debug - action: scene.turn_on target: entity_id: scene.kitchen_ambient_lights_off data: transition: 2 - conditions: - condition: time weekday: - sat - sun - condition: trigger id: weekend sequence: - action: script.send_to_home_log data: message: ':clock{{ now().strftime(''%H'')}}: Turning ambient lights off.' title: ':cook: Kitchen' log_level: Debug - action: scene.turn_on target: entity_id: scene.kitchen_ambient_lights_off data: transition: 2 default: [] mode: single - id: '1588197104336' alias: 'Kitchen: Timed Turn On Lights (Dim)' description: '' triggers: - trigger: sun event: sunset - trigger: time at: 06:45:00 conditions: - and: - not: - condition: state entity_id: input_select.home_mode state: Guest - condition: state entity_id: group.tracked_people state: home actions: - parallel: - action: script.send_to_home_log data: message: ':bulb: At least one person is :house_with_garden: home. Dimming accent :bulb: :low_brightness: lights.' title: ':cook: Kitchen' log_level: Debug - action: scene.turn_on target: entity_id: scene.kitchen_dim_accent_lights data: transition: 2 mode: single - id: '1606158191303' alias: 'Kitchen: Motion Detected Table Lights Off' description: '' triggers: - trigger: state entity_id: - binary_sensor.kitchen_area_motion - binary_sensor.kitchen_motion_2_occupancy - binary_sensor.kitchen_motion_occupancy to: 'on' conditions: - condition: state entity_id: input_boolean.enable_kitchen_motion_triggers state: 'on' - or: - condition: state entity_id: light.kitchen_table_white state: 'off' - and: - condition: state entity_id: light.kitchen_table_white state: 'on' - condition: numeric_state entity_id: light.kitchen_table_white attribute: brightness below: 100 actions: - parallel: - action: script.send_to_home_log data: message: ':paw_prints: Motion detected. Turning table :bulb: :high_brightness: lights on.' title: ':cook: Kitchen' log_level: Debug - action: scene.turn_on target: entity_id: scene.kitchen_table_lights_on mode: queued max: 10 - id: '1606158191306' alias: 'Kitchen: Motion Detected Cooker Lights Off' description: '' triggers: - trigger: state entity_id: - binary_sensor.kitchen_area_motion - binary_sensor.kitchen_motion_2_occupancy - binary_sensor.kitchen_motion_occupancy to: 'on' conditions: - condition: state entity_id: input_boolean.enable_kitchen_motion_triggers state: 'on' - condition: state entity_id: light.kitchen_cooker_white state: 'off' actions: - parallel: - action: script.send_to_home_log data: message: ':paw_prints: Motion detected and it''s dark ({{ states(''sensor.kitchen_motion_illuminance'') }} & {{ states(''sensor.kitchen_motion_2_illuminance_lux'') }} < {{ states(''input_number.kitchen_light_level_threshold'') }} & {{ states(''input_number.kitchen_light_level_2_threshold'', with_unit=True) }}). Turning kitchen cooker :bulb: :high_brightness: lights on.' title: ':cook: Kitchen' log_level: Debug - action: scene.turn_on target: entity_id: scene.kitchen_cooker_lights_on mode: queued max: 10 - id: '1606158191309' alias: 'Kitchen: Motion Detected Cooker Lights On' description: '' triggers: - trigger: state entity_id: - binary_sensor.kitchen_area_motion - binary_sensor.kitchen_motion_2_occupancy - binary_sensor.kitchen_motion_occupancy to: 'on' conditions: - condition: state entity_id: input_boolean.enable_kitchen_motion_triggers state: 'on' - condition: state entity_id: light.kitchen_cooker_white state: 'on' - condition: numeric_state entity_id: light.kitchen_cooker_white attribute: brightness below: 100 actions: - parallel: - action: script.send_to_home_log data: message: ':paw_prints: Motion detected and it''s dark ({{ states(''sensor.kitchen_motion_illuminance'') }} & {{ states(''sensor.kitchen_motion_2_illuminance_lux'') }} < {{ states(''input_number.kitchen_light_level_threshold'') }} & {{ states(''input_number.kitchen_light_level_2_threshold'', with_unit=True) }}). Turning up cooker :bulb: :high_brightness: lights.' title: ':cook: Kitchen' log_level: Debug - action: scene.turn_on target: entity_id: scene.kitchen_cooker_lights_on mode: queued max: 10 - id: '1606158191304' alias: 'Kitchen: Motion Detected Ambient Lights On' description: '' triggers: - trigger: state entity_id: binary_sensor.kitchen_area_motion to: 'on' conditions: - condition: state entity_id: input_boolean.enable_kitchen_motion_triggers state: 'on' - or: - condition: state entity_id: light.kitchen_cabinets state: 'on' - condition: state entity_id: light.kitchen_down_lights state: 'on' - condition: state entity_id: light.kitchen_draws state: 'on' actions: - parallel: - choose: - conditions: - or: - condition: numeric_state entity_id: light.kitchen_cabinets attribute: brightness below: '100' - condition: numeric_state entity_id: light.kitchen_down_lights attribute: brightness below: '100' - condition: numeric_state entity_id: light.kitchen_draws attribute: brightness below: '100' sequence: - action: script.send_to_home_log data: message: ':paw_prints: Motion detected. Turning up accent :bulb: :high_brightness: lights.' title: ':cook: Kitchen' log_level: Debug - action: scene.turn_on data: transition: 1 target: entity_id: scene.kitchen_accent_lights_on default: [] mode: queued max: 10 - id: '1606158191305' alias: 'Kitchen: Motion Detected Ambient Lights Off' description: '' triggers: - trigger: state entity_id: binary_sensor.kitchen_area_motion to: 'on' conditions: - condition: state entity_id: input_boolean.enable_kitchen_motion_triggers state: 'on' - or: - condition: state entity_id: light.kitchen_cabinets state: 'off' - condition: state entity_id: light.kitchen_down_lights state: 'off' - condition: state entity_id: light.kitchen_draws state: 'off' actions: - parallel: - action: script.send_to_home_log data: message: ':paw_prints: Motion detected. Turning accent :bulb: :high_brightness: lights on.' title: ':cook: Kitchen' log_level: Debug - action: scene.turn_on data: transition: 1 target: entity_id: scene.kitchen_dim_accent_lights mode: single - id: '1721248529363' alias: 'Kitchen: Cooker Light Switch Toggle' description: '' triggers: - trigger: state entity_id: - binary_sensor.kitchen_cooker_light_input not_from: - unavailable - unknown not_to: - unavailable - unknown conditions: [] actions: - action: light.toggle metadata: {} data: transition: 1 target: entity_id: light.kitchen_cooker_white mode: queued max: 10 - id: '1721248529364' alias: 'Kitchen: Table Light Switch Toggle' description: '' triggers: - trigger: state entity_id: - binary_sensor.kitchen_table_light_input not_from: - unavailable - unknown not_to: - unavailable - unknown conditions: [] actions: - action: light.toggle metadata: {} data: transition: 1 target: entity_id: light.kitchen_table_white mode: queued max: 10 - id: '1595678795895' alias: 'Kitchen: Fridge Door Open' description: '' triggers: - trigger: state entity_id: binary_sensor.kitchen_fridge_door_contact from: 'off' to: 'on' conditions: [] actions: - action: script.send_to_home_log data: message: ':door: :snowflake: Fridge door opened.' title: ':cook: Kitchen' log_level: Debug mode: single - id: '1595678900778' alias: 'Kitchen: Fridge Door Closed' description: '' triggers: - trigger: state entity_id: binary_sensor.kitchen_fridge_door_contact from: 'on' to: 'off' conditions: [] actions: - action: script.send_to_home_log data: message: ':snowflake: Fridge :door: door closed.' title: ':cook: Kitchen' log_level: Debug mode: single - id: '1595679010793' alias: 'Kitchen: Fridge Open For A Long Period Of Time' description: '' triggers: - trigger: state entity_id: binary_sensor.kitchen_fridge_door_contact from: 'off' to: 'on' for: 00:04:00 - trigger: state entity_id: binary_sensor.kitchen_fridge_door_contact to: 'on' for: 00:30:00 - trigger: state entity_id: binary_sensor.kitchen_fridge_door_contact to: 'on' for: 00:45:00 - trigger: state entity_id: binary_sensor.kitchen_fridge_door_contact to: 'on' for: 01:00:00 conditions: [] actions: - parallel: - action: script.send_direct_notification data: message: ':snowflake: Fridge :door: door is open has been open for more than {{ relative_time(states.binary_sensor.kitchen_fridge_door_contact.last_changed) }}!' title: ':warning: :cook: Kitchen :warning:' - action: script.alexa_announce data: message: Kitchen Freezer door has been open for more than {{ relative_time(states.binary_sensor.kitchen_fridge_door_contact.last_changed) }}! mode: single - id: '1595678795896' alias: 'Kitchen: Freezer Door Open' description: '' triggers: - trigger: state entity_id: binary_sensor.kitchen_freezer_door_contact from: 'off' to: 'on' conditions: [] actions: - action: script.send_to_home_log data: message: ':snowflake: Freezer :door: door opened.' title: ':cook: Kitchen' log_level: Debug mode: single - id: '1595678900779' alias: 'Kitchen: Freezer Door Closed' description: '' triggers: - trigger: state entity_id: binary_sensor.kitchen_freezer_door_contact from: 'on' to: 'off' conditions: [] actions: - action: script.send_to_home_log data: message: ':snowflake: Freezer :door: door closed.' title: ':cook: Kitchen' log_level: Debug mode: single - id: '1595679010796' alias: 'Kitchen: Freezer Open For A Long Period Of Time' description: '' triggers: - trigger: state entity_id: binary_sensor.kitchen_freezer_door_contact for: 00:04:00 from: 'off' to: 'on' conditions: [] actions: - action: script.send_direct_notification data: message: ':snowflake: Freezer :door: door has been open for more than 4 minutes!' title: ':warning: :cook: Kitchen :warning:' mode: single - id: '1657801925107' alias: 'Kitchen: Fridge Freezer Plug Turned Off' description: '' triggers: - trigger: state entity_id: - switch.ecoflow_kitchen_plug to: unavailable for: hours: 0 minutes: 2 seconds: 0 conditions: [] actions: - parallel: - action: script.send_to_home_log data: message: Fridge Freezer plug is turned off. title: ':cook: Kitchen' log_level: Debug - action: script.send_direct_notification data: message: Fridge Freezer plug is turned unavailable. title: ':cook: Kitchen' people: entity_id: - person.danny mode: single - id: '1688681085048' alias: 'Kitchen: Low Water Softener Salt' description: '' triggers: - trigger: numeric_state entity_id: sensor.water_softener_salt_level_average above: input_number.low_water_softener_salt_level for: hours: 2 minutes: 0 seconds: 0 conditions: [] actions: - action: script.send_direct_notification data: message: Low salt in water softener. title: ':cook: Kitchen' people: entity_id: - person.danny - person.terina mode: single - id: '1688681085049' alias: 'Kitchen: No Water Softener Salt' description: '' triggers: - trigger: state entity_id: sensor.water_softener_salt_level_average to: input_number.no_water_softener_salt_level conditions: [] actions: - action: script.send_direct_notification data: message: ':warning: No salt in water softener. :warning:' title: ':cook: Kitchen' people: entity_id: - person.danny - person.terina mode: single - id: '1694521590170' alias: 'Kitchen: Oven Preheated' description: '' triggers: - trigger: numeric_state entity_id: sensor.oven_channel_1_power below: 100 conditions: - condition: state entity_id: binary_sensor.oven_powered_on state: 'on' - condition: state entity_id: input_boolean.oven_preheated state: 'off' - condition: state entity_id: input_boolean.enable_oven_automations state: 'on' actions: - parallel: - action: script.kitchen_oven_preheated_notification data: message: 'Oven has :hotsprings: preheated.' title: ':cook: Kitchen' - action: input_boolean.turn_on data: {} target: entity_id: input_boolean.oven_preheated - action: script.alexa_announce data: message: Oven has preheated. mode: single - id: '1694521864037' alias: 'Kitchen: Reset Oven Preheated' description: '' triggers: - trigger: state entity_id: - binary_sensor.oven_powered_on to: 'off' for: hours: 0 minutes: 1 seconds: 0 conditions: - condition: state entity_id: input_boolean.oven_preheated state: 'on' - condition: state entity_id: input_boolean.enable_oven_automations state: 'on' actions: - parallel: - action: script.send_to_home_log data: message: Turning off oven preheat indicator. title: ':cook: Kitchen' log_level: Normal - action: input_boolean.turn_off data: {} target: entity_id: input_boolean.oven_preheated mode: single - id: '1694521590172' alias: 'Kitchen: Dishwasher Cycle Starts' description: '' triggers: - trigger: state entity_id: binary_sensor.dishwasher_powered_on to: 'on' conditions: - condition: state entity_id: input_boolean.dishwasher_cycle_in_progress state: 'off' - condition: state entity_id: input_boolean.enable_dishwasher_automations state: 'on' actions: - parallel: - action: script.send_to_home_log data: message: Dishwasher has started. title: ':cook: Kitchen' - action: input_boolean.turn_on data: {} target: entity_id: input_boolean.dishwasher_cycle_in_progress mode: single - id: '1694521864038' alias: 'Kitchen: Reset Oven Preheated' description: '' triggers: - trigger: state entity_id: - binary_sensor.dishwasher_powered_on to: 'off' for: hours: 0 minutes: 31 seconds: 0 conditions: - condition: state entity_id: input_boolean.dishwasher_cycle_in_progress state: 'on' - condition: state entity_id: input_boolean.enable_dishwasher_automations state: 'on' actions: - parallel: - action: script.send_to_home_log data: message: Dishwasher cycle completed. title: ':cook: Kitchen' log_level: Normal - action: input_boolean.turn_off data: {} target: entity_id: input_boolean.dishwasher_cycle_in_progress mode: single - id: '1595679010797' alias: 'Kitchen: Dishwasher Started' description: '' triggers: - trigger: state entity_id: input_boolean.dishwasher_cycle_in_progress to: 'on' conditions: [] actions: - if: - condition: state entity_id: input_boolean.dishwasher_clean_cycle state: 'off' then: - action: script.send_to_home_log data: message: ':knife_fork_plate: :soap: Dishwasher :arrow_forward: Started.' title: ':cook: Kitchen' log_level: Debug - action: rest_command.consume_dishwasher_tablet data: {} - action: homeassistant.update_entity data: entity_id: - sensor.dishwasher_tablet_stock - if: - condition: numeric_state entity_id: sensor.dishwasher_tablet_stock below: 9 then: - action: script.send_direct_notification data: message: Dishwasher tablets are running low ( {{ states('sensor.dishwasher_tablet_stock') }} remaining). Consider ordering more. title: ':cook: Kitchen' people: entity_id: - person.danny - person.terina else: - action: script.send_to_home_log data: message: ':knife_fork_plate: :soap: Dishwasher :arrow_forward: Started in clean mode.' title: ':cook: Kitchen' log_level: Debug - action: input_boolean.turn_off target: entity_id: input_boolean.dishwasher_clean_cycle data: {} mode: single - id: '1595679010798' alias: 'Kitchen: Dishwasher Finished' description: '' triggers: - trigger: state entity_id: input_boolean.dishwasher_cycle_in_progress from: 'on' to: 'off' conditions: [] actions: - action: script.dishwashing_complete_notification data: message: ':knife_fork_plate: :soap: Dishwasher :checkered_flag: Finished.' title: ':cook: Kitchen' mode: single - id: '1716112515827' alias: 'Kitchen: Paper Draw Opened' description: '' triggers: - trigger: state entity_id: - binary_sensor.kitchen_paper_draw_contact from: 'off' to: 'on' conditions: [] actions: - action: script.send_direct_notification metadata: {} data: message: Paper draw opened title: Kitchen mode: single - id: '1735567472488' alias: 'Kitchen: Using Power From The Grid' description: '' triggers: - trigger: numeric_state entity_id: - sensor.grid_power above: 100 conditions: - condition: state entity_id: binary_sensor.kitchen_area_motion state: 'on' - condition: state entity_id: light.kitchen_cooker_rgb state: 'off' - condition: state entity_id: light.kitchen_table_rgb state: 'off' - condition: numeric_state entity_id: sensor.growatt_sph_battery_state_of_charge above: input_number.growatt_battery_discharge_stop_soc - not: - condition: state entity_id: sensor.growatt_sph_inverter_mode state: Battery first actions: - parallel: - action: script.send_to_home_log data: message: Pulling power from the grid title: ':cook: Kitchen' log_level: Debug - choose: - alias: Battery has charge left conditions: - or: - condition: numeric_state entity_id: sensor.growatt_sph_battery_state_of_charge above: input_number.growatt_battery_discharge_stop_soc - condition: numeric_state entity_id: sensor.growatt_battery_discharge_power below: 100 sequence: - action: scene.turn_on target: entity_id: - scene.kitchen_table_ambient_light_to_pink - scene.kitchen_cooker_ambient_light_to_pink - alias: Battery has charge left conditions: - or: - condition: template value_template: '{{ states(''sensor.growatt_sph_battery_state_of_charge'')|float(0) <= states(''input_number.growatt_battery_discharge_stop_soc'')|float(0) }}' - condition: numeric_state entity_id: sensor.growatt_battery_discharge_power below: 100 sequence: - action: script.kitchen_pulse_ambient_light_pink data: {} mode: single - id: '1735567472489' alias: 'Kitchen: Stops using Power From The Grid' description: '' triggers: - trigger: numeric_state entity_id: - sensor.grid_power below: 100 conditions: - condition: state entity_id: light.kitchen_cooker_rgb state: 'on' - condition: state entity_id: light.kitchen_table_rgb state: 'on' - condition: state entity_id: binary_sensor.front_door state: 'off' actions: - parallel: - action: script.send_to_home_log data: message: Pulling power from the grid title: ':cook: Kitchen' log_level: Debug - action: light.turn_off target: entity_id: - light.kitchen_cooker_rgb - light.kitchen_table_rgb mode: single - id: '1757836826541' alias: 'Kitchen: Smoke Alarm' description: '' triggers: - trigger: state entity_id: - binary_sensor.kitchen_smoke_alarm_smoke to: 'on' conditions: [] actions: - parallel: - action: script.send_direct_notification metadata: {} data: message: ':warning: Smoke alarm triggered :warning:' title: ':warning: :cook: Kitchen :warning:' - action: script.alexa_announce data: message: Warning! Kitchen smoke alarm triggered. mode: single - id: '1617814309728' alias: 'Office: TV On' description: '' triggers: - trigger: state entity_id: media_player.office_tv from: 'off' to: 'on' conditions: [] actions: - if: - condition: template value_template: '{{ state_attr(''media_player.office_tv'', ''source'') != none }}' then: - action: script.send_to_home_log data: message: ':tv: Office TV turned on and playing {{ state_attr(''media_player.office_tv'', ''source'') }}.' log_level: Normal else: - action: script.send_to_home_log data: message: ':tv: Office TV turned on.' log_level: Debug mode: queued max: 10 - id: '1617814349289' alias: 'Office: TV Off' description: '' triggers: - trigger: state entity_id: media_player.office_tv from: 'on' to: 'off' conditions: [] actions: - action: script.send_to_home_log data: message: ':tv: Office TV turned off.' log_level: Debug mode: queued max: 10 - id: '1617814753264' alias: 'Office: TV Source Changes' description: '' triggers: - trigger: state entity_id: media_player.office_tv attribute: source conditions: [] actions: - if: - condition: template value_template: '{{ state_attr(''media_player.office_tv'', ''source'') != none }}' then: - action: script.send_to_home_log data: message: ':tv: Office TV turned on and playing {{ state_attr(''media_player.office_tv'', ''source'') }}.' log_level: Normal else: - action: script.send_to_home_log data: message: ':tv: Office TV media changed.' log_level: Debug mode: queued max: 10 - id: '1583956425622' alias: 'Living Room: Motion Detected' description: Added a second delay https://community.home-assistant.io/t/hue-motion-sensor-with-illuminance-condition/128290 triggers: - trigger: state entity_id: - binary_sensor.living_room_area_motion - binary_sensor.lounge_motion - binary_sensor.living_room_motion_occupancy to: 'on' conditions: - condition: state entity_id: input_boolean.enable_living_room_motion_triggers state: 'on' actions: - choose: - conditions: - or: - condition: numeric_state entity_id: sensor.living_room_motion_3_illuminance below: input_number.living_room_light_level_2_threshold - condition: numeric_state entity_id: sensor.living_room_motion_illuminance below: input_number.living_room_light_level_4_threshold - condition: state entity_id: sensor.living_room_motion_illuminance state: unavailable - or: - condition: numeric_state entity_id: light.living_room_lamp_left attribute: brightness below: '190' - condition: numeric_state entity_id: light.living_room_lamp_right attribute: brightness below: '190' - condition: template value_template: '{{ state_attr(''light.living_room_lamp_left'', ''brightness'') == none }}' - condition: template value_template: '{{ state_attr(''light.living_room_lamp_right'', ''brightness'') == none }}' sequence: - parallel: - action: script.send_to_home_log data: message: ':paw_prints: Motion detected and it''s dark ({{ states(''sensor.living_room_motion_3_illuminance'') }} & {{ states(''sensor.living_room_motion_illuminance'') }} < {{ states(''input_number.living_room_light_level_2_threshold'') }} & {{ states(''input_number.living_room_light_level_4_threshold'', with_unit=True) }}) and Terina''s work :computer: computer is on. Turning :bulb: :high_brightness: lights on.' title: ':couch_and_lamp: Living Room' log_level: Debug - choose: - conditions: - condition: state entity_id: light.lounge_ceiling state: 'on' sequence: - action: scene.turn_on target: entity_id: scene.living_room_lights data: transition: 1 default: - action: scene.turn_on target: entity_id: scene.living_room_lamps_on data: transition: 1 - alias: Room too bright conditions: - or: - condition: numeric_state entity_id: sensor.living_room_motion_3_illuminance below: input_number.living_room_light_level_2_threshold - condition: numeric_state entity_id: sensor.living_room_motion_illuminance below: input_number.living_room_light_level_4_threshold - or: - condition: state entity_id: light.living_room_lamp_left state: 'off' - condition: state entity_id: light.living_room_lamp_right state: 'off' - condition: template value_template: '{{ state_attr(''light.living_room_lamp_left'', ''brightness'') == none }}' - condition: template value_template: '{{ state_attr(''light.living_room_lamp_right'', ''brightness'') == none }}' sequence: - parallel: - action: script.send_to_home_log data: message: ':paw_prints: Motion detected and it''s dark ({{ states(''sensor.living_room_motion_3_illuminance'') }} & {{ states(''sensor.living_room_motion_illuminance'') }} < {{ states(''input_number.living_room_light_level_2_threshold'') }} & {{ states(''input_number.living_room_light_level_4_threshold'', with_unit=True) }}) and Terina''s work :computer: computer is on. Turning :bulb: :high_brightness: lights on.' title: ':couch_and_lamp: Living Room' log_level: Debug - sequence: - action: scene.turn_on target: entity_id: scene.living_room_lamps_yellow data: transition: 0 - delay: seconds: 1 - action: scene.turn_on target: entity_id: scene.living_room_lamps_off data: transition: 0 default: [] mode: queued max: 10 - id: '1606170045630' alias: 'Living Room: No Motion After Short Time Dim Lights' description: '' triggers: - trigger: state entity_id: binary_sensor.living_room_area_motion to: 'off' for: 00:05:00 conditions: - condition: state entity_id: input_boolean.enable_living_room_motion_triggers state: 'on' actions: - parallel: - action: script.send_to_home_log data: message: ':no_pedestrians: No motion for 5 minutes. :bulb: :low_brightness: Dimming lights' title: ':couch_and_lamp: Living Room' log_level: Debug - choose: - conditions: - condition: state entity_id: light.living_room_lamps state: 'on' - condition: state entity_id: light.lounge_ceiling state: 'on' sequence: - action: scene.turn_on target: entity_id: scene.living_room_dim_lights data: transition: 1 - conditions: - condition: state entity_id: light.living_room_lamps state: 'on' sequence: - action: scene.turn_on target: entity_id: scene.living_room_dim_lamps data: transition: 1 - conditions: - condition: state entity_id: light.lounge_ceiling state: 'on' sequence: - action: scene.turn_on target: entity_id: scene.living_room_dim_ceiling_lights data: transition: 1 default: [] mode: single - id: '1605567425876' alias: 'Living Room: No Motion For Long Time' description: '' triggers: - trigger: state entity_id: binary_sensor.living_room_area_motion from: 'on' to: 'off' for: 00:10:00 conditions: - condition: state entity_id: input_boolean.enable_living_room_motion_triggers state: 'on' actions: - parallel: - action: script.send_to_home_log data: message: ':no_pedestrians: No motion for 10 minutes and :tv: TV is turned off. Turning living room lights off.' title: ':couch_and_lamp: Living Room' log_level: Debug - choose: - conditions: - condition: state entity_id: light.living_room_lamps state: 'on' - condition: state entity_id: light.lounge_ceiling state: 'on' sequence: - action: scene.turn_on target: entity_id: scene.living_room_lights_off data: transition: 1 - conditions: - condition: state entity_id: light.living_room_lamps state: 'on' sequence: - action: scene.turn_on target: entity_id: scene.living_room_lamps_off data: transition: 1 - conditions: - condition: state entity_id: light.lounge_ceiling state: 'on' sequence: - action: scene.turn_on target: entity_id: scene.living_room_ceiling_lights_off data: transition: 1 default: [] mode: single - id: '1714512650107' alias: 'Living Room: Lamps On And No Motion' description: Caters for when lights are on and Home Assistant was restarted triggers: - trigger: state entity_id: - light.living_room_lamps for: minutes: 10 conditions: - condition: template value_template: '{{ as_timestamp(now()) - as_timestamp(states.living_room_lamps.last_changed) >= 360 }}' actions: - parallel: - action: script.send_to_home_log data: message: :Lights on for 10 minutes with no motion. Turning lights off. title: ':couch_and_lamp: Living Room' log_level: Debug - action: scene.turn_on metadata: {} target: entity_id: scene.living_room_lamps_off mode: single - id: '1610409803685' alias: 'Living Room: TV Turned Off Turn Off Lights' description: TV is turned off and turn lights off if there has been no motion. triggers: - trigger: numeric_state entity_id: sensor.tv_plug_power for: 00:10:00 below: input_number.tv_plug_powered_on_threshold conditions: - condition: state entity_id: light.living_room_lamps state: 'on' - condition: state entity_id: binary_sensor.living_room_area_motion state: 'off' - condition: state entity_id: binary_sensor.living_room_area_motion state: 'off' for: hours: 0 minutes: 10 seconds: 0 - condition: state entity_id: device_tracker.doug state: not_home actions: - parallel: - action: script.send_to_home_log data: message: ':tv: TV turned off for 10 minutes. Turning lights off.' title: ':couch_and_lamp: Living Room' log_level: Debug - choose: - conditions: - condition: state entity_id: light.living_room_lamps state: 'on' - condition: state entity_id: light.lounge_ceiling state: 'on' sequence: - action: scene.turn_on target: entity_id: scene.living_room_lights_off data: transition: 1 - conditions: - condition: state entity_id: light.living_room_lamps state: 'on' sequence: - action: scene.turn_on target: entity_id: scene.living_room_lamps_off data: transition: 1 - conditions: - condition: state entity_id: light.lounge_ceiling state: 'on' sequence: - action: scene.turn_on target: entity_id: scene.living_room_ceiling_lights_off data: transition: 1 default: [] mode: single - id: '1588859622571' alias: 'Living Room: Motion Detected In The Morning' description: '' triggers: - trigger: state entity_id: binary_sensor.lounge_motion to: 'on' - trigger: state entity_id: binary_sensor.stairs_motion_occupancy to: 'on' conditions: - condition: state entity_id: input_boolean.enable_morning_routine state: 'on' - condition: state entity_id: group.tracked_people state: home - condition: state entity_id: alarm_control_panel.house_alarm state: armed_home - condition: time before: '23:00:00' after: 05:00:00 actions: - data: {} action: script.morning_script mode: single - id: '1611063957341' alias: 'Living Room: Server Fan Running Longer Than 1 Hour' description: '' triggers: - trigger: state entity_id: switch.server_fan to: 'on' for: 01:00:00 conditions: [] actions: - parallel: - action: script.send_to_home_log data: message: Server fan has been running for more than 1 hour. Consider turning Fan off. title: ':couch_and_lamp: Living Room' log_level: Normal - if: - condition: state entity_id: input_boolean.enable_direct_notifications state: 'on' then: - action: script.send_actionable_notification_with_2_buttons data: message: Turn off server fan? title: Server fan on for over 1 hour people: entity_id: - person.danny action1_title: 'Yes' action1_name: server_fan_off action2_title: 'No' action2_name: ignore mode: single - id: '1677711735249' alias: 'Living Room: Open Blinds In The Morning' description: '' triggers: - trigger: time at: 07:30:00 conditions: - condition: state entity_id: input_boolean.enable_living_room_blind_automations state: 'on' - condition: state entity_id: binary_sensor.living_room_windows state: 'off' actions: - parallel: - action: script.send_to_home_log data: message: ':clock{{ now().strftime(''%I'') | int }}{% if now().minute | int > 25 and now().minute | int < 35 %}30{% else %}{% endif %}: Opening blinds partially.' title: ':couch_and_lamp: Living Room' log_level: Debug - action: cover.set_cover_tilt_position data: tilt_position: 25 target: entity_id: - cover.living_room_blinds_left - cover.living_room_blinds_middle - cover.living_room_blinds_right mode: single - id: '1677711735250' alias: 'Living Room: Open Blinds In The Morning 2' description: '' triggers: - trigger: time at: 08:00:00 conditions: - condition: state entity_id: input_boolean.enable_living_room_blind_automations state: 'on' - condition: state entity_id: binary_sensor.living_room_windows state: 'off' actions: - parallel: - action: script.send_to_home_log data: message: ':clock{{ now().strftime(''%I'') | int }}{% if now().minute | int > 25 and now().minute | int < 35 %}30{% else %}{% endif %}: Opening blinds fully.' title: ':couch_and_lamp: Living Room' log_level: Debug - action: cover.set_cover_tilt_position data: tilt_position: 50 target: entity_id: - cover.living_room_blinds_left - cover.living_room_blinds_middle - cover.living_room_blinds_right mode: single - id: '1677969986112' alias: 'Living Room: Close Blinds In The Evening' description: '' triggers: - trigger: sun event: sunset - trigger: time at: '20:00:00' conditions: - condition: state entity_id: input_boolean.enable_living_room_blind_automations state: 'on' - condition: state entity_id: binary_sensor.living_room_windows state: 'off' - or: - condition: numeric_state entity_id: cover.living_room_blinds_left attribute: tilt_position above: 25 - condition: numeric_state entity_id: cover.living_room_blinds_middle attribute: tilt_position above: 25 - condition: numeric_state entity_id: cover.living_room_blinds_right attribute: tilt_position above: 25 actions: - parallel: - action: script.send_to_home_log data: message: ':clock{{ now().strftime(''%I'') | int }}{% if now().minute | int > 25 and now().minute | int < 35 %}30{% else %}{% endif %}: Partially closing blinds.' title: ':couch_and_lamp: Living Room' log_level: Debug - action: cover.set_cover_tilt_position data: tilt_position: 25 target: entity_id: - cover.living_room_blinds_left - cover.living_room_blinds_middle - cover.living_room_blinds_right mode: single - id: '1677969986113' alias: 'Living Room: Close Blinds In The Evening 2' description: '' triggers: - trigger: sun event: sunset offset: 01:00:00 - trigger: time at: '21:00:00' conditions: - condition: state entity_id: input_boolean.enable_living_room_blind_automations state: 'on' - condition: state entity_id: binary_sensor.living_room_windows state: 'off' actions: - parallel: - action: script.send_to_home_log data: message: ':clock{{ now().strftime(''%I'') | int }}{% if now().minute | int > 25 and now().minute | int < 35 %}30{% else %}{% endif %}: Closing blinds fully.' title: ':couch_and_lamp: Living Room' log_level: Debug - action: cover.set_cover_tilt_position data: tilt_position: 0 target: entity_id: - cover.living_room_blinds_left - cover.living_room_blinds_middle - cover.living_room_blinds_right mode: single - id: '1680528200298' alias: 'Living Room: No Direct Sun Light In The Morning' description: '' triggers: - trigger: numeric_state entity_id: sun.sun attribute: azimuth below: input_number.living_room_blinds_morning_sun_azimuth_threshold conditions: - condition: state entity_id: input_boolean.enable_living_room_blind_automations state: 'on' - condition: time after: 08:10:00 - condition: sun before: sunset - condition: state entity_id: binary_sensor.living_room_windows state: 'off' - or: - condition: numeric_state entity_id: cover.living_room_blinds_left attribute: current_tilt_position below: 50 - condition: numeric_state entity_id: cover.living_room_blinds_middle attribute: current_tilt_position below: 50 - condition: numeric_state entity_id: cover.living_room_blinds_right attribute: current_tilt_position below: 50 actions: - parallel: - action: script.send_to_home_log data: message: 'Morning :sun: sun is out of the way. Opening :couch_and_lamp: lounge blinds. Azimuth: {{ state_attr(''sun.sun'', ''azimuth'') }} ({{ states(''input_number.living_room_blinds_morning_sun_azimuth_threshold'')}}). Elevation: {{ state_attr(''sun.sun'', ''elevation'') }}.' title: ':couch_and_lamp: Living Room' log_level: Debug - action: cover.set_cover_tilt_position data: tilt_position: 50 target: entity_id: - cover.living_room_blinds_left - cover.living_room_blinds_middle - cover.living_room_blinds_right mode: single - id: '1680528200296' alias: 'Living Room: No Direct Sun Light In The Afternoon' description: '' triggers: - trigger: numeric_state entity_id: sun.sun attribute: azimuth above: input_number.living_room_blinds_afternoon_sun_azimuth_threshold - trigger: numeric_state entity_id: sun.sun attribute: elevation above: input_number.living_room_blinds_afternoon_sun_elevation_threshold conditions: - condition: state entity_id: input_boolean.enable_living_room_blind_automations state: 'on' - condition: numeric_state entity_id: sun.sun attribute: azimuth above: input_number.living_room_blinds_afternoon_sun_azimuth_threshold - condition: numeric_state entity_id: sun.sun attribute: elevation above: input_number.living_room_blinds_afternoon_sun_elevation_threshold - condition: state entity_id: binary_sensor.living_room_windows state: 'off' - or: - condition: numeric_state entity_id: cover.living_room_blinds_left attribute: current_tilt_position below: 50 - condition: numeric_state entity_id: cover.living_room_blinds_middle attribute: current_tilt_position below: 50 - condition: numeric_state entity_id: cover.living_room_blinds_right attribute: current_tilt_position below: 50 actions: - action: script.send_to_home_log data: message: 'Afternoon :sun: sun is out of the way. Opening :couch_and_lamp: lounge blinds. Azimuth: {{ state_attr(''sun.sun'', ''azimuth'') }} ({{ states(''input_number.living_room_blinds_afternoon_sun_azimuth_threshold'')}}). Elevation: {{ state_attr(''sun.sun'', ''elevation'') }} ({{ states(''input_number.living_room_blinds_afternoon_sun_elevation_threshold'')}}).' title: ':couch_and_lamp: Living Room' log_level: Debug - action: cover.set_cover_tilt_position data: tilt_position: 50 target: entity_id: - cover.living_room_blinds_left - cover.living_room_blinds_middle - cover.living_room_blinds_right mode: single - id: '1678300398735' alias: 'Living Room: Bright Outside' description: '' triggers: - trigger: numeric_state entity_id: sensor.front_garden_motion_illuminance above: input_number.blind_low_brightness_threshold for: 00:01:00 conditions: - condition: sun after: sunrise - condition: time after: 08:00:30 - condition: sun before: sunset - condition: numeric_state entity_id: sensor.front_garden_motion_illuminance below: input_number.blind_high_brightness_threshold - condition: state entity_id: input_boolean.enable_living_room_blind_automations state: 'on' - condition: state entity_id: binary_sensor.living_room_windows state: 'off' - alias: Check sun's position and: - condition: numeric_state entity_id: sun.sun attribute: azimuth above: input_number.living_room_blinds_morning_sun_azimuth_threshold - condition: numeric_state entity_id: sun.sun attribute: azimuth below: input_number.living_room_blinds_afternoon_sun_azimuth_threshold - condition: numeric_state entity_id: sun.sun attribute: elevation below: input_number.living_room_blinds_afternoon_sun_elevation_threshold - or: - not: - condition: state entity_id: cover.living_room_blinds_middle attribute: current_tilt_position state: '25' - not: - condition: state entity_id: cover.living_room_blinds_right attribute: current_tilt_position state: '25' - or: - condition: state entity_id: group.family_computer state: home - alias: Only account for laptop during weekdays and: - condition: time weekday: - mon - tue - wed - thu - fri - condition: state entity_id: group.terinas_work_computer state: home actions: - parallel: - action: script.send_to_home_log data: message: It's bright outside ({{ states('sensor.front_garden_motion_illuminance', with_unit=True) }}). Partially closing middle and right blinds. title: ':couch_and_lamp: Living Room' log_level: Debug - action: cover.set_cover_tilt_position data: tilt_position: 25 target: entity_id: - cover.living_room_blinds_middle - cover.living_room_blinds_right mode: single - id: '1678300398734' alias: 'Living Room: Really Bright Outside' description: '' triggers: - trigger: numeric_state entity_id: sensor.front_garden_motion_illuminance above: input_number.blind_high_brightness_threshold for: 00:01:00 conditions: - condition: sun after: sunrise - condition: time after: 08:00:30 - condition: sun before: sunset - condition: state entity_id: input_boolean.enable_living_room_blind_automations state: 'on' - condition: state entity_id: binary_sensor.living_room_windows state: 'off' - alias: Check sun's position and: - condition: numeric_state entity_id: sun.sun attribute: azimuth above: input_number.living_room_blinds_morning_sun_azimuth_threshold - condition: numeric_state entity_id: sun.sun attribute: azimuth below: input_number.living_room_blinds_afternoon_sun_azimuth_threshold - condition: numeric_state entity_id: sun.sun attribute: elevation below: input_number.living_room_blinds_afternoon_sun_elevation_threshold - or: - condition: numeric_state entity_id: cover.living_room_blinds_middle attribute: current_tilt_position above: 0 - condition: numeric_state entity_id: cover.living_room_blinds_right attribute: current_tilt_position above: 0 - or: - condition: state entity_id: group.family_computer state: home - alias: Only account for laptop during weekdays and: - condition: time weekday: - mon - tue - wed - thu - fri - condition: state entity_id: group.terinas_work_computer state: home actions: - parallel: - action: script.send_to_home_log data: message: It's really bright outside ({{ states('sensor.front_garden_motion_illuminance', with_unit=True) }}). Closing blinds. title: ':couch_and_lamp: Living Room' log_level: Debug - action: cover.set_cover_tilt_position data: tilt_position: 0 target: entity_id: - cover.living_room_blinds_middle - cover.living_room_blinds_right mode: single - id: '1678637987423' alias: 'Living Room: Outside Went Darker' description: '' triggers: - trigger: numeric_state entity_id: sensor.front_garden_motion_illuminance for: hours: 0 minutes: 5 seconds: 0 below: input_number.blind_low_brightness_threshold conditions: - condition: sun after: sunrise - condition: time after: 08:00:30 - condition: sun before: sunset - condition: state entity_id: input_boolean.enable_living_room_blind_automations state: 'on' - condition: state entity_id: binary_sensor.living_room_windows state: 'off' - condition: state entity_id: group.family_computer state: not_home - condition: state entity_id: group.terinas_work_computer state: not_home - or: - condition: numeric_state entity_id: cover.living_room_blinds_left attribute: current_tilt_position below: 50 - condition: numeric_state entity_id: cover.living_room_blinds_right attribute: current_tilt_position below: 50 - condition: numeric_state entity_id: cover.living_room_blinds_middle attribute: current_tilt_position below: 50 actions: - parallel: - action: script.send_to_home_log data: message: It is not as bright outside ({{ states('sensor.front_garden_motion_illuminance', with_unit=True) }}). Opening Blinds title: ':couch_and_lamp: Living Room' log_level: Debug - action: cover.set_cover_tilt_position data: tilt_position: 50 target: entity_id: - cover.living_room_blinds_left - cover.living_room_blinds_middle - cover.living_room_blinds_right mode: single - id: '1630015457540' alias: 'Living Room: Person Detected' description: '' triggers: - trigger: state entity_id: binary_sensor.living_room_person from: 'off' to: 'on' conditions: [] actions: - action: camera.snapshot data_template: filename: '{{ states(''input_text.latest_frigate_lounge_person_file_path'') }}' target: entity_id: camera.living_room - action: script.send_home_log_with_local_attachments data_template: message: Frigate detected a person in the lounge. title: ':bust_in_silhouette: Person detected in :couch_and_lamp: lounge' filePath: '{{ states(''input_text.latest_frigate_lounge_person_file_path'') }}' mode: queued max: 10 - id: '1610918759041' alias: 'Living Room: Restart Harmony Hub' description: '' triggers: - trigger: time at: 03:00:00 conditions: - condition: time weekday: - mon - condition: state entity_id: binary_sensor.tv_powered_on state: 'off' actions: - action: script.send_to_home_log data: message: ':TV: Restarting Harmony hub.' title: ':couch_and_lamp: Living Room' log_level: Debug - action: switch.turn_off target: entity_id: switch.harmony_hub_plug - delay: hours: 0 minutes: 1 seconds: 0 milliseconds: 0 - action: switch.turn_on target: entity_id: switch.harmony_hub_plug mode: single - id: '1610388192224' alias: 'Living Room: TV Turned On' description: '' triggers: - trigger: state entity_id: binary_sensor.tv_powered_on to: 'on' conditions: [] actions: - parallel: - action: script.send_to_home_log data: message: ':tv: TV Turned on.' title: ':couch_and_lamp: Living Room' log_level: Debug - choose: - conditions: - condition: state entity_id: binary_sensor.playstation_powered_on state: 'on' sequence: - action: script.living_room_select_game_input default: [] mode: single - id: '1610388192225' alias: 'Living Room: TV Turned Off' description: '' triggers: - trigger: state entity_id: binary_sensor.tv_powered_on from: 'on' to: 'off' for: 00:00:30 conditions: [] actions: - parallel: - action: script.send_to_home_log data: message: ':tv: TV Turned off.' title: ':couch_and_lamp: Living Room' log_level: Debug - sequence: - if: - condition: state entity_id: light.tv_backlight state: 'on' then: - parallel: - action: script.send_to_home_log data: message: 'Turning off :tv: TV backlight (WLED).' title: ':couch_and_lamp: Living Room' log_level: Debug - action: light.turn_off data: {} target: entity_id: light.tv_backlight mode: single - id: '1754839043037' alias: 'Living Room: Ceiling Light Switch Flipped' description: '' triggers: - trigger: state entity_id: - binary_sensor.living_room_ceiling_lights_input_0 not_from: - unavailable - unknown not_to: - unavailable - unknown conditions: [] actions: - parallel: - action: script.send_to_home_log metadata: {} data: message: Light switch flipped title: ':couch_and_lamp: Living Room' log_level: Debug - if: - condition: state entity_id: light.living_room_ceiling state: 'off' then: - action: scene.turn_on metadata: {} data: {} target: entity_id: scene.living_room_ceiling_lights_on else: - action: scene.turn_on metadata: {} data: {} target: entity_id: scene.living_room_ceiling_lights_off mode: single - id: '1654005357582' alias: 'Living Room: Terina''s Work Laptop Turned Off' description: '' triggers: - trigger: state entity_id: - group.terinas_work_computer not_from: unavailable to: not_home conditions: [] actions: - parallel: - action: script.send_to_home_log data: message: Terina's work laptop turned off. title: ':couch_and_lamp: Living Room' log_level: Debug - action: script.check_terinas_work_laptop_status data: {} mode: single - id: '1654005357583' alias: 'Living Room: Terina''s Work Laptop Turned On' description: '' triggers: - trigger: state entity_id: - group.terinas_work_computer not_from: unavailable to: not_home conditions: [] actions: - parallel: - action: script.send_to_home_log data: message: Terina's work laptop turned on. title: ':couch_and_lamp: Living Room' log_level: Debug - action: script.check_terinas_work_laptop_status data: {} mode: single - id: '1678741966793' alias: 'Living Room: Computer Turned Off' description: '' triggers: - trigger: state entity_id: - group.family_computer - group.terinas_work_computer from: home to: not_home for: hours: 0 minutes: 5 seconds: 0 conditions: - condition: state entity_id: input_boolean.enable_living_room_blind_automations state: 'on' - condition: sun after: sunrise - condition: time after: 08:00:30 - condition: sun before: sunset - condition: state entity_id: group.family_computer state: not_home - condition: state entity_id: group.terinas_work_computer state: not_home - or: - condition: state entity_id: cover.living_room_blinds_left attribute: current_tilt_position state: 50 - condition: state entity_id: cover.living_room_blinds_middle attribute: current_tilt_position state: 50 - condition: state entity_id: cover.living_room_blinds_right attribute: current_tilt_position state: 50 actions: - parallel: - action: script.send_to_home_log data: message: All computers turned off. Opening blinds. title: ':couch_and_lamp: Living Room' log_level: Debug - parallel: - if: - condition: state entity_id: cover.living_room_blinds_left attribute: current_tilt_position state: 50 then: - action: cover.set_cover_tilt_position data: tilt_position: 50 target: entity_id: - cover.living_room_blinds_left - if: - condition: state entity_id: cover.living_room_blinds_middle attribute: current_tilt_position state: 50 then: - action: cover.set_cover_tilt_position data: tilt_position: 50 target: entity_id: - cover.living_room_blinds_middle - if: - condition: state entity_id: cover.living_room_blinds_right attribute: current_tilt_position state: 50 then: - action: cover.set_cover_tilt_position data: tilt_position: 50 target: entity_id: - cover.living_room_blinds_right mode: single - id: '1652029607668' alias: 'Kitchen: Temperature Reaches target' description: '' triggers: - trigger: numeric_state entity_id: sensor.meater_probe_target above: sensor.meater_probe_internal conditions: [] actions: - action: script.send_to_home_log data: message: ':cook: :thermometer: The {{states(''sensor.meater_probe_cooking'')}} has reached temperature.' log_level: Normal mode: single - id: '1652029734731' alias: 'Kitchen: Cooking Has Started' description: '' triggers: - trigger: state entity_id: - sensor.meater_probe_cook_state to: started conditions: [] actions: - action: script.send_to_home_log data: message: ':cook: The {{states(''sensor.meater_probe_cooking'')}} has started cooking.' log_level: Normal mode: single - id: '1625924056779' alias: Mobile Notification Action Router description: '' triggers: - trigger: event event_type: mobile_app_notification_action event_data: {} conditions: [] actions: - choose: - conditions: - condition: template value_template: '{{ trigger.event.data.action == ''set_bedroom_blinds_30'' }}' - condition: numeric_state entity_id: cover.bedroom_blinds attribute: current_position above: '30' sequence: - action: script.send_to_home_log data: message: ':window: Closing bedroom blinds event received.' - action: cover.set_cover_position target: entity_id: cover.bedroom_blinds data: position: 30 - conditions: - condition: template value_template: '{{ trigger.event.data.action == ''server_fan_off'' }}' sequence: - action: script.send_to_home_log data: message: Turning off server fan event received. - action: switch.turn_off target: entity_id: switch.server_fan - conditions: - condition: template value_template: '{{ trigger.event.data.action == ''switch_on_office_fan'' }}' sequence: - action: script.send_to_home_log data: message: Turning on office fan event received. - action: switch.turn_on target: entity_id: switch.office_fan - conditions: - condition: template value_template: '{{ trigger.event.data.action == ''switch_on_fridge_freezer'' }}' sequence: - action: script.send_to_home_log data: message: Turning on fridge freezer event received. - action: switch.turn_on target: entity_id: switch.ecoflow_kitchen_plug - conditions: - condition: template value_template: '{{ trigger.event.data.action == ''switch_on_freezer'' }}' sequence: - action: script.send_to_home_log data: message: Turning on freezer event received. - action: switch.turn_on target: entity_id: switch.freezer - conditions: - condition: template value_template: '{{ trigger.event.data.action == ''guest_mode_arm_alarm_and_turn_off_devices'' }}' sequence: - action: script.send_to_home_log data: message: ':bell: Guest mode override. Turning alarm on and devices off.' - action: script.set_alarm_to_away_mode - action: script.lock_front_door - action: script.everybody_leave_home - conditions: - condition: template value_template: '{{ trigger.event.data.action == ''guest_mode_arm_alarm_away'' }}' - condition: state entity_id: input_select.home_mode state: Guest sequence: - action: script.send_to_home_log data: message: ':bell: Guest mode override. Turning alarm in away mode (motion and sensors) on only.' - action: script.set_alarm_to_away_mode - action: script.lock_front_door - conditions: - condition: template value_template: '{{ trigger.event.data.action == ''guest_mode_turn_off_devices'' }}' sequence: - action: script.send_to_home_log data: message: Guest mode override. Turning devices off only. - action: script.everybody_leave_home - conditions: - condition: template value_template: '{{ trigger.event.data.action == ''switch_off_alarm'' }}' sequence: - action: script.send_to_home_log data: message: Alarm override. Turning Alarm off. - action: script.set_alarm_to_disarmed_mode - conditions: - condition: template value_template: '{{ trigger.event.data.action == ''switch_off_attic_lights'' }}' sequence: - action: script.send_to_home_log data: message: Turning attic lights off event. - action: light.turn_off data: {} target: entity_id: light.attic - conditions: - condition: template value_template: '{{ trigger.event.data.action == ''update_home_assistant'' }}' sequence: - action: script.send_to_home_log data: message: Upgrade Home Assistant event. - action: update.install data: backup: true target: entity_id: update.home_assistant_core_update - conditions: - condition: template value_template: '{{ trigger.event.data.action == ''zappi_stop'' }}' sequence: - action: script.send_to_home_log data: message: Stop Zappi event. - action: select.select_option data: option: Stopped target: entity_id: select.myenergi_zappi_charge_mode default: [] mode: queued max: 10 - id: '1701033189010' alias: 'Porch: Front Door Lock Status Change' description: '' triggers: - trigger: state entity_id: - lock.front_door not_from: - unlocked conditions: - condition: state entity_id: binary_sensor.front_door state: 'off' - condition: state entity_id: input_boolean.enable_front_door_lock_automations state: 'on' actions: - choose: - conditions: - or: - condition: state entity_id: lock.front_door state: locking - condition: state entity_id: lock.front_door state: unlocking sequence: - parallel: - action: script.front_door_lock_status data: {} - action: script.send_to_home_log data: message: Front door "{{ states('lock.front_door') }}". title: Porch log_level: Normal - conditions: - or: - condition: state entity_id: lock.front_door state: locked - condition: state entity_id: lock.front_door state: unlocked sequence: - action: script.send_to_home_log data: message: Front door "{{ states('lock.front_door') }}". title: Porch log_level: Normal - action: script.turn_off data: {} target: entity_id: script.front_door_lock_status mode: single - id: '1752928735125' alias: 'Nuki: Unavailable' description: '' triggers: - trigger: state entity_id: - lock.front_door for: hours: 0 minutes: 5 seconds: 0 conditions: [] actions: - parallel: - action: button.press metadata: {} data: {} target: entity_id: button.front_door_reboot_nuki - action: script.send_to_home_log data: message: Nuki hub is unavailable. Restarting Hub. title: Nuki log_level: Debug mode: single - id: '1608655560832' alias: '3D Printer: Print Started' description: '' triggers: - trigger: state entity_id: binary_sensor.octoprint_printing from: 'off' to: 'on' conditions: - condition: state entity_id: input_boolean.enable_3d_printer_automations state: 'on' actions: - wait_for_trigger: - trigger: numeric_state entity_id: sensor.octoprint_estimated_finish_time above: '0' timeout: '60' - parallel: - action: switch.turn_on target: entity_id: switch.prusa_fan - action: script.send_to_home_log data: message: 'Printer priming. Turning on extruder :dash: fan.' title: ':printer: :black_square_button: 3D printer' log_level: Normal - wait_for_trigger: - trigger: numeric_state entity_id: sensor.octoprint_estimated_finish_time above: '0' timeout: '60' - action: script.send_to_home_log data: message: 'Printer started. Estimated time to completion: {{ states(''sensor.octoprint_estimated_finish_time'') }}.' title: ':printer: :black_square_button: 3D printer' log_level: Normal - choose: - conditions: - condition: sun after: sunset sequence: - action: script.send_to_home_log data: message: ':city_sunset: Printing started after sunset. Turning Printer :high_brightness: :bulb: light on.' title: ':printer: :black_square_button: 3D printer' log_level: Normal - action: scene.turn_on target: entity_id: scene.3d_printer_light_on - conditions: - condition: sun before: sunrise sequence: - action: script.send_to_home_log data: message: ':city_sunset: Printing started before sunrise. Turning Printer :high_brightness: :bulb: light on.' title: ':printer: :black_square_button: 3D printer' log_level: Normal - action: scene.turn_on target: entity_id: scene.3d_printer_light_on - conditions: - condition: sun after: sunrise before: sunset - condition: state entity_id: light.prusa state: 'on' sequence: - action: script.send_to_home_log data: message: ':sunny: Printing started during the day. Turning Printer light off.' title: ':printer: :black_square_button: 3D printer' log_level: Normal - action: scene.turn_on target: entity_id: scene.3d_printer_light_off default: - action: script.send_to_home_log data: message: ':sunrise: Printing started after sunrise. Not turning on printer light.' title: ':printer: :black_square_button: 3D printer' log_level: Normal - action: scene.turn_on target: entity_id: scene.3d_printer_light_off mode: single - id: '1619873649348' alias: '3D Printer: 50% Complete' description: '' triggers: - trigger: numeric_state entity_id: sensor.octoprint_job_percentage above: '50' conditions: - condition: state entity_id: input_boolean.enable_3d_printer_automations state: 'on' actions: - action: script.send_to_home_log data: message: 50% complete and due to finish at {{ states('sensor.octoprint_estimated_finish_time') }}. title: ':printer: :black_square_button: 3D printer' log_level: Normal mode: single - id: '1623087278802' alias: '3D Printer: Check If Printing Light' description: '' triggers: - trigger: time_pattern hours: '*' seconds: '*' minutes: /30 - trigger: sun event: sunset id: sunset - trigger: sun event: sunrise conditions: [] actions: - if: - condition: state entity_id: light.prusa state: 'on' then: - action: script.3d_printer_check_turn_off_light else: - action: script.3d_printer_check_turn_on_light mode: single - id: '1613321560216' alias: '3D Printer: Finished Printing' description: '' triggers: - trigger: state entity_id: binary_sensor.octoprint_printing from: 'on' to: 'off' conditions: - condition: state entity_id: input_boolean.enable_3d_printer_automations state: 'on' actions: - action: script.send_to_home_log data: message: ':white_check_mark: Completed 3D printing which started {{states(''sensor.octoprint_start_time'')}}' title: ':printer: :black_square_button: 3D printer' log_level: Normal mode: single - id: '1656239435552' alias: '3D Printer: Light Turned on' description: '' triggers: - trigger: state entity_id: - light.prusa to: 'on' for: hours: 0 minutes: 5 seconds: 0 conditions: - condition: state entity_id: input_boolean.enable_3d_printer_automations state: 'on' actions: - action: script.3d_printer_check_turn_off_light data: {} mode: single - id: '168962611780' alias: 'Octopus Energy: Electricity Rates Changed' description: '' trace: stored_traces: 40 triggers: - trigger: state entity_id: sensor.octopus_energy_electricity_current_rate conditions: [] actions: - parallel: - alias: Check Solar Assistant if: - condition: state entity_id: input_boolean.enable_solar_assistant_automations state: 'on' - not: - condition: state entity_id: select.growatt_sph_work_mode_priority state: unavailable then: - action: script.solar_assistant_check_charging_mode data: event: event current_electricity_import_rate: '{{ states(''sensor.octopus_energy_electricity_current_rate'') }}' current_electricity_import_rate_unit: '{{ state_attr(''sensor.octopus_energy_electricity_current_rate'', ''unit_of_measurement'') }}' current_electricity_export_rate: '{{ states(''sensor.octopus_energy_electricity_export_current_rate'') }}' current_electricity_export_rate_unit: '{{ state_attr(''sensor.octopus_energy_electricity_export_current_rate'', ''unit_of_measurement'') }}' - alias: Check Zappi choose: - conditions: - condition: state entity_id: input_boolean.enable_zappi_automations state: 'on' - not: - condition: state entity_id: sensor.myenergi_zappi_plug_status state: EV Disconnected sequence: - alias: Check Zappi action: script.zappi_check_ev_charge data: current_electricity_import_rate: '{{ states(''sensor.octopus_energy_electricity_current_rate'') }}' current_electricity_import_rate_unit: '{{ state_attr(''sensor.octopus_energy_electricity_current_rate'', ''unit_of_measurement'') }}' current_electricity_export_rate: '{{ states(''sensor.octopus_energy_electricity_export_current_rate'') }}' default: [] - alias: Check Eddi choose: - conditions: - not: - condition: state entity_id: select.myenergi_eddi_operating_mode state: Stopped - not: - condition: state entity_id: input_select.home_mode state: Holiday - condition: state entity_id: input_boolean.enable_hot_water_automations state: 'on' sequence: - action: script.hvac_check_eddi_boost_hot_water data: current_electricity_import_rate: '{{ states(''sensor.octopus_energy_electricity_current_rate'') }}' current_electricity_import_rate_unit: '{{ state_attr(''sensor.octopus_energy_electricity_current_rate'', ''unit_of_measurement'') }}' default: [] - alias: Check Ecoflow choose: - conditions: - condition: state entity_id: input_boolean.enable_ecoflow_automations state: 'on' sequence: - action: script.ecoflow_check_charging_mode data: current_electricity_import_rate: '{{ states(''sensor.octopus_energy_electricity_current_rate'') }}' current_electricity_import_rate_unit: '{{ state_attr(''sensor.octopus_energy_electricity_current_rate'', ''unit_of_measurement'') }}' current_electricity_export_rate: '{{ states(''sensor.octopus_energy_electricity_export_current_rate'') }}' default: [] - alias: Conservatory underfloor heating choose: - conditions: - condition: state entity_id: input_boolean.enable_conservatory_under_floor_heating_automations state: 'on' sequence: - action: script.conservatory_electricity_rate_change data: current_electricity_import_rate: '{{ states(''sensor.octopus_energy_electricity_current_rate'') }}' current_electricity_import_rate_unit: '{{ state_attr(''sensor.octopus_energy_electricity_current_rate'', ''unit_of_measurement'') }}' default: [] - alias: Tesla not connected and home choose: - conditions: - condition: state entity_id: binary_sensor.model_y_charger state: Unplugged - condition: state entity_id: sensor.myenergi_zappi_plug_status state: EV Disconnected - condition: state entity_id: input_boolean.enable_tesla_automations state: 'on' sequence: - action: script.tesla_notify_low_electricity_rates data: {} default: [] - alias: Check Airer choose: - conditions: - or: - condition: state entity_id: input_boolean.enable_conservatory_airer_when_cost_below_nothing state: 'on' - condition: state entity_id: input_boolean.enable_conservatory_airer_when_cost_nothing state: 'on' sequence: - action: script.check_conservatory_airer data: current_electricity_import_rate: '{{ states(''sensor.octopus_energy_electricity_current_rate'') }}' current_electricity_import_rate_unit: '{{ state_attr(''sensor.octopus_energy_electricity_current_rate'', ''unit_of_measurement'') }}' default: [] - id: '168962611781' alias: Refresh intelligent dispatches description: 'Example from: https://bottlecapdave.github.io/HomeAssistant-OctopusEnergy/services/#octopus_energyrefresh_intelligent_dispatches' triggers: - trigger: state entity_id: sensor.myenergi_zappi_plug_status not_to: EV Disconnected - trigger: time_pattern minutes: /3 conditions: - not: - condition: state entity_id: sensor.myenergi_zappi_plug_status state: EV Disconnected actions: - action: script.refresh_octopus_intelligent_dispatching data: {} mode: single - id: '1744064001680' alias: 'People: Update Danny''s Owntracks' description: https://devblog.yvn.no/posts/replacing-maps-timeline-with-owntracks/ triggers: - trigger: state entity_id: - device_tracker.danny_s_phone conditions: [] actions: - action: mqtt.publish metadata: {} data: topic: owntracks/danny/iphone payload: "{\n \"_type\": \"location\",\n \"t\": \"p\",\n \"tid\": \"ha\"\ ,\n \"lat\": {{ state_attr('device_tracker.danny_s_phone', 'latitude') }},\n\ \ \"lon\": {{ state_attr('device_tracker.danny_s_phone', 'longitude') }},\n\ \ \"alt\": {{ state_attr('device_tracker.danny_s_phone', 'altitude') | default(0)\ \ }},\n \"vac\": {{ state_attr('device_tracker.danny_s_phone', 'vertical_accuracy')\ \ | default(0) }},\n \"acc\": {{ state_attr('device_tracker.danny_s_phone',\ \ 'gps_accuracy') | default(0) }},\n \"vel\": {{ state_attr('device_tracker.danny_s_phone',\ \ 'speed') | default(0) }},\n \"cog\": {{ state_attr('device_tracker.danny_s_phone',\ \ 'course') | default(0) }},\n \"tst\": {{ now().timestamp() | int }}\n}\n" retain: true mode: single - id: '1744064001681' alias: 'People: Update Terina''s Owntracks' description: https://devblog.yvn.no/posts/replacing-maps-timeline-with-owntracks/ triggers: - trigger: state entity_id: - device_tracker.oneplus_10 conditions: [] actions: - action: mqtt.publish metadata: {} data: topic: owntracks/terina/oneplus payload: "{\n \"_type\": \"location\",\n \"t\": \"p\",\n \"tid\": \"ha\"\ ,\n \"lat\": {{ state_attr('device_tracker.oneplus_10', 'latitude') }},\n\ \ \"lon\": {{ state_attr('device_tracker.oneplus_10', 'longitude') }},\n\ \ \"alt\": {{ state_attr('device_tracker.oneplus_10', 'altitude') | default(0)\ \ }},\n \"vac\": {{ state_attr('device_tracker.oneplus_10', 'vertical_accuracy')\ \ | default(0) }},\n \"acc\": {{ state_attr('device_tracker.oneplus_10',\ \ 'gps_accuracy') | default(0) }},\n \"vel\": {{ state_attr('device_tracker.oneplus_10',\ \ 'speed') | default(0) }},\n \"cog\": {{ state_attr('device_tracker.oneplus_10',\ \ 'course') | default(0) }},\n \"tst\": {{ now().timestamp() | int }}\n}\n" retain: true mode: single - id: '1744064001682' alias: 'People: Update Leo''s Owntracks' description: https://devblog.yvn.no/posts/replacing-maps-timeline-with-owntracks/ triggers: - trigger: state entity_id: - device_tracker.leos_iphone conditions: [] actions: - action: mqtt.publish metadata: {} data: topic: owntracks/leo/iphone payload: "{\n \"_type\": \"location\",\n \"t\": \"p\",\n \"tid\": \"ha\"\ ,\n \"lat\": {{ state_attr('device_tracker.leos_iphone', 'latitude') }},\n\ \ \"lon\": {{ state_attr('device_tracker.leos_iphone', 'longitude') }},\n\ \ \"alt\": {{ state_attr('device_tracker.leos_iphone', 'altitude') | default(0)\ \ }},\n \"vac\": {{ state_attr('device_tracker.leos_iphone', 'vertical_accuracy')\ \ | default(0) }},\n \"acc\": {{ state_attr('device_tracker.leos_iphone',\ \ 'gps_accuracy') | default(0) }},\n \"vel\": {{ state_attr('device_tracker.leos_iphone',\ \ 'speed') | default(0) }},\n \"cog\": {{ state_attr('device_tracker.leos_iphone',\ \ 'course') | default(0) }},\n \"tst\": {{ now().timestamp() | int }}\n}\n" retain: true mode: single - id: '1661076689668' alias: 'Energy: Battery Charged And Forecasted Excess Solar' description: '' triggers: - trigger: numeric_state entity_id: sensor.growatt_sph_battery_state_of_charge above: input_number.battery_charged_notification conditions: - condition: or conditions: - condition: numeric_state entity_id: sensor.total_solar_forecast_estimated_energy_production_this_hour above: '0' - condition: numeric_state entity_id: sensor.total_solar_forecast_estimated_energy_production_next_hour above: '0' - not: - condition: state entity_id: sensor.growatt_sph_inverter_mode state: Battery first - alias: Not from an unknown state before condition: template value_template: '{{ trigger.from_state.state != ''unknown''}}' actions: - action: script.energy_notify_excess_solar data: {} mode: single - id: '1660858653319' alias: 'Energy: Solar Forecast Tomorrow' description: '' triggers: - trigger: time at: '21:00:00' conditions: - alias: Check tariff is on Agile condition: template value_template: '{{ ''AGILE'' in state_attr(''event.octopus_energy_electricity_current_day_rates'', ''tariff_code'')|upper }}' actions: - alias: update forecast action: script.update_solcast data: {} - parallel: - if: - condition: numeric_state entity_id: sensor.total_solar_forecast_estimated_energy_production_tomorrow below: input_number.solar_generation_minimum_threshold then: - action: script.send_to_home_log data: message: 'Forecast generation is expected to be low ({{ states(''sensor.total_solar_forecast_estimated_energy_production_tomorrow'') }}< {{ states(''input_number.solar_generation_minimum_threshold'', with_unit=True) }}). Incrementing counter from {{ states(''input_number.consecutive_forecast_days_below_solar_generation'') }} to {{ (states(''input_number.consecutive_forecast_days_below_solar_generation'')|int(0)) + 1 }} {{ state_attr(''input_number.consecutive_forecast_days_below_solar_generation'', ''unit_of_measurement'') }}.' title: ':sunny: :zap: Solar' log_level: Normal - action: input_number.increment data: {} target: entity_id: input_number.consecutive_forecast_days_below_solar_generation else: - action: input_number.set_value data: value: 0 target: entity_id: input_number.consecutive_forecast_days_below_solar_generation - action: script.energy_notify_tomorrows_solar_forecast data: {} mode: single - id: '1664743590782' alias: 'Energy: Battery Charged Today' description: '' triggers: - trigger: numeric_state entity_id: sensor.growatt_sph_battery_state_of_charge above: input_number.growatt_battery_charged_threshold conditions: - condition: state entity_id: input_boolean.battery_charged_today state: 'off' actions: - action: script.send_to_home_log data: message: Battery charged today title: ':sunny: :zap: Solar' log_level: Debug - action: input_boolean.turn_on data: {} target: entity_id: input_boolean.battery_charged_today - if: - condition: numeric_state entity_id: input_number.consecutive_days_battery_not_charged above: 0 then: - action: script.send_to_home_log data: message: Resetting days not fully charged. title: ':sunny: :zap: Solar' log_level: Debug - action: input_number.set_value data: value: 0 target: entity_id: input_number.consecutive_days_battery_not_charged mode: single - id: '1664743700827' alias: 'Energy: Reset Battery Charged Today' description: '' triggers: - trigger: time at: 00:00:00 conditions: [] actions: - choose: - conditions: - condition: state entity_id: input_boolean.battery_charged_today state: 'on' sequence: - parallel: - action: script.send_to_home_log data: message: Resetting battery charged today. title: ':sunny: :zap: Solar' log_level: Debug - action: input_boolean.turn_off data: {} target: entity_id: input_boolean.battery_charged_today - conditions: - condition: state entity_id: input_boolean.battery_charged_today state: 'off' sequence: - action: script.send_to_home_log data: message: Battery did not fully charge today (> {{ states('input_number.growatt_battery_charged_threshold', with_unit=True) }}). Adding a day to count ({{ states('input_number.consecutive_days_battery_not_charged') }}). title: ':sunny: :zap: Solar' log_level: Debug - action: input_number.increment data: {} target: entity_id: input_number.consecutive_days_battery_not_charged mode: single - id: '1663589154517' alias: 'Energy: Solar Production exceed threshold' description: '' triggers: - trigger: numeric_state entity_id: sensor.total_solar_forecast_estimated_energy_production_today above: input_number.solar_generation_minimum_threshold conditions: [] actions: - action: script.send_to_home_log data: message: Production above threshold. Resetting Forecast title: ':sunny: :zap: Solar' log_level: Debug mode: single - id: '1664744505278' alias: 'Energy: Consecutive Days Battery Not Charged' description: '' triggers: - trigger: numeric_state entity_id: input_number.consecutive_days_battery_not_charged above: 6 conditions: [] actions: - action: script.send_direct_notification data: message: It has been {{ states('input_number.consecutive_days_battery_not_charged') }} days where the battery has not been charged fully. title: ':sunny: :zap: Solar' people: entity_id: - person.danny mode: single - id: '1663588514009' alias: 'Energy: Consecutive Low Solar Generation' description: '' triggers: - trigger: numeric_state entity_id: input_number.consecutive_forecast_days_below_solar_generation above: 6 conditions: [] actions: - action: script.send_direct_notification data: message: It has been {{ states('input_number.consecutive_forecast_days_below_solar_generation') }} days with low solar generation. title: ':sunny: :zap: Solar' people: entity_id: - person.danny mode: single - id: '1674508693884' alias: 'Energy: Battery Charge Notification' description: Used for Demand Flexibility Service triggers: - trigger: time at: '15:55:00' conditions: - condition: template value_template: '{{ (states(''sensor.growatt_sph_battery_state_of_charge'')|int(0)) > ((states(''number.growatt_sph_load_first_stop_discharge'')|int(0)) + 1) }}' actions: - action: script.send_direct_notification data: message: '{{ states(''sensor.growatt_sph_battery_state_of_charge'') }}% (That is {{ state_attr(''sensor.battery_charge_remaining_hours'', ''duration'') }}) remaining.' title: ':house_with_garden: :battery: House Battery' people: entity_id: - person.danny mode: single - id: '1704121569476' alias: 'Energy: Low Battery Before Peak Time' description: 'TODO: Make this dynamic' triggers: - trigger: time at: '14:00:00' - trigger: time at: '15:00:00' conditions: - alias: Battery runtime less than 19:00 (usually end of peak time) condition: template value_template: '{{ today_at("19:00") > as_datetime(states(''sensor.battery_charge_remaining_hours'')) }}' - alias: Not already charging battery not: - condition: state entity_id: sensor.growatt_sph_inverter_mode state: Battery first - alias: Check tariff is on Agile condition: template value_template: '{{ ''AGILE'' in state_attr(''event.octopus_energy_electricity_current_day_rates'', ''tariff_code'')|upper }}' actions: - action: script.send_direct_notification data: message: Battery will not last beyond 19:00 today ({{ as_datetime(states('sensor.battery_charge_remaining_hours')) }}). Consider charging the battery. title: Solar people: entity_id: - person.danny mode: single - id: '1680444237958' alias: 'Energy: Power Cut Notification' description: '' triggers: - trigger: state entity_id: - sensor.growatt_sph_load_power to: '0' for: hours: 0 minutes: 1 seconds: 0 conditions: [] actions: - action: script.send_direct_notification data: message: No electricity consumption detected for over a minute. Check for power cut. title: ':warning: :zap: :house_with_garden: House :warning:' mode: single - id: '1712404842177' alias: 'Energy: High Grid Power Draw' description: '' triggers: - trigger: numeric_state entity_id: - sensor.house_current above: sensor.grid_max_import_power_warning conditions: [] actions: - action: script.send_direct_notification metadata: {} data: message: Current draw is close to cut out fuse ({{ (states('sensor.grid_max_import_power_warning')|float(0))|round(2) }}/{{ states('input_number.cut_out_fuse_size') }}). Consider turning devices off. title: 'Energy: House' people: entity_id: - person.danny - person.terina mode: single - id: '1719080490915' alias: 'Energy: Saving Session Started' description: '' triggers: - trigger: state entity_id: - binary_sensor.octopus_energy_octoplus_saving_sessions not_from: unavailable to: 'on' conditions: [] actions: - action: script.send_direct_notification metadata: {} data: message: Energy Saver Session Started title: Energy people: entity_id: - person.danny - person.terina mode: single - id: '1719080490916' alias: 'Energy: Saving Session Finished' description: '' triggers: - trigger: state entity_id: - binary_sensor.octopus_energy_octoplus_saving_sessions not_from: unavailable to: 'off' conditions: [] actions: - action: script.send_direct_notification metadata: {} data: message: Energy Saver Session Finished title: Energy people: entity_id: - person.danny - person.terina mode: single - id: '1606428361967' alias: 'Office: Motion Detected And Light Is On' description: Split automation depending on light state due to dynamic attributes based on state. See https://community.home-assistant.io/t/dynamic-attributes/93226/2?u=tuxinator94 triggers: - trigger: state entity_id: - binary_sensor.office_motion_2_presence to: 'on' - trigger: numeric_state entity_id: - sensor.office_motion_2_target_distance above: 0.1 conditions: - condition: state entity_id: input_boolean.enable_office_motion_triggers state: 'on' - or: - condition: state entity_id: light.office_2 state: 'on' - condition: state entity_id: light.office_3 state: 'on' actions: - choose: - conditions: - and: - condition: sun before: sunset before_offset: -01:00:00 - condition: numeric_state entity_id: sensor.office_motion_2_illuminance above: input_number.office_light_level_threshold - not: - condition: state entity_id: sensor.office_motion_2_illuminance state: unavailable sequence: - parallel: - action: script.send_to_home_log data: message: ':paw_prints: :bulb: :high_brightness: Motion detected in the office but it''s bright enough ({{ states(''sensor.office_motion_2_illuminance'') }} > {{ states(''input_number.office_light_level_threshold'', with_unit=True) }}). Skipping turning light on.' title: ':office: Office' log_level: Debug - action: timer.cancel data: {} target: entity_id: timer.office_lights_off - conditions: - and: - condition: numeric_state entity_id: sensor.office_motion_2_illuminance below: input_number.office_light_level_threshold - or: - condition: numeric_state entity_id: light.office_2 attribute: brightness below: '200' - condition: numeric_state entity_id: light.office_3 attribute: brightness below: '200' sequence: - parallel: - action: scene.turn_on target: entity_id: scene.office_main_light_on - action: script.send_to_home_log data: message: ':paw_prints: :bulb: :high_brightness: Motion detected in the office and it''s dark ({{ states(''sensor.office_motion_2_illuminance'') }} < {{ states(''input_number.office_light_level_threshold'', with_unit=True) }}). Turning up :bulb: :high_brightness: lights.' title: ':office: Office' log_level: Debug - action: timer.cancel data: {} target: entity_id: timer.office_lights_off - conditions: - and: - or: - condition: numeric_state entity_id: sensor.office_motion_2_illuminance above: input_number.office_light_level_threshold - condition: state entity_id: sensor.office_motion_2_illuminance state: unavailable - or: - condition: numeric_state entity_id: light.office_2 attribute: brightness below: '200' - condition: numeric_state entity_id: light.office_3 attribute: brightness below: '200' sequence: - parallel: - action: scene.turn_on target: entity_id: scene.office_main_light_off - action: script.send_to_home_log data: message: ':paw_prints: :bulb: :high_brightness: Motion detected in the office and bright ({{ states(''sensor.office_motion_2_illuminance'') }} < {{ states(''input_number.office_light_level_threshold'', with_unit=True) }}). Turning office lights off.' title: ':office: Office' log_level: Debug - action: timer.cancel data: {} target: entity_id: timer.office_lights_off - conditions: - condition: state entity_id: timer.office_lights_off state: active sequence: - parallel: - action: scene.turn_on target: entity_id: scene.office_main_light_off - action: script.send_to_home_log data: message: ':paw_prints: :bulb: :high_brightness: Motion detected in the office Cancelling Timer.' title: ':office: Office' log_level: Debug - action: timer.cancel data: {} target: entity_id: timer.office_lights_off default: [] mode: queued max: 10 - id: '1632064858461' alias: 'Office: Motion Detected And Light Is Off' description: Split automation depending on light state due to dynamic attributes based on state. See https://community.home-assistant.io/t/dynamic-attributes/93226/2?u=tuxinator94 triggers: - trigger: state entity_id: - binary_sensor.office_motion_2_presence to: 'on' - trigger: numeric_state entity_id: - sensor.office_motion_2_target_distance above: 0.1 conditions: - condition: state entity_id: input_boolean.enable_office_motion_triggers state: 'on' - or: - condition: state entity_id: light.office_2 state: 'off' - condition: state entity_id: light.office_3 state: 'off' actions: - choose: - conditions: - or: - and: - condition: sun before: sunset before_offset: -01:00:00 - condition: numeric_state entity_id: sensor.office_motion_2_illuminance above: input_number.office_light_level_threshold - condition: state entity_id: sensor.office_motion_2_illuminance state: unavailable sequence: - parallel: - action: script.send_to_home_log data: message: ':paw_prints: :bulb: :high_brightness: Motion detected in the office but it''s bright enough ({{ states(''sensor.office_motion_2_illuminance'') }} > {{ states(''input_number.office_light_level_threshold'', with_unit=True) }}). Skipping turning light on.' title: ':office: Office' log_level: Debug - action: timer.cancel data: {} target: entity_id: timer.office_lights_off - sequence: - action: scene.turn_on target: entity_id: scene.office_room_brightness_above_threshold data: {} - delay: seconds: 1 - action: light.turn_off target: entity_id: - light.office_4 data: {} default: - parallel: - action: scene.turn_on target: entity_id: scene.office_main_light_on - action: script.send_to_home_log data: message: ':paw_prints: :bulb: :high_brightness: Motion detected in the office and it''s dark ({{ states(''sensor.office_motion_2_illuminance'') }} < {{ states(''input_number.office_light_level_threshold'') }}). Turning :bulb: :high_brightness: lights on.' title: ':office: Office' log_level: Debug - action: timer.cancel data: {} target: entity_id: timer.office_lights_off mode: single - id: '1587044886896' alias: 'Office: No Motion Detected' description: '' triggers: - trigger: numeric_state entity_id: sensor.office_motion_2_target_distance below: 0.01 for: 00:02:00 conditions: - condition: state entity_id: input_boolean.enable_office_motion_triggers state: 'on' - condition: numeric_state entity_id: sensor.office_motion_2_target_distance below: 0.01 - condition: state entity_id: binary_sensor.office_motion_2_presence state: 'off' actions: - parallel: - action: script.send_to_home_log data: message: ':no_pedestrians: No motion in the office. Starting :hourglass_flowing_sand: timer for 2 minutes before turning lights off.' title: ':office: Office' log_level: Debug - action: timer.start data: duration: 00:01:00 target: entity_id: timer.office_lights_off mode: single - id: '1587044886897' alias: 'Office: Office Light Off Timer Finished' description: '' triggers: - trigger: event event_type: timer.finished event_data: entity_id: timer.office_lights_off conditions: - condition: state entity_id: input_boolean.enable_office_motion_triggers state: 'on' actions: - parallel: - action: script.send_to_home_log data: message: ':no_pedestrians: No motion in the office for 2 minutes. Turning lights off.' title: ':office: Office' log_level: Debug - action: scene.turn_on target: entity_id: scene.office_main_light_off mode: single - id: '1622584959878' alias: 'Office: High Temperature' description: '' triggers: - trigger: numeric_state entity_id: sensor.office_area_mean_temperature above: '26' - trigger: numeric_state entity_id: sensor.office_area_mean_temperature above: '29' for: 00:01:00 - trigger: numeric_state entity_id: sensor.office_area_mean_temperature for: 00:01:00 above: '31' conditions: - condition: state entity_id: switch.office_fan state: 'off' actions: - choose: - conditions: - condition: state entity_id: group.tracked_people state: home - condition: time before: '22:00:00' - condition: time after: 08:30:00 sequence: - parallel: - action: script.send_to_home_log data: message: ':hotsprings: :people_holding_hands: Office temperature is high ({{ states(''sensor.office_area_mean_temperature'') }}c) and someone is home. Turning on fan.' title: ':office: Office' log_level: Debug - action: switch.turn_on target: entity_id: switch.office_fan - conditions: - condition: numeric_state entity_id: sensor.office_area_mean_temperature above: '29' sequence: - parallel: - action: script.send_to_home_log data: message: ':warning: :hotsprings: Office temperature is above 29c ({{ states(''sensor.office_area_mean_temperature'') }}c).' title: ':office: Office' log_level: Debug - action: script.send_actionable_notification_with_2_buttons data: message: Turn on office fan? title: β¨οΈπ’Office temperature is 29c+ people: entity_id: - person.danny action1_title: 'Yes' action1_name: switch_on_office_fan action2_title: 'No' action2_name: ignore - conditions: - condition: numeric_state entity_id: sensor.office_area_mean_temperature above: '31' sequence: - parallel: - action: script.send_to_home_log data: message: ':warning: :hotsprings: Temperature is above 31c. Turning fan on.' title: ':office: Office' log_level: Debug - action: switch.turn_on target: entity_id: switch.office_fan default: [] mode: single - id: '1728046359271' alias: 'Office: Fan Turns Off at 3am' description: Turns off the office fan at 3am when it's on triggers: - trigger: time at: 03:00:00 conditions: - condition: state entity_id: switch.office_fan state: 'on' actions: - action: switch.turn_off metadata: {} data: {} target: entity_id: switch.office_fan mode: single - id: '1619865008647' alias: 'Office: Computer Turned On' description: '' triggers: - trigger: state entity_id: group.jd_computer from: not_home to: home conditions: [] actions: - parallel: - action: script.send_to_home_log data: message: ':level_slider: Turned on GoXLR.' title: ':desktop_computer: Computer' log_level: Debug - if: - condition: state entity_id: switch.office_monitor_bar state: 'off' then: - action: switch.turn_on target: entity_id: switch.office_monitor_bar - action: script.send_to_home_log data: message: Turned on monitor light. title: ':desktop_computer: Computer' log_level: Debug mode: single - id: '1606256309890' alias: 'Office: Computer Turned Off For A Period Of Time' description: '' triggers: - trigger: state entity_id: group.jd_computer for: 00:10:00 to: not_home from: home conditions: - not: - condition: state entity_id: device_tracker.udm_pro state: unavailable actions: - parallel: - action: script.send_to_home_log data: message: Turned off for more than 10 minutes. title: ':desktop_computer: Computer' log_level: Debug - action: scene.turn_on target: entity_id: scene.office_desk_lights_off - action: script.send_to_home_log data: messsage: Turned off desk lights. log_level: Debug - action: script.send_to_home_log data: message: 'Turned off for more than 10 minutes. Turned off :level_slider: goXLR' title: ':desktop_computer: Computer' log_level: Debug - action: script.office_turn_off_backup_drive - action: script.ecoflow_office_turn_off_plug mode: single - id: '1678741966796' alias: 'Office: Computer Turned Off' description: '' triggers: - trigger: state entity_id: - group.jd_computer from: home to: not_home for: hours: 0 minutes: 1 seconds: 0 conditions: [] actions: - if: - alias: Is work computer on? condition: state entity_id: group.dannys_work_computer state: not_home then: - parallel: - action: script.send_to_home_log data: message: Computer turned off. Turning monitor light off. title: ':office: Office' log_level: Debug - action: switch.turn_off target: entity_id: - switch.office_monitor_bar mode: single - id: '1678741966794' alias: 'Office: Computer Turned Off After Sunrise' description: '' triggers: - trigger: state entity_id: - group.jd_computer from: home to: not_home for: hours: 0 minutes: 5 seconds: 0 conditions: - condition: state entity_id: input_boolean.enable_office_blind_automations state: 'on' - condition: sun after: sunrise - condition: time after: 08:00:30 - condition: sun before: sunset actions: - parallel: - action: script.send_to_home_log data: message: Computer turned off. Opening blinds. title: ':office: Office' log_level: Debug - action: script.office_open_blinds data: {} mode: single - id: '1619865008649' alias: 'Office: Work Computer Turned On' description: '' triggers: - trigger: state entity_id: group.dannys_work_computer from: not_home to: home conditions: - condition: state entity_id: switch.office_monitor_bar state: 'off' actions: - parallel: - action: switch.turn_on target: entity_id: switch.office_monitor_bar - action: script.send_to_home_log data: message: Turned on monitor light. title: ':desktop_computer: Computer' log_level: Debug mode: single - id: '1678741966795' alias: 'Office: Work Computer Turned Off' description: '' triggers: - trigger: state entity_id: - group.dannys_work_computer from: home to: not_home for: hours: 0 minutes: 1 seconds: 0 conditions: [] actions: - parallel: - if: - alias: Is personal computer on? condition: state entity_id: group.jd_computer state: not_home then: - parallel: - action: script.send_to_home_log data: message: Danny's work computer turned off. Turning monitor light off. title: ':office: Office' log_level: Debug - action: switch.turn_off target: entity_id: - switch.office_monitor_bar mode: single - id: '1622374444832' alias: 'Office: Open Blinds In The Morning' description: '' triggers: - trigger: time at: 08:00:00 conditions: [] actions: - action: weather.get_forecasts target: entity_id: weather.home data: type: hourly response_variable: weather - choose: - alias: Really bright and blinds are closed already conditions: - condition: numeric_state entity_id: sensor.front_garden_motion_illuminance above: input_number.blind_high_brightness_threshold - or: - condition: state entity_id: group.dannys_work_computer state: home - condition: state entity_id: group.jd_computer state: home sequence: - action: script.send_to_home_log data: message: ':clock{{ now().strftime(''%I'') | int }}{% if now().minute | int > 25 and now().minute | int < 35 %}30{% else %}{% endif %}: Keeping blinds closed.' title: ':office: Office' log_level: Debug - conditions: - condition: numeric_state entity_id: sensor.front_garden_motion_illuminance above: input_number.blind_low_brightness_threshold - condition: numeric_state entity_id: sensor.front_garden_motion_illuminance below: input_number.blind_high_brightness_threshold - or: - condition: state entity_id: group.dannys_work_computer state: home - condition: state entity_id: group.jd_computer state: home sequence: - parallel: - action: script.send_to_home_log data: message: ':clock{{ now().strftime(''%I'') | int }}{% if now().minute | int > 25 and now().minute | int < 35 %}30{% else %}{% endif %}: It''s bright outside ({{ states(''sensor.front_garden_motion_illuminance'', with_unit=True) }}) so partially opening office blinds.' title: ':office: Office' log_level: Debug - action: cover.set_cover_tilt_position target: entity_id: cover.office_blinds data: tilt_position: 25 default: - parallel: - action: script.send_to_home_log data: message: ':clock{{ now().strftime(''%I'') | int }}{% if now().minute | int > 25 and now().minute | int < 35 %}30{% else %}{% endif %}: Opening blinds.' title: ':office: Office' log_level: Debug - action: script.office_open_blinds data: {} mode: single - id: '1622374233312' alias: 'Office: Close Office Blinds At Night 2' description: '' triggers: - trigger: sun event: sunset conditions: - condition: state entity_id: input_boolean.enable_office_blind_automations state: 'on' - condition: numeric_state entity_id: cover.office_blinds attribute: current_tilt_position above: 25 actions: - choose: - conditions: - condition: state entity_id: binary_sensor.office_windows state: 'on' sequence: - action: script.send_to_home_log data: message: ':warning: :window: Office window is still open so not closing blinds. before closing blinds. :warning:' title: ':office: Office' log_level: Debug default: - parallel: - action: script.send_to_home_log data: message: ':city_sunset: :sun_with_face: :window: It''s getting dark, closing office blinds.' title: ':office: Office' log_level: Debug - action: cover.set_cover_tilt_position target: entity_id: cover.office_blinds data: tilt_position: 25 mode: single - id: '1622374233310' alias: 'Office: Close Office Blinds At Night 2' description: '' triggers: - trigger: sun event: sunset offset: 01:00:00 conditions: - condition: state entity_id: input_boolean.enable_office_blind_automations state: 'on' - condition: numeric_state entity_id: cover.office_blinds attribute: current_tilt_position above: 0 actions: - choose: - conditions: - condition: state entity_id: binary_sensor.office_windows state: 'on' sequence: - action: script.send_to_home_log data: message: ':warning: :window: Office window is still open so not closing blinds. before closing blinds. :warning:' title: ':office: Office' log_level: Debug default: - parallel: - action: script.send_to_home_log data: message: ':city_sunset: :sun_with_face: :window: It''s getting dark, closing office blinds.' title: ':office: Office' log_level: Debug - action: script.office_close_blinds data: {} mode: single - id: '1622666920056' alias: 'Office: Window Closed At Night' description: '' triggers: - trigger: state entity_id: binary_sensor.office_windows from: 'on' to: 'off' for: hours: 0 minutes: 1 seconds: 0 conditions: - condition: state entity_id: input_boolean.enable_office_blind_automations state: 'on' - or: - condition: sun after: sunset after_offset: -01:00:00 - condition: sun before: sunrise actions: - parallel: - action: script.send_to_home_log data: message: ':window: :city_sunset: Office window closed and it''s dark. Closing blinds.' title: ':office: Office' log_level: Debug - action: script.office_close_blinds data: {} mode: single - id: '1680528200295' alias: 'Office: No Direct Sun Light In The Morning' description: '' triggers: - trigger: numeric_state entity_id: sun.sun attribute: azimuth below: input_number.office_blinds_morning_sun_azimuth_threshold conditions: - condition: state entity_id: input_boolean.enable_office_blind_automations state: 'on' - condition: numeric_state entity_id: cover.office_blinds attribute: current_tilt_position below: 50 - condition: time after: 08:10:00 - condition: sun before: sunset - condition: state entity_id: binary_sensor.office_windows state: 'off' actions: - parallel: - action: script.send_to_home_log data: message: 'Morning :sun: sun is out of the way. Opening :office: office blinds. Azimuth: {{ state_attr(''sun.sun'', ''azimuth'') }} ({{ states(''input_number.living_room_blinds_morning_sun_azimuth_threshold'')}}). Elevation: {{ state_attr(''sun.sun'', ''elevation'') }}.' title: ':office: Office' log_level: Debug - action: script.office_open_blinds data: {} mode: single - id: '1680528200297' alias: 'Office: No Direct Sun Light In The Afternoon' description: '' triggers: - trigger: numeric_state entity_id: sun.sun attribute: azimuth above: input_number.office_blinds_afternoon_sun_azimuth_threshold - trigger: numeric_state entity_id: sun.sun attribute: elevation above: input_number.office_blinds_afternoon_sun_elevation_threshold conditions: - condition: state entity_id: input_boolean.enable_office_blind_automations state: 'on' - condition: numeric_state entity_id: sun.sun attribute: azimuth above: input_number.office_blinds_afternoon_sun_azimuth_threshold - condition: numeric_state entity_id: sun.sun attribute: elevation above: input_number.office_blinds_afternoon_sun_elevation_threshold - condition: numeric_state entity_id: cover.office_blinds attribute: current_tilt_position below: 50 - condition: state entity_id: binary_sensor.office_windows state: 'off' - condition: state entity_id: light.office_key_lights state: 'off' actions: - action: script.send_to_home_log data: message: 'Afternoon :sun: sun is out of the way. Opening :office: office blinds. Azimuth: {{ state_attr(''sun.sun'', ''azimuth'') }} ({{ states(''input_number.office_blinds_afternoon_sun_azimuth_threshold'')}}). Elevation: {{ state_attr(''sun.sun'', ''elevation'') }} ({{ states(''input_number.office_blinds_afternoon_sun_elevation_threshold'')}}).' title: ':office: Office' log_level: Debug - action: script.office_open_blinds data: {} mode: single - id: '1678300398737' alias: 'Office: Bright Outside' description: '' triggers: - trigger: numeric_state entity_id: sensor.front_garden_motion_illuminance above: input_number.blind_low_brightness_threshold for: 00:01:00 conditions: - condition: sun after: sunrise - condition: time after: 08:10:00 - condition: sun before: sunset - condition: numeric_state entity_id: sensor.front_garden_motion_illuminance above: input_number.blind_high_brightness_threshold - condition: numeric_state entity_id: sun.sun attribute: azimuth above: input_number.office_blinds_morning_sun_azimuth_threshold - condition: numeric_state entity_id: sun.sun attribute: azimuth below: input_number.office_blinds_afternoon_sun_azimuth_threshold - condition: numeric_state entity_id: sun.sun attribute: elevation below: input_number.office_blinds_afternoon_sun_elevation_threshold - condition: state entity_id: input_boolean.enable_office_blind_automations state: 'on' - condition: numeric_state entity_id: cover.office_blinds attribute: current_tilt_position above: 25 - condition: state entity_id: binary_sensor.office_windows state: 'off' - or: - condition: state entity_id: group.dannys_work_computer state: home - condition: state entity_id: group.jd_computer state: home actions: - parallel: - action: script.send_to_home_log data: message: 'It''s bright outside ({{ states(''sensor.front_garden_motion_illuminance'', with_unit=True) }}) and computer is on. Partially closing blinds. Azimuth: {{ state_attr(''sun.sun'', ''azimuth'') }}. Elevation: {{ state_attr(''sun.sun'', ''elevation'') }}.' title: ':office: Office' log_level: Debug - action: cover.set_cover_tilt_position target: entity_id: cover.office_blinds data: tilt_position: 25 mode: single - id: '1678300398736' alias: 'Office: Really Bright Outside' description: '' triggers: - trigger: numeric_state entity_id: sensor.front_garden_motion_illuminance above: input_number.blind_high_brightness_threshold for: 00:01:00 conditions: - condition: sun after: sunrise - condition: time after: 08:00:30 - condition: sun before: sunset - condition: state entity_id: input_boolean.enable_office_blind_automations state: 'on' - condition: numeric_state entity_id: cover.office_blinds attribute: current_tilt_position above: 0 - condition: numeric_state entity_id: sun.sun attribute: azimuth above: input_number.office_blinds_morning_sun_azimuth_threshold - condition: numeric_state entity_id: sun.sun attribute: azimuth below: input_number.office_blinds_afternoon_sun_azimuth_threshold - condition: state entity_id: binary_sensor.office_windows state: 'off' - or: - condition: state entity_id: group.dannys_work_computer state: home - condition: state entity_id: group.jd_computer state: home actions: - parallel: - action: script.send_to_home_log data: message: It's really bright outside ({{ states('sensor.front_garden_motion_illuminance', with_unit=True) }}). Closing blinds. title: ':office: Office' log_level: Debug - action: script.office_close_blinds data: {} mode: single - id: '1678637987424' alias: 'Office: Outside Went Darker' description: '' triggers: - trigger: numeric_state entity_id: sensor.front_garden_motion_illuminance for: hours: 0 minutes: 5 seconds: 0 below: input_number.blind_low_brightness_threshold conditions: - condition: sun after: sunrise - condition: time after: 08:00:30 - condition: sun before: sunset - condition: numeric_state entity_id: cover.office_blinds attribute: current_tilt_position below: 50 - condition: state entity_id: input_boolean.enable_office_blind_automations state: 'on' - condition: state entity_id: binary_sensor.office_windows state: 'off' - condition: state entity_id: light.office_key_lights state: 'off' - condition: numeric_state entity_id: sun.sun attribute: elevation above: input_number.office_blinds_afternoon_sun_elevation_threshold actions: - parallel: - action: script.send_to_home_log data: message: It is not as bright outside ({{ states('sensor.front_garden_motion_illuminance', with_unit=True) }}). Opening Blinds title: ':office: Office' log_level: Debug - action: script.office_open_blinds data: {} mode: single - id: '1719349686247' alias: 'Office: Light On And Bright Room' description: '' triggers: - trigger: state entity_id: - light.office_area_lights to: 'on' for: hours: 1 minutes: 0 seconds: 0 conditions: - condition: sun before: sunset after: sunrise - condition: numeric_state entity_id: sensor.office_area_mean_light_level above: input_number.office_light_level_threshold actions: - parallel: - action: light.turn_off metadata: {} data: transition: 1 target: entity_id: - light.office_3 - light.office_2 - sequence: - action: scene.turn_on target: entity_id: scene.office_room_brightness_above_threshold data: {} - delay: seconds: 1 - action: light.turn_off target: entity_id: - light.office_4 data: {} mode: single - id: '1721434316175' alias: 'Office: Fly Zapper' description: '' triggers: - trigger: state entity_id: - switch.fly_zapper for: hours: 2 minutes: 0 seconds: 0 conditions: [] actions: - parallel: - action: script.send_to_home_log data: message: Turning off fly zapper after 2 hours. title: ':office: Office' log_level: Debug - action: switch.turn_off metadata: {} data: {} target: entity_id: switch.fly_zapper mode: single - id: '1722108194998' alias: 'Office: Remote Keylight' description: '' triggers: - trigger: device domain: mqtt device_id: 589ffdf441f33bc8f72a6f9faf153da2 type: action subtype: open conditions: [] actions: - parallel: - action: script.send_to_home_log data: message: 'Remote command received: toggle key lights.' title: ':office: Office' log_level: Debug - action: light.toggle metadata: {} data: {} target: entity_id: light.office_key_lights mode: single - id: '1722108194999' alias: 'Office: Remote Fan' description: '' triggers: - trigger: device domain: mqtt device_id: 589ffdf441f33bc8f72a6f9faf153da2 type: action subtype: close conditions: [] actions: - parallel: - action: script.send_to_home_log data: message: 'Remote command received: toggle fan.' title: ':office: Office' log_level: Debug - action: switch.toggle metadata: {} data: {} target: entity_id: switch.office_fan mode: single - id: '1743186662871' alias: 'Office: Front Door Status On For Long Time' description: '' triggers: - trigger: state entity_id: - light.office_light to: 'on' for: hours: 0 minutes: 3 seconds: 0 - trigger: state entity_id: - light.office_light to: 'on' for: hours: 0 minutes: 5 seconds: 0 conditions: - condition: state entity_id: binary_sensor.front_door state: 'off' actions: - action: light.turn_off metadata: {} data: {} target: entity_id: light.office_light mode: single - id: '1687019771710' alias: 'Paperless: New Document' description: '' triggers: - trigger: webhook allowed_methods: - POST local_only: false webhook_id: 5dc5fc04-365e-4834-97e9-c6967bda3909 conditions: [] actions: - action: script.send_direct_notification data: message: 'New document ({{trigger.json[''id'']}}) {{trigger.json[''name'']}} from {{trigger.json[''correspondent'']}}. Download: {{trigger.json[''download_url'']}} Tags: {{trigger.json[''tags'']}}' title: ':leaves: Paperless' people: entity_id: - person.danny mode: queued max: 10 - id: '1630082312356' alias: 'PiHole: Change Status' description: '' triggers: - trigger: state entity_id: - switch.pi_hole - switch.pi_hole_2 - switch.pi_holes conditions: [] actions: - action: script.send_to_home_log data: message: Network filtering on {{ trigger.to_state.name }} has been turned {{ trigger.to_state.state }}. title: ':pie: :hole: Pi-Hole' log_level: Normal mode: single - id: '1737283018707' alias: 'Porch: Motion Detected' description: '' triggers: - trigger: state entity_id: - binary_sensor.porch_motion_occupancy to: 'on' conditions: - condition: state entity_id: binary_sensor.porch_motion_occupancy state: 'off' actions: - parallel: - action: light.turn_on metadata: {} data: brightness_pct: 100 target: entity_id: light.porch - action: timer.cancel target: entity_id: timer.porch_light data: {} mode: single - id: '1737283018708' alias: 'Porch: No Motion Detected' description: '' triggers: - trigger: state entity_id: - binary_sensor.porch_motion_occupancy to: 'off' for: 00:01:00 conditions: [] actions: - parallel: - action: script.send_to_home_log data: message: 'No motion. Starting :bulb: light timer.' title: Porch log_level: Debug - action: timer.start data: duration: 00:01:00 target: entity_id: timer.porch_light mode: single - id: '1737283018709' alias: 'Porch: Light Timer Finished' description: '' triggers: - trigger: event event_type: timer.finished event_data: entity_id: timer.porch_light conditions: [] actions: - parallel: - action: script.send_to_home_log data: message: Timer finished. Turning light off. title: Porch log_level: Debug - action: light.turn_off target: entity_id: light.porch mode: single - id: '1606157753577' alias: 'Porch: Front Door Opened' description: '' triggers: - trigger: state entity_id: binary_sensor.front_door to: 'on' conditions: [] actions: - parallel: - choose: - conditions: - condition: numeric_state entity_id: sensor.porch_motion_illuminance below: '100' sequence: - action: script.send_to_home_log data: message: 'Front :door: door opened it''s dark ({{ states(''sensor.porch_motion_illuminance'') }} < 100). Turning on :bulb: :high_brightness: light.' title: Porch log_level: Debug - action: scene.turn_on target: entity_id: scene.porch_light_on - action: timer.cancel target: entity_id: timer.porch_light data: {} default: [] - action: script.send_to_home_log data: message: 'Front :door: door opened. Incrementing counter :abacus: from {{ states(''counter.front_door_opened_closed'') }} to {{ states(''counter.front_door_opened_closed'') | int + state_attr(''counter.front_door_opened_closed'', ''step'') | int }}.' title: Porch log_level: Debug - action: counter.increment data: {} entity_id: counter.front_door_opened_closed - alias: Add delay otherwise the picture is too quick to capture someone walking through the door delay: seconds: 2 mode: single - id: '1614033445487' alias: 'Porch: Front Door Opened Once For More than 20 seconds' description: '' triggers: - trigger: state entity_id: binary_sensor.front_door to: 'on' from: 'off' for: 00:00:20 conditions: - condition: numeric_state entity_id: counter.front_door_opened_closed below: '2' actions: - action: script.send_to_home_log data: message: 'Front door has been opened for more than 20 secs. Resetting :abacus: counter from {{ states(''counter.front_door_opened_closed'') }} to 0.' title: Porch log_level: Debug - action: counter.reset data: {} entity_id: counter.front_door_opened_closed - id: '1611931052908' alias: 'Porch: Front Door Open Indicator' description: '' triggers: - trigger: state entity_id: binary_sensor.front_door from: 'off' to: 'on' conditions: - condition: state entity_id: group.tracked_people state: home actions: - parallel: - action: script.send_to_home_log data: message: 'front :door: door is open and:people_holding_hands: someone is home. Turning on notification :bulb: :high_brightness: light.' title: Porch log_level: Debug - action: script.front_door_open_notification data: {} mode: single - id: '1615224190495' alias: 'Porch: Front Door Closed For More than 20 seconds' description: '' triggers: - trigger: state entity_id: binary_sensor.front_door to: 'off' from: 'on' for: 00:00:20 conditions: [] actions: - parallel: - action: script.send_to_home_log data: message: 'Front door closed for more than 20 secs. Resetting :abacus: counter from {{ states(''counter.front_door_opened_closed'') }} to 0.' title: Porch log_level: Debug - action: counter.reset target: entity_id: counter.front_door_opened_closed mode: single - id: '1611931640441' alias: 'Porch: Front Door Closed' description: '' triggers: - trigger: state entity_id: binary_sensor.front_door from: 'on' to: 'off' conditions: [] actions: - parallel: - action: script.send_to_home_log data: message: 'Front :door: door closed.' title: Porch log_level: Debug - action: script.front_door_closed_notification data: {} mode: single - id: '1606157835544' alias: 'Porch: Front Door Closed' description: '' triggers: - trigger: state entity_id: binary_sensor.front_door from: 'on' to: 'off' conditions: [] actions: - parallel: - action: timer.start data: duration: 00:01:00 target: entity_id: timer.porch_light - action: script.send_to_home_log data: message: 'Front :door: door closed. Starting timer.' title: Porch log_level: Debug - choose: - conditions: - condition: state entity_id: light.stairs state: 'on' sequence: - action: script.send_to_home_log data: message: Front door closed. Turning stairs light off as fall back. title: Porch log_level: Debug - action: scene.turn_on target: entity_id: - scene.stairs_light_off default: [] mode: single - id: '1708895092115' alias: 'Porch: Light On And Door Is Shut' description: '' triggers: - trigger: state entity_id: - light.porch to: 'on' for: minutes: 5 conditions: - condition: state entity_id: binary_sensor.front_door state: 'off' - not: - condition: state entity_id: timer.porch_light state: active actions: - parallel: - action: script.send_to_home_log metadata: {} data: log_level: Debug title: Porch message: 'Light has been on for 5 minutes and :door: is closed. Turning light off.' - action: light.turn_off metadata: {} data: transition: 2 target: entity_id: light.porch mode: single - id: '1700940016581' alias: 'Porch: Light Switch' description: '' triggers: - trigger: state entity_id: - binary_sensor.porch_main_light_input not_from: - unknown - unavailable not_to: - unknown - unavailable conditions: [] actions: - parallel: - action: script.send_to_home_log data: log_level: Debug title: Porch message: Light switch changed - if: - condition: state entity_id: light.porch state: 'off' then: - action: scene.turn_on target: entity_id: scene.porch_light_on else: - action: light.turn_off target: entity_id: light.porch data: transition: 2 - action: timer.cancel target: entity_id: timer.porch_light data: {} mode: queued max: 10 - id: '1750929784418' alias: 'Predbat: Daily Summary' description: '' triggers: - trigger: time at: 08:00:00 conditions: [] actions: - action: script.send_direct_notification metadata: {} data: message: ' {{ state_attr(''predbat.plan_html'', ''text'')|replace(''