- alias: Ad-Hoc Charging description: '' trigger: - platform: time at: 02:00:00 id: Start charge - platform: time at: 05:00:00 id: Stop charge condition: [] action: - choose: - conditions: - condition: trigger id: Start charge sequence: - type: turn_on device_id: 86f6f7b8b3ba67d124acc8138c2a4a3c entity_id: switch.ad_hoc_charging_local domain: switch - type: turn_on device_id: 66e96b541c8c8cdaf67194ef989264ae entity_id: switch.ad_hoc_tou_charging_2_socket_1 domain: switch - conditions: - condition: trigger id: Stop charge sequence: - type: turn_off device_id: 86f6f7b8b3ba67d124acc8138c2a4a3c entity_id: switch.ad_hoc_charging_local domain: switch - type: turn_off device_id: 66e96b541c8c8cdaf67194ef989264ae entity_id: switch.ad_hoc_tou_charging_2_socket_1 domain: switch mode: single - alias: Alert when OneDrive is close to storage limit description: Send notification to phone when drive needs cleanup. triggers: - trigger: state entity_id: - sensor.onedrive_drive_state from: normal to: nearing - trigger: state entity_id: - sensor.onedrive_drive_state from: nearing to: critical actions: - action: script.text_notify_dave data: title: OneDrive is almost full! message: 'OneDrive has used up {{ states(''sensor.my_drive_used_storage'') }} of {{ states(''sensor.my_drive_total_available'') }}GB. Only {{ states(''sensor.my_drive_remaining_storage'') }}GB remaining. ' mode: single - alias: Alexa Set Volume for Announcements description: '' trigger: - platform: state entity_id: - input_number.alexa_volume_level_announcements id: Alexa Set Volume Announcements alias: When Alexa Volume Level for Annoucements changes condition: [] action: - service: media_player.volume_set target: entity_id: - media_player.dave_s_echo_pop - media_player.guest_bedroom_echo_dot - media_player.living_room_dot - media_player.kitchen_echo_show - media_player.main_bedroom_dot - media_player.dave_s_2nd_echo_pop_2 - media_player.seans_room_dot - media_player.dave_s_2nd_echo_pop data: volume_level: '{{ states(''input_number.alexa_volume_level_announcements'') | float(0) }}' mode: single - alias: All Govee Lighting v2.0 description: Uses scene snapshots for sunset and sunrise lights triggers: - entity_id: - sun.sun from: below_horizon to: above_horizon id: sunrise trigger: state enabled: true - entity_id: - binary_sensor.lunchtime from: 'off' to: 'on' id: Lunchtime trigger: state - entity_id: - binary_sensor.afternoon from: 'off' to: 'on' id: Afternoon trigger: state - entity_id: - binary_sensor.dinner_time from: 'off' to: 'on' id: Dinnertime trigger: state - entity_id: - binary_sensor.evening from: 'off' to: 'on' id: Evening trigger: state - entity_id: - sun.sun from: above_horizon to: below_horizon id: sunset trigger: state enabled: true - entity_id: sensor.living_room_fp2_light_sensor_light_level below: input_number.low_light_threshold id: Low Light for: seconds: 20 trigger: numeric_state - entity_id: sensor.living_room_fp2_light_sensor_light_level above: input_number.upper_light_threshold_level id: Good Light for: seconds: 20 trigger: numeric_state - entity_id: - switch.living_room_tv from: 'off' to: 'on' id: TV on trigger: state - entity_id: - switch.living_room_tv from: 'on' to: 'off' id: TV off trigger: state conditions: [] actions: - choose: - conditions: - condition: trigger id: - sunrise - condition: state entity_id: input_boolean.we_are_in_bed state: 'off' sequence: - action: scene.create data: scene_id: before_sunrise snapshot_entities: - light.bed_lamps_3 - light.stair_lights_2 - light.govee_glide_left_2 - light.glide_lights_right_2 - light.floor_lamp_pro_1 - light.xmas_string_lights_3_2 - delay: hours: 0 minutes: 0 seconds: 20 - parallel: - target: entity_id: - light.stair_lights_2 - light.bed_lamps_3 data: brightness_pct: 5 effect: Sunrise action: light.turn_on - target: entity_id: - light.govee_glide_left_2 - light.glide_lights_right_2 data: brightness_pct: 5 effect: Sunrise action: light.turn_on - target: entity_id: light.xmas_string_lights_3_2 data: brightness_pct: 50 effect: Sunrise action: light.turn_on - target: entity_id: - light.floor_lamp_pro_1 data: brightness_pct: 5 effect: Sunrise action: light.turn_on alias: Set lights to sunrise setting. - delay: minutes: 30 - action: scene.turn_on target: entity_id: scene.before_sunrise data: {} - conditions: - condition: trigger id: - Lunchtime sequence: - parallel: - target: entity_id: - light.glide_lights_right_2 - light.govee_glide_left_2 data: brightness_pct: 1 effect: Forest action: light.turn_on - target: entity_id: - light.stair_lights_2 - light.bed_lamps_3 data: brightness_pct: 20 effect: Spring action: light.turn_on - target: entity_id: light.xmas_string_lights_3_2 data: brightness_pct: 50 effect: Spring action: light.turn_on - target: entity_id: - light.floor_lamp_pro_1 data: brightness_pct: 5 effect: Forest action: light.turn_on - data: effect: Forest action: light.turn_on target: entity_id: light.corner_lamp_2 alias: Set lights to lunchtime effects. - delay: hours: 0 minutes: 0 seconds: 20 - action: scene.create data: snapshot_entities: - light.floor_lamp_pro_1 - light.govee_glide_left_2 - light.glide_lights_right_2 - light.corner_lamp_2 scene_id: lunchtime_govee - delay: hours: 0 minutes: 0 seconds: 20 - condition: state entity_id: binary_sensor.living_room_occupied state: 'off' - action: light.turn_off target: entity_id: - light.floor_lamp_pro_1 - light.govee_glide_left_2 - light.glide_lights_right_2 - light.corner_lamp_2 data: {} - conditions: - condition: trigger id: - Afternoon sequence: - parallel: - target: entity_id: - light.glide_lights_right_2 - light.govee_glide_left_2 data: brightness_pct: 1 effect: Rustling Leaves action: light.turn_on - target: entity_id: - light.stair_lights_2 - light.bed_lamps_3 data: brightness_pct: 10 effect: Rustling Leaves action: light.turn_on - target: entity_id: light.xmas_string_lights_3_2 data: brightness_pct: 50 effect: Rustling Leaves action: light.turn_on - target: entity_id: - light.floor_lamp_pro_1 data: brightness_pct: 5 effect: Forest action: light.turn_on - data: effect: Forest action: light.turn_on target: entity_id: light.corner_lamp_2 alias: Set lights to Afternoon effects. - delay: hours: 0 minutes: 0 seconds: 20 - action: scene.create data: scene_id: afternoon_govee snapshot_entities: - light.floor_lamp_pro_1 - light.govee_glide_left_2 - light.glide_lights_right_2 - light.corner_lamp_2 - delay: hours: 0 minutes: 0 seconds: 20 - condition: state entity_id: binary_sensor.living_room_occupied state: 'off' - action: light.turn_off target: entity_id: - light.floor_lamp_pro_1 - light.govee_glide_left_2 - light.glide_lights_right_2 - light.corner_lamp_2 data: {} - conditions: - condition: trigger id: - Dinnertime sequence: - parallel: - target: entity_id: - light.glide_lights_right_2 - light.govee_glide_left_2 data: brightness_pct: 1 effect: Candlelight action: light.turn_on - target: entity_id: - light.stair_lights_2 - light.bed_lamps_3 data: brightness_pct: 1 effect: Fall action: light.turn_on - target: entity_id: light.xmas_string_lights_3_2 data: brightness_pct: 20 effect: Fall action: light.turn_on - target: entity_id: - light.floor_lamp_pro_1 data: brightness_pct: 5 effect: Twilight action: light.turn_on - data: effect: Forest action: light.turn_on target: entity_id: light.corner_lamp_2 alias: Set lights to Dinnertime effects. - delay: hours: 0 minutes: 0 seconds: 20 - action: scene.create data: snapshot_entities: - light.floor_lamp_pro_1 - light.govee_glide_left_2 - light.glide_lights_right_2 - light.corner_lamp_2 scene_id: dinnertime_govee - delay: hours: 0 minutes: 0 seconds: 20 - condition: state entity_id: binary_sensor.living_room_occupied state: 'off' - action: light.turn_off target: entity_id: - light.floor_lamp_pro_1 - light.govee_glide_left_2 - light.glide_lights_right_2 - light.corner_lamp_2 data: {} - conditions: - condition: trigger id: - Evening sequence: - parallel: - target: entity_id: - light.glide_lights_right_2 - light.govee_glide_left_2 data: brightness_pct: 1 effect: Fire action: light.turn_on - target: entity_id: - light.stair_lights_2 - light.bed_lamps_3 data: brightness_pct: 5 effect: Fall action: light.turn_on - target: entity_id: light.xmas_string_lights_3_2 data: brightness_pct: 50 effect: Fire action: light.turn_on - target: entity_id: - light.floor_lamp_pro_1 data: brightness_pct: 5 effect: Fire action: light.turn_on - data: effect: Forest action: light.turn_on target: entity_id: light.corner_lamp_2 alias: Set lights to Evening effects. - delay: hours: 0 minutes: 0 seconds: 20 - action: scene.create data: snapshot_entities: - light.floor_lamp_pro_1 - light.govee_glide_left_2 - light.glide_lights_right_2 - light.corner_lamp_2 scene_id: evening_govee - delay: hours: 0 minutes: 0 seconds: 20 - condition: state entity_id: binary_sensor.living_room_occupied state: 'off' - action: light.turn_off target: entity_id: - light.floor_lamp_pro_1 - light.govee_glide_left_2 - light.glide_lights_right_2 - light.corner_lamp_2 data: {} - conditions: - condition: trigger id: - sunset - condition: state entity_id: input_boolean.we_are_in_bed state: 'off' sequence: - parallel: - target: entity_id: - light.stair_lights_2 - light.bed_lamps_3 data: brightness_pct: 5 effect: Warm action: light.turn_on - target: entity_id: - light.govee_glide_left_2 - light.glide_lights_right_2 data: brightness_pct: 5 effect: Sunset Glow action: light.turn_on - target: entity_id: light.xmas_string_lights_3_2 data: brightness_pct: 50 effect: Warm action: light.turn_on - target: entity_id: - light.floor_lamp_pro_1 data: brightness_pct: 5 effect: Sunset action: light.turn_on alias: Set lights to Sunset effects. - delay: minutes: 30 - alias: If afternoon reapply scene else apply evening if: - condition: state entity_id: binary_sensor.afternoon state: 'on' then: - action: scene.turn_on target: entity_id: - scene.afternoon_govee data: {} else: - parallel: - target: entity_id: - light.glide_lights_right_2 - light.govee_glide_left_2 data: brightness_pct: 1 effect: Fire action: light.turn_on - target: entity_id: - light.stair_lights_2 - light.bed_lamps_3 data: brightness_pct: 5 effect: Fall action: light.turn_on - target: entity_id: light.xmas_string_lights_3_2 data: brightness_pct: 20 effect: Fire action: light.turn_on - target: entity_id: - light.floor_lamp_pro_1 data: brightness_pct: 5 effect: Fire action: light.turn_on alias: Set lights to Evening effects. - conditions: - condition: trigger id: Low Light - condition: state entity_id: switch.living_room_tv state: 'on' sequence: - data: {} target: entity_id: light.dreamview_g1_pro_2 action: light.turn_on - conditions: - condition: trigger id: Good Light - condition: state entity_id: switch.living_room_tv state: 'on' sequence: - data: {} target: entity_id: light.dreamview_g1_pro_2 action: light.turn_off - conditions: - condition: trigger id: - TV on - condition: or conditions: - condition: state entity_id: binary_sensor.day state: 'off' - condition: numeric_state entity_id: sensor.living_room_fp2_light_sensor_light_level below: input_number.low_light_threshold sequence: - target: entity_id: light.dreamview_g1_pro_2 data: {} action: light.turn_on - conditions: - condition: trigger id: - TV off - condition: state entity_id: light.dreamview_g1_pro_2 state: 'on' sequence: - target: entity_id: light.dreamview_g1_pro_2 data: {} action: light.turn_off mode: parallel - alias: All Govee Lighting v2.0 description: Uses scene snapshots for sunset and sunrise lights triggers: - entity_id: - sun.sun from: below_horizon to: above_horizon id: sunrise trigger: state enabled: true - entity_id: - binary_sensor.lunchtime from: 'off' to: 'on' id: Lunchtime trigger: state - entity_id: - binary_sensor.afternoon from: 'off' to: 'on' id: Afternoon trigger: state - entity_id: - binary_sensor.dinner_time from: 'off' to: 'on' id: Dinnertime trigger: state - entity_id: - binary_sensor.evening from: 'off' to: 'on' id: Evening trigger: state - entity_id: - sun.sun from: above_horizon to: below_horizon id: sunset trigger: state enabled: true - entity_id: sensor.living_room_fp2_light_sensor_light_level below: input_number.low_light_threshold id: Low Light for: seconds: 20 trigger: numeric_state - entity_id: sensor.living_room_fp2_light_sensor_light_level above: input_number.upper_light_threshold_level id: Good Light for: seconds: 20 trigger: numeric_state - entity_id: - switch.living_room_tv from: 'off' to: 'on' id: TV on trigger: state - entity_id: - switch.living_room_tv from: 'on' to: 'off' id: TV off trigger: state conditions: [] actions: - choose: - conditions: - condition: trigger id: - sunrise - condition: state entity_id: input_boolean.we_are_in_bed state: 'off' sequence: - action: scene.create data: scene_id: before_sunrise snapshot_entities: - light.bed_lamps_3 - light.stair_lights_2 - light.govee_glide_left_2 - light.glide_lights_right_2 - light.floor_lamp_pro_1 - light.xmas_string_lights_3_2 - delay: hours: 0 minutes: 0 seconds: 5 milliseconds: 0 - parallel: - target: entity_id: - light.stair_lights_2 - light.bed_lamps_3 data: brightness_pct: 5 effect: Sunrise action: light.turn_on - target: entity_id: - light.govee_glide_left_2 - light.glide_lights_right_2 data: brightness_pct: 5 effect: Sunrise action: light.turn_on - target: entity_id: light.xmas_string_lights_3_2 data: brightness_pct: 50 effect: Sunrise action: light.turn_on - target: entity_id: - light.floor_lamp_pro_1 data: brightness_pct: 5 effect: Sunrise action: light.turn_on alias: Set lights to sunrise setting. - action: script.update_govee_scene_tracker data: new_scene: Sunrise - delay: minutes: 30 - action: scene.turn_on target: entity_id: scene.before_sunrise data: {} - conditions: - condition: trigger id: - Lunchtime sequence: - parallel: - target: entity_id: - light.glide_lights_right_2 - light.govee_glide_left_2 data: brightness_pct: 1 effect: Forest action: light.turn_on - target: entity_id: - light.stair_lights_2 - light.bed_lamps_3 data: brightness_pct: 20 effect: Spring action: light.turn_on - target: entity_id: light.xmas_string_lights_3_2 data: brightness_pct: 50 effect: Spring action: light.turn_on - target: entity_id: - light.floor_lamp_pro_1 data: brightness_pct: 5 effect: Forest action: light.turn_on - data: effect: Forest action: light.turn_on target: entity_id: light.corner_lamp_2 alias: Set lights to lunchtime effects. - action: script.update_govee_scene_tracker data: new_scene: Lunchtime - delay: hours: 0 minutes: 0 seconds: 20 - condition: state entity_id: binary_sensor.living_room_occupied state: 'off' - action: light.turn_off target: entity_id: - light.floor_lamp_pro_1 - light.govee_glide_left_2 - light.glide_lights_right_2 - light.corner_lamp_2 data: {} - conditions: - condition: trigger id: - Afternoon sequence: - parallel: - target: entity_id: - light.glide_lights_right_2 - light.govee_glide_left_2 data: brightness_pct: 1 effect: Rustling Leaves action: light.turn_on - target: entity_id: - light.stair_lights_2 - light.bed_lamps_3 data: brightness_pct: 10 effect: Rustling Leaves action: light.turn_on - target: entity_id: light.xmas_string_lights_3_2 data: brightness_pct: 50 effect: Rustling Leaves action: light.turn_on - target: entity_id: - light.floor_lamp_pro_1 data: brightness_pct: 5 effect: Forest action: light.turn_on - data: effect: Forest action: light.turn_on target: entity_id: light.corner_lamp_2 alias: Set lights to Afternoon effects. - action: script.update_govee_scene_tracker data: new_scene: Afternoon - delay: hours: 0 minutes: 0 seconds: 20 - condition: state entity_id: binary_sensor.living_room_occupied state: 'off' - action: light.turn_off target: entity_id: - light.floor_lamp_pro_1 - light.govee_glide_left_2 - light.glide_lights_right_2 - light.corner_lamp_2 data: {} - conditions: - condition: trigger id: - Dinnertime sequence: - parallel: - target: entity_id: - light.glide_lights_right_2 - light.govee_glide_left_2 data: brightness_pct: 1 effect: Candlelight action: light.turn_on - target: entity_id: - light.stair_lights_2 - light.bed_lamps_3 data: brightness_pct: 1 effect: Fall action: light.turn_on - target: entity_id: light.xmas_string_lights_3_2 data: brightness_pct: 20 effect: Fall action: light.turn_on - target: entity_id: - light.floor_lamp_pro_1 data: brightness_pct: 5 effect: Twilight action: light.turn_on - data: effect: Forest action: light.turn_on target: entity_id: light.corner_lamp_2 alias: Set lights to Dinnertime effects. - action: script.update_govee_scene_tracker data: new_scene: Dinnertime - delay: hours: 0 minutes: 0 seconds: 20 - condition: state entity_id: binary_sensor.living_room_occupied state: 'off' - action: light.turn_off target: entity_id: - light.floor_lamp_pro_1 - light.govee_glide_left_2 - light.glide_lights_right_2 - light.corner_lamp_2 data: {} - conditions: - condition: trigger id: - Evening sequence: - parallel: - target: entity_id: - light.glide_lights_right_2 - light.govee_glide_left_2 data: brightness_pct: 1 effect: Fire action: light.turn_on - target: entity_id: - light.stair_lights_2 - light.bed_lamps_3 data: brightness_pct: 5 effect: Fall action: light.turn_on - target: entity_id: light.xmas_string_lights_3_2 data: brightness_pct: 50 effect: Fire action: light.turn_on - target: entity_id: - light.floor_lamp_pro_1 data: brightness_pct: 5 effect: Fire action: light.turn_on - data: effect: Forest action: light.turn_on target: entity_id: light.corner_lamp_2 alias: Set lights to Evening effects. - action: script.update_govee_scene_tracker data: new_scene: Evening - delay: hours: 0 minutes: 0 seconds: 20 - condition: state entity_id: binary_sensor.living_room_occupied state: 'off' - action: light.turn_off target: entity_id: - light.floor_lamp_pro_1 - light.govee_glide_left_2 - light.glide_lights_right_2 - light.corner_lamp_2 data: {} - conditions: - condition: trigger id: - sunset - condition: state entity_id: input_boolean.we_are_in_bed state: 'off' sequence: - parallel: - target: entity_id: - light.stair_lights_2 - light.bed_lamps_3 data: brightness_pct: 5 effect: Warm action: light.turn_on - target: entity_id: - light.govee_glide_left_2 - light.glide_lights_right_2 data: brightness_pct: 5 effect: Sunset Glow action: light.turn_on - target: entity_id: light.xmas_string_lights_3_2 data: brightness_pct: 50 effect: Warm action: light.turn_on - target: entity_id: - light.floor_lamp_pro_1 data: brightness_pct: 5 effect: Sunset action: light.turn_on alias: Set lights to Sunset effects. - action: script.update_govee_scene_tracker data: new_scene: Sunset - delay: minutes: 30 - alias: If afternoon reapply scene else apply evening if: - condition: state entity_id: binary_sensor.afternoon state: 'on' then: - action: scene.turn_on target: entity_id: - scene.afternoon_govee data: {} - action: script.update_govee_scene_tracker data: new_scene: Afternoon else: - parallel: - target: entity_id: - light.glide_lights_right_2 - light.govee_glide_left_2 data: brightness_pct: 1 effect: Fire action: light.turn_on - target: entity_id: - light.stair_lights_2 - light.bed_lamps_3 data: brightness_pct: 5 effect: Fall action: light.turn_on - target: entity_id: light.xmas_string_lights_3_2 data: brightness_pct: 20 effect: Fire action: light.turn_on - target: entity_id: - light.floor_lamp_pro_1 data: brightness_pct: 5 effect: Fire action: light.turn_on alias: Set lights to Evening effects. - action: script.update_govee_scene_tracker data: new_scene: Evening - conditions: - condition: trigger id: Low Light - condition: state entity_id: switch.living_room_tv state: 'on' sequence: - data: {} target: entity_id: light.dreamview_g1_pro_2 action: light.turn_on - conditions: - condition: trigger id: Good Light - condition: state entity_id: switch.living_room_tv state: 'on' sequence: - data: {} target: entity_id: light.dreamview_g1_pro_2 action: light.turn_off - conditions: - condition: trigger id: - TV on - condition: or conditions: - condition: state entity_id: binary_sensor.day state: 'off' - condition: numeric_state entity_id: sensor.living_room_fp2_light_sensor_light_level below: input_number.low_light_threshold sequence: - target: entity_id: light.dreamview_g1_pro_2 data: {} action: light.turn_on - conditions: - condition: trigger id: - TV off - condition: state entity_id: light.dreamview_g1_pro_2 state: 'on' sequence: - target: entity_id: light.dreamview_g1_pro_2 data: {} action: light.turn_off mode: parallel - alias: HEATING - All Automations description: Detects when a window is open or closed and sets heating on or off in that room. Detects when no-one is home and turns heating off. trigger: - platform: state entity_id: - person.david_forrester from: home to: not_home for: hours: 0 minutes: 2 seconds: 0 id: Dave Away - platform: state entity_id: - person.david_forrester from: not_home to: home for: hours: 0 minutes: 2 seconds: 0 id: Dave Home - platform: state entity_id: - person.gem_forrester from: home to: not_home for: hours: 0 minutes: 2 seconds: 0 id: Gem Away - platform: state entity_id: - person.gem_forrester from: not_home to: home for: hours: 0 minutes: 2 seconds: 0 id: Gem Home - platform: state entity_id: - binary_sensor.front_door_sense_contact - binary_sensor.back_door_sensor_contact - binary_sensor.side_door_sensor_contact - binary_sensor.kitchen_window_left_contact - binary_sensor.kitchen_window_right_contact - binary_sensor.living_room_window_left_contact - binary_sensor.living_room_window_right_contact - binary_sensor.hallway_window_contact to: 'on' id: Downstairs Door or Window Open for: hours: 0 minutes: 0 seconds: 30 - platform: state entity_id: - binary_sensor.front_door_sense_contact - binary_sensor.back_door_sensor_contact - binary_sensor.side_door_sensor_contact - binary_sensor.kitchen_window_left_contact - binary_sensor.kitchen_window_right_contact - binary_sensor.living_room_window_left_contact - binary_sensor.living_room_window_right_contact - binary_sensor.hallway_window_contact to: 'off' id: Downstairs Door or Window Closed - type: opened platform: device device_id: e6ba853c7dec9cf8415d6881aa429444 entity_id: binary_sensor.dining_room_window_right_contact domain: binary_sensor id: Dining Room Window Right Open - type: not_opened platform: device device_id: e6ba853c7dec9cf8415d6881aa429444 entity_id: binary_sensor.dining_room_window_right_contact domain: binary_sensor id: Dining Room Window Right Closed - type: opened platform: device device_id: f9aaa501ddaeabde9538648caab6c975 entity_id: binary_sensor.cloakroom_window_contact domain: binary_sensor id: Cloakroom Window Open - type: not_opened platform: device device_id: f9aaa501ddaeabde9538648caab6c975 entity_id: binary_sensor.cloakroom_window_contact domain: binary_sensor id: Cloakroom Window Closed - type: opened platform: device device_id: 5af72a1353a555c5830dcba725c7cf23 entity_id: binary_sensor.en_suite_window_sensor_contact domain: binary_sensor id: En-Suite Window Open - type: not_opened platform: device device_id: 5af72a1353a555c5830dcba725c7cf23 entity_id: binary_sensor.en_suite_window_sensor_contact domain: binary_sensor id: En-Suite Window Closed - type: opened platform: device device_id: 13a27670b56ff35704df9339e2a668a1 entity_id: binary_sensor.office_window_sensor_contact domain: binary_sensor id: Office Window Open - type: not_opened platform: device device_id: 13a27670b56ff35704df9339e2a668a1 entity_id: binary_sensor.office_window_sensor_contact domain: binary_sensor id: Office Window Closed - platform: state entity_id: - binary_sensor.main_bedroom_window_left_contact - binary_sensor.main_bedroom_window_right_contact to: 'on' id: Bedroom Window Open - platform: state entity_id: - binary_sensor.main_bedroom_window_left_contact - binary_sensor.main_bedroom_window_right_contact to: 'off' id: Bedroom Window Closed - platform: state entity_id: - binary_sensor.guest_bedroom_window_left_contact - binary_sensor.guest_bedroom_window_right_contact id: Guest Bedroom Window Open to: 'on' - platform: state entity_id: - binary_sensor.guest_bedroom_window_left_contact - binary_sensor.guest_bedroom_window_right_contact to: 'off' id: Guest Bedroom Window Closed - platform: state entity_id: - binary_sensor.sean_s_bedroom_window_left_contact - binary_sensor.sean_s_bedroom_window_right_contact - binary_sensor.jamie_s_bedroom_window_left_contact - binary_sensor.bathroom_window_contact - binary_sensor.jamie_s_bedroom_window_right_contact to: 'on' id: Upstairs Windows Open - platform: state entity_id: - binary_sensor.sean_s_bedroom_window_left_contact - binary_sensor.sean_s_bedroom_window_right_contact - binary_sensor.bathroom_window_contact - binary_sensor.jamie_s_bedroom_window_left_contact - binary_sensor.jamie_s_bedroom_window_right_contact to: 'off' id: Upstairs Windows Closed - platform: state entity_id: - binary_sensor.kids_bathroom_window_left_contact - binary_sensor.kids_bathroom_window_right_contact to: 'on' id: Kids Bathroom Window Open - platform: state entity_id: - binary_sensor.kids_bathroom_window_left_contact - binary_sensor.kids_bathroom_window_right_contact to: 'off' id: Kids Bathroom Window Closed condition: [] action: - choose: - conditions: - condition: trigger id: Dave Away - condition: state entity_id: person.gem_forrester state: not_home - condition: or conditions: - condition: state entity_id: input_select.desired_heating_mode state: 'On' - condition: state entity_id: input_select.desired_heating_mode state: Auto sequence: - service: script.heating_turn_off_all_radiators data: {} - conditions: - condition: trigger id: Gem Away - condition: state entity_id: person.david_forrester state: not_home - condition: or conditions: - condition: state entity_id: input_select.desired_heating_mode state: 'On' - condition: state entity_id: input_select.desired_heating_mode state: Auto sequence: - service: script.heating_turn_off_all_radiators data: {} - conditions: - condition: trigger id: Dave Home - condition: state entity_id: person.gem_forrester state: not_home - condition: state entity_id: input_select.desired_heating_mode state: Auto sequence: - service: script.heating_resume_schedule_all_radiators data: {} - conditions: - condition: trigger id: Gem Home - condition: state entity_id: person.david_forrester state: not_home - condition: state entity_id: input_select.desired_heating_mode state: Auto sequence: - service: script.heating_resume_schedule_all_radiators data: {} - conditions: - condition: trigger id: Downstairs Door or Window Open - condition: or conditions: - condition: device device_id: 84daad158322931a2b14ee69a6a9c8f5 domain: climate entity_id: climate.downstairs type: is_hvac_mode hvac_mode: auto - condition: device device_id: 84daad158322931a2b14ee69a6a9c8f5 domain: climate entity_id: climate.downstairs type: is_hvac_mode hvac_mode: heat alias: Test if heating is on or in auto sequence: - service: climate.set_hvac_mode data: hvac_mode: 'off' alias: Turn off heating downstairs target: entity_id: climate.downstairs - conditions: - condition: trigger id: Downstairs Door or Window Closed sequence: - if: - condition: state entity_id: input_select.desired_heating_mode state: Auto then: - service: climate.set_hvac_mode data: hvac_mode: auto target: entity_id: climate.downstairs - conditions: - condition: trigger id: Cloakroom Window Open - condition: or conditions: - condition: device device_id: 2fe808a84c082db3968a4d856fe6e8ef domain: climate entity_id: climate.cloakroom type: is_hvac_mode hvac_mode: auto - condition: device device_id: 2fe808a84c082db3968a4d856fe6e8ef domain: climate entity_id: climate.cloakroom type: is_hvac_mode hvac_mode: heat alias: Test if heating is on or in auto sequence: - service: climate.set_hvac_mode data: hvac_mode: 'off' target: entity_id: climate.cloakroom - conditions: - condition: trigger id: Cloakroom Window Closed sequence: - if: - condition: state entity_id: input_select.desired_heating_mode state: Auto then: - service: climate.set_hvac_mode data: hvac_mode: auto target: entity_id: climate.cloakroom - conditions: - condition: trigger id: En-Suite Window Open - condition: or conditions: - condition: device device_id: 2912cee70e19436c9d6795287d1cf8c9 domain: climate entity_id: climate.en_suite_bathroom type: is_hvac_mode hvac_mode: auto - condition: device device_id: 2912cee70e19436c9d6795287d1cf8c9 domain: climate entity_id: climate.en_suite_bathroom type: is_hvac_mode hvac_mode: heat alias: Heating is on or in auto sequence: - service: climate.set_hvac_mode data: hvac_mode: 'off' target: entity_id: climate.en_suite_bathroom - conditions: - condition: trigger id: En-Suite Window Closed sequence: - if: - condition: state entity_id: input_select.desired_heating_mode state: Auto then: - service: climate.set_hvac_mode data: hvac_mode: auto target: entity_id: climate.en_suite_bathroom - conditions: - condition: trigger id: Office Window Open - condition: or conditions: - condition: device device_id: 71a6edc5565513cdbe48f2b5c45189fa domain: climate entity_id: climate.office type: is_hvac_mode hvac_mode: auto - condition: device device_id: 71a6edc5565513cdbe48f2b5c45189fa domain: climate entity_id: climate.office type: is_hvac_mode hvac_mode: heat alias: Test if heating is on or in auto sequence: - service: climate.set_hvac_mode data: hvac_mode: 'off' target: entity_id: climate.office - conditions: - condition: trigger id: Office Window Closed sequence: - if: - condition: state entity_id: input_select.desired_heating_mode state: Auto then: - service: climate.set_hvac_mode data: hvac_mode: auto target: entity_id: climate.office - conditions: - condition: trigger id: Bedroom Window Open - condition: or conditions: - condition: device device_id: 5b51bb0d00f12ec04c45d29296b6b9ee domain: climate entity_id: climate.master_bedroom type: is_hvac_mode hvac_mode: heat - condition: device device_id: 5b51bb0d00f12ec04c45d29296b6b9ee domain: climate entity_id: climate.master_bedroom type: is_hvac_mode hvac_mode: auto alias: Test if heating is on or in auto sequence: - service: climate.set_hvac_mode data: hvac_mode: 'off' target: entity_id: climate.master_bedroom - conditions: - condition: trigger id: Bedroom Window Closed sequence: - if: - condition: state entity_id: input_select.desired_heating_mode state: Auto then: - service: climate.set_hvac_mode data: hvac_mode: auto target: entity_id: - climate.master_bedroom - conditions: - condition: trigger id: Guest Bedroom Window Open - condition: or conditions: - condition: device device_id: bc71698349b1224d4f591b0d87542cb5 domain: climate entity_id: climate.guest_bedroom type: is_hvac_mode hvac_mode: heat - condition: device device_id: bc71698349b1224d4f591b0d87542cb5 domain: climate entity_id: climate.guest_bedroom type: is_hvac_mode hvac_mode: auto alias: Test if heating is on or in auto sequence: - service: climate.set_hvac_mode data: hvac_mode: 'off' target: entity_id: - climate.guest_bedroom - conditions: - condition: trigger id: Guest Bedroom Window Closed sequence: - if: - condition: state entity_id: input_select.desired_heating_mode state: Auto then: - service: climate.set_hvac_mode data: hvac_mode: auto target: entity_id: - climate.guest_bedroom - conditions: - condition: trigger id: Upstairs Windows Open - condition: or conditions: - condition: device device_id: 4815bc131fac9883b8fc60472f8ac3e2 domain: climate entity_id: climate.upstairs type: is_hvac_mode hvac_mode: heat - condition: device device_id: 4815bc131fac9883b8fc60472f8ac3e2 domain: climate entity_id: climate.upstairs type: is_hvac_mode hvac_mode: auto alias: Test if heating is on or in auto sequence: - service: climate.set_hvac_mode data: hvac_mode: 'off' target: entity_id: - climate.upstairs - conditions: - condition: trigger id: Upstairs Windows Closed sequence: - if: - condition: state entity_id: input_select.desired_heating_mode state: Auto then: - service: climate.set_hvac_mode data: hvac_mode: auto target: entity_id: - climate.upstairs - conditions: - condition: trigger id: Kids Bathroom Window Open - condition: or conditions: - condition: device device_id: 4815bc131fac9883b8fc60472f8ac3e2 domain: climate entity_id: climate.kids_bathroom type: is_hvac_mode hvac_mode: heat - condition: device device_id: 4815bc131fac9883b8fc60472f8ac3e2 domain: climate entity_id: climate.kids_bathroom type: is_hvac_mode hvac_mode: auto alias: Test if heating is on or in auto sequence: - service: climate.set_hvac_mode data: hvac_mode: 'off' target: entity_id: climate.kids_bathroom - conditions: - condition: trigger id: Kids Bathroom Window Closed sequence: - if: - condition: state entity_id: input_select.desired_heating_mode state: Auto then: - service: climate.set_hvac_mode data: hvac_mode: auto target: entity_id: - climate.kids_bathroom mode: restart - alias: All Lights Automation description: Turns on/off lights with presence, light level, door or time trigger: - platform: state entity_id: - binary_sensor.camera_hub_g3_ddd9_motion_sensor - binary_sensor.dining_room_presence_sensor_occupancy - binary_sensor.hallway_camera_cell_motion_detection - binary_sensor.lower_landing_motion_occupancy - binary_sensor.seans_room_camera_cell_motion_detection - binary_sensor.jamie_s_room_cam_cell_motion_detection - binary_sensor.guest_bedroom_camera_cell_motion_detection - binary_sensor.guest_bedroom_motion_occupancy - binary_sensor.main_bedroom_fp2_presence_sensor_1 - binary_sensor.main_bedroom_fp2_presence_sensor_2 - binary_sensor.main_bedroom_fp2_presence_sensor_3 - binary_sensor.main_bedroom_fp2_presence_sensor_4 - binary_sensor.office_presence_sensor_occupancy - binary_sensor.cloakroom_presence_occupancy - binary_sensor.jack_and_jill_presence_occupancy - binary_sensor.upper_landing_presence_occupancy from: 'off' to: 'on' id: Motion - platform: state entity_id: - binary_sensor.camera_hub_g3_ddd9_motion_sensor - binary_sensor.dining_room_presence_sensor_occupancy - binary_sensor.hallway_camera_cell_motion_detection - binary_sensor.lower_landing_motion_occupancy - binary_sensor.seans_room_camera_cell_motion_detection - binary_sensor.jamie_s_room_cam_cell_motion_detection - binary_sensor.guest_bedroom_camera_cell_motion_detection - binary_sensor.guest_bedroom_motion_occupancy - binary_sensor.main_bedroom_fp2_presence_sensor_1 - binary_sensor.main_bedroom_fp2_presence_sensor_2 - binary_sensor.main_bedroom_fp2_presence_sensor_3 - binary_sensor.main_bedroom_fp2_presence_sensor_4 - binary_sensor.office_presence_sensor_occupancy - binary_sensor.cloakroom_presence_occupancy - binary_sensor.jack_and_jill_presence_occupancy - binary_sensor.upper_landing_presence_occupancy for: hours: 0 minutes: 2 seconds: 0 from: 'on' to: 'off' id: No Motion - platform: numeric_state entity_id: - sensor.living_room_fp2_light_sensor_light_level - sensor.main_bedroom_fp2_light_sensor_light_level - sensor.average_light_level_downstairs - sensor.average_light_level_upstairs - sensor.average_indoor_light_level - sensor.dining_room_presence_sensor_illuminance - sensor.office_presence_sensor_illuminance_lux - sensor.upper_landing_presence_illuminance_lux - sensor.jack_and_jill_presence_illuminance_lux below: 20 id: Low Light - platform: numeric_state entity_id: - sensor.living_room_fp2_light_sensor_light_level - sensor.main_bedroom_fp2_light_sensor_light_level - sensor.average_light_level_downstairs - sensor.average_light_level_upstairs - sensor.average_indoor_light_level - sensor.dining_room_presence_sensor_illuminance - sensor.office_presence_sensor_illuminance_lux - sensor.upper_landing_presence_illuminance_lux - sensor.jack_and_jill_presence_illuminance_lux above: 80 id: Good Light - platform: state entity_id: - binary_sensor.garage_door_left_contact - binary_sensor.garage_door_right_contact - binary_sensor.loft_hatch_sensor_contact - binary_sensor.back_door_sensor_contact from: 'off' to: 'on' id: Door Open - platform: state entity_id: - binary_sensor.garage_door_left_contact - binary_sensor.garage_door_right_contact - binary_sensor.loft_hatch_sensor_contact - binary_sensor.back_door_sensor_contact from: 'on' to: 'off' id: Door Closed - platform: device type: turned_on device_id: 621f8db4e2d03a6d1cb101ec3be46e7a entity_id: switch.cloakroom_light domain: switch id: Cloakroom light on - platform: event event_type: timer.finished event_data: entity_id: timer.cloakroom_light id: Cloakroom Light off alias: Cloakroom Light off with Timer - platform: state entity_id: - binary_sensor.lights_out from: 'off' to: 'on' id: Lights Out - platform: sun event: sunset offset: -00:30:00 id: Dusk condition: - condition: state entity_id: input_boolean.holiday_mode state: 'off' action: - choose: - conditions: - condition: trigger id: - Door Open - condition: template value_template: '{{ "Loft" in trigger.to_state.attributes.friendly_name }}' alias: Filter Loft Hatch - condition: state entity_id: light.loft_light state: 'off' sequence: - service: light.turn_on data: {} target: entity_id: light.loft_light - conditions: - condition: trigger id: - Door Closed - condition: template value_template: '{{ "Loft" in trigger.to_state.attributes.friendly_name }}' alias: Filter Loft Hatch - condition: state entity_id: light.loft_light state: 'on' sequence: - service: light.turn_off data: {} target: entity_id: light.loft_light - conditions: - condition: trigger id: - Cloakroom light on sequence: - service: timer.start data: {} target: entity_id: timer.cloakroom_light - conditions: - condition: trigger id: - Cloakroom Light off - condition: state entity_id: light.cloakroom_light_2 state: 'on' sequence: - service: light.turn_off data: {} target: entity_id: light.cloakroom_light_2 - conditions: - condition: trigger id: - Door Open - condition: template value_template: '{{"Garage" in trigger.to_state.attributes.friendly_name }}' alias: Filter Garage Doors - condition: state entity_id: light.garage_lights state: 'off' sequence: - service: light.turn_on data: {} target: entity_id: light.garage_lights - conditions: - condition: trigger id: - Door Closed - condition: template value_template: '{{"Garage Door Right" in trigger.to_state.attributes.friendly_name }}' alias: Filter Garage Door Right - condition: state entity_id: binary_sensor.garage_door_left_contact state: 'off' - condition: state entity_id: light.garage_lights state: 'on' sequence: - service: light.turn_off data: {} target: entity_id: light.garage_lights - conditions: - condition: trigger id: - Door Closed - condition: template value_template: '{{"Garage Door Left" in trigger.to_state.attributes.friendly_name }}' alias: Filter Garage Door Left - condition: state entity_id: binary_sensor.garage_door_right_contact state: 'off' - condition: state entity_id: light.garage_lights state: 'on' sequence: - service: light.turn_off data: {} target: entity_id: light.garage_lights - conditions: - condition: trigger id: - Door Open - condition: template value_template: '{{"Back" in trigger.to_state.attributes.friendly_name }}' alias: Filter Back Door - condition: sun after: sunset before: sunrise sequence: - service: light.turn_on data: color_temp: 500 brightness_pct: 75 target: entity_id: light.back_door_light - conditions: - condition: trigger id: - Door Closed - condition: template value_template: '{{"Back" in trigger.to_state.attributes.friendly_name }}' alias: Filter Back Door - condition: state entity_id: light.back_door_light state: 'on' sequence: - service: light.turn_off data: transition: 300 target: entity_id: light.back_door_light - conditions: - condition: trigger id: - Motion - condition: template value_template: '{{"Guest" in trigger.to_state.attributes.friendly_name }}' alias: 'Filter Guest Bedroom ' - condition: state entity_id: binary_sensor.lights_out state: 'off' - condition: numeric_state entity_id: sensor.average_light_level_upstairs below: 20 - condition: state entity_id: input_boolean.guest_bedroom_bedside_lamps_active state: 'on' sequence: - service: light.turn_on data: color_temp: 500 brightness_pct: 5 target: entity_id: light.guest_bedroom_bedside_lamp_left - service: light.turn_on data: color_temp: 500 brightness_pct: 5 target: entity_id: light.guest_bedroom_bedside_lamp_right - conditions: - condition: trigger id: - No Motion - condition: template value_template: '{{"Guest" in trigger.to_state.attributes.friendly_name }}' alias: Filter Guest Bedroom - condition: state entity_id: light.guest_bedroom_bedside_lamp_left state: 'on' - condition: state entity_id: light.guest_bedroom_bedside_lamp_right state: 'on' - condition: state entity_id: input_boolean.room_occupied_guest_bedroom state: 'off' sequence: - service: light.turn_off data: {} target: entity_id: - light.guest_bedroom_bedside_lamp_left - light.guest_bedroom_bedside_lamp_right - conditions: - condition: trigger id: - Motion - condition: or conditions: - condition: template value_template: '{{"Lower" in trigger.to_state.attributes.friendly_name }}' - condition: template value_template: '{{"Upper" in trigger.to_state.attributes.friendly_name }}' alias: Filter Upper or Lower Landing - condition: numeric_state entity_id: sensor.average_light_level_upstairs below: 20 - condition: state entity_id: binary_sensor.lights_out state: 'off' - condition: state entity_id: light.landing_lights state: 'off' - condition: time after: 07:00:00 before: '22:00:00' sequence: - service: light.turn_on data: color_temp: 500 brightness_pct: 15 target: entity_id: light.landing_lights - conditions: - condition: trigger id: - No Motion - condition: or conditions: - condition: template value_template: '{{"Lower" in trigger.to_state.attributes.friendly_name }}' - condition: template value_template: '{{"Upper" in trigger.to_state.attributes.friendly_name }}' alias: 'Filter Upper or Lower Landing ' - condition: state entity_id: light.landing_lights state: 'on' - condition: state entity_id: input_boolean.lower_landing_occupancy state: 'off' sequence: - service: light.turn_off data: {} target: entity_id: light.landing_lights - conditions: - condition: trigger id: - Motion - condition: template value_template: '{{"Daves" in trigger.to_state.attributes.friendly_name }}' alias: Filter Dave's Side of Bed - condition: numeric_state entity_id: sensor.main_bedroom_fp2_light_sensor_light_level below: 20 - condition: state entity_id: binary_sensor.lights_out state: 'off' - condition: state entity_id: input_boolean.main_bedroom_bedside_lamps_active state: 'on' sequence: - service: switch.turn_on data: {} target: entity_id: switch.daddys_bedside_lamp_socket_1 - conditions: - condition: trigger id: - Motion - condition: template value_template: '{{"Gem" in trigger.to_state.attributes.friendly_name }}' alias: Filter Gem's Side of Bed - condition: numeric_state entity_id: sensor.main_bedroom_fp2_light_sensor_light_level below: 20 - condition: state entity_id: binary_sensor.lights_out state: 'off' - condition: state entity_id: input_boolean.main_bedroom_bedside_lamps_active state: 'on' sequence: - service: switch.turn_on data: {} target: entity_id: switch.mummys_bedside_lamp_socket_1 - conditions: - condition: trigger id: - No Motion - condition: template value_template: '{{"Daves" in trigger.to_state.attributes.friendly_name }}' alias: Filter Dave's Side of Bed - condition: state entity_id: switch.daddys_bedside_lamp_socket_1 state: 'on' - condition: state entity_id: input_boolean.dad_s_side_of_bed_occupied state: 'off' sequence: - service: switch.turn_off data: {} target: entity_id: switch.daddys_bedside_lamp_socket_1 - conditions: - condition: trigger id: - No Motion - condition: template value_template: '{{"Gem" in trigger.to_state.attributes.friendly_name }}' alias: Filter Gem's Side of Bed - condition: state entity_id: switch.mummys_bedside_lamp_socket_1 state: 'on' - condition: state entity_id: input_boolean.mum_s_side_of_bed_occupied state: 'off' sequence: - service: switch.turn_off data: {} target: entity_id: switch.mummys_bedside_lamp_socket_1 - conditions: - condition: trigger id: - Dusk - condition: state entity_id: input_boolean.holiday_mode state: 'off' sequence: - if: - condition: state entity_id: switch.corner_lamp_local state: 'off' then: - service: switch.turn_on data: {} target: entity_id: switch.corner_lamp_local - service: light.turn_on data: {} target: entity_id: light.stair_lights - service: switch.turn_on data: {} target: entity_id: switch.under_shelf_lights_local - service: light.turn_on data: {} target: entity_id: light.bed_lamps - if: - condition: state entity_id: switch.standard_lamp_socket_1 state: 'off' then: - service: switch.turn_on data: {} target: entity_id: switch.standard_lamp_socket_1 - if: - condition: state entity_id: switch.living_room_tv state: 'on' then: - service: light.turn_on data: {} target: entity_id: light.dreamview_g1_pro - conditions: - condition: trigger id: - Lights Out sequence: - if: - condition: state entity_id: light.corner_lamp state: 'on' - condition: state entity_id: input_boolean.living_room_occupied state: 'off' then: - service: light.turn_off data: {} target: entity_id: light.corner_lamp - if: - condition: state entity_id: light.standard_lamp state: 'on' - condition: state entity_id: input_boolean.room_occupied_hallway state: 'off' then: - service: light.turn_off data: {} target: entity_id: light.standard_lamp - if: - condition: state entity_id: switch.under_shelf_lights_local state: 'on' - condition: state entity_id: input_boolean.room_occupied_kitchen state: 'off' then: - service: switch.turn_off data: {} target: entity_id: switch.under_shelf_lights_local - if: - condition: state entity_id: light.dreamview_g1_pro state: 'on' - condition: state entity_id: switch.living_room_tv state: 'off' - condition: state entity_id: input_boolean.living_room_occupied state: 'off' then: - service: light.turn_off data: {} target: entity_id: light.dreamview_g1_pro - if: - condition: state entity_id: light.back_door_light state: 'on' - condition: state entity_id: binary_sensor.back_door_sensor_contact state: 'off' - condition: state entity_id: input_boolean.room_occupied_kitchen state: 'off' then: - service: light.turn_off data: {} target: entity_id: light.back_door_light - if: - condition: state entity_id: light.landing_lights state: 'on' - condition: state entity_id: input_boolean.lower_landing_occupancy state: 'off' then: - service: light.turn_off data: {} target: entity_id: light.landing_lights - if: - condition: state entity_id: light.guest_bedroom_bedside_lamp_left state: 'on' - condition: state entity_id: input_boolean.room_occupied_guest_bedroom state: 'on' then: - service: light.turn_off data: {} target: entity_id: - light.guest_bedroom_bedside_lamp_left - light.guest_bedroom_bedside_lamp_right - if: - condition: state entity_id: switch.daddys_bedside_lamp_socket_1 state: 'on' - condition: state entity_id: binary_sensor.main_bedroom_fp2_presence_sensor_2 state: 'on' then: - service: switch.turn_off data: {} target: entity_id: switch.daddys_bedside_lamp_socket_1 - if: - condition: state entity_id: switch.mummys_bedside_lamp_socket_1 state: 'on' - condition: state entity_id: binary_sensor.main_bedroom_fp2_presence_sensor_3 state: 'on' then: - service: switch.turn_off data: {} target: entity_id: - switch.mummys_bedside_lamp_socket_1 - conditions: - condition: trigger id: - Good Light - condition: template value_template: '{{"Living" in trigger.to_state.attributes.friendly_name }}' alias: Filter Living Room - condition: state entity_id: light.corner_lamp state: 'on' - condition: state entity_id: light.standard_lamp state: 'on' sequence: - service: light.turn_off data: {} target: entity_id: - light.corner_lamp - light.standard_lamp - conditions: - condition: trigger id: - Good Light - condition: template value_template: '{{"Main" in trigger.to_state.attributes.friendly_name }}' alias: 'Filter Main Bedroom ' sequence: - if: - condition: state entity_id: switch.daddys_bedside_lamp_socket_1 state: 'on' then: - service: switch.turn_off data: {} target: entity_id: switch.daddys_bedside_lamp_socket_1 alias: If Daddy's Bedside Lamp is on, turn it off - if: - condition: state entity_id: switch.mummys_bedside_lamp_socket_1 state: 'on' then: - service: switch.turn_off data: {} target: entity_id: switch.mummys_bedside_lamp_socket_1 alias: If mummy's Bedside Lamp is on, turn it off - conditions: - condition: trigger id: - Good Light - condition: template value_template: '{{"Upstairs" in trigger.to_state.attributes.friendly_name }}' alias: 'Filter upstairs ' sequence: - if: - condition: state entity_id: light.guest_bedroom_bedside_lamp_left state: 'on' then: - service: light.turn_off data: {} target: entity_id: light.guest_bedroom_bedside_lamp_left alias: If Bedside Lamp Left is on, turn it off - if: - condition: state entity_id: light.guest_bedroom_bedside_lamp_right state: 'on' then: - service: light.turn_off data: {} target: entity_id: - light.guest_bedroom_bedside_lamp_right alias: If Bedside Lamp Right is on, turn it off - conditions: - condition: trigger id: - Good Light - condition: template value_template: '{{"Upstairs" in trigger.to_state.attributes.friendly_name }}' alias: Filter Upstairs - condition: state entity_id: light.landing_lights state: 'on' sequence: - service: light.turn_off data: {} target: entity_id: light.landing_lights - conditions: - condition: trigger id: - Motion - condition: template value_template: '{{"Cloakroom" in trigger.to_state.attributes.friendly_name }}' alias: 'Filter Cloakroom ' - condition: state entity_id: light.cloakroom_light_2 state: 'off' - condition: numeric_state entity_id: sensor.average_light_level_downstairs below: 20 sequence: - service: light.turn_on data: {} target: entity_id: light.cloakroom_light_2 - conditions: - condition: trigger id: - No Motion - condition: template value_template: '{{"Cloakroom" in trigger.to_state.attributes.friendly_name }}' alias: 'Filter Cloakroom ' - condition: state entity_id: light.cloakroom_light_2 state: 'on' sequence: - service: light.turn_off data: {} target: entity_id: light.cloakroom_light_2 - conditions: - condition: trigger id: - Low Light - condition: template value_template: '{{"Living" in trigger.to_state.attributes.friendly_name }}' alias: Filter Living Room - condition: state entity_id: light.corner_lamp state: 'off' sequence: - service: light.turn_on data: {} target: entity_id: - light.corner_lamp - light.standard_lamp mode: restart - alias: All Presence and Occupancy description: Set room presence and room occupancy based on motion and presence. trigger: - platform: state entity_id: - binary_sensor.kitchen_presence_sensor_presence_sensor_1 - binary_sensor.kitchen_presence_sensor_presence_sensor_2 - binary_sensor.presence_sensor_fp2_4b3c_presence_sensor_3 - binary_sensor.presence_sensor_fp2_4b3c_presence_sensor_4 - binary_sensor.dining_room_presence_sensor_occupancy - binary_sensor.living_room_fp2_presence_sensor_1 - binary_sensor.hallway_camera_cell_motion_detection - binary_sensor.lower_landing_motion_occupancy - binary_sensor.seans_room_camera_cell_motion_detection - binary_sensor.jamie_s_room_cam_cell_motion_detection - binary_sensor.guest_bedroom_camera_cell_motion_detection - binary_sensor.guest_bedroom_motion_occupancy - binary_sensor.main_bedroom_fp2_presence_sensor_1 - binary_sensor.main_bedroom_fp2_presence_sensor_4 - binary_sensor.office_presence_sensor_occupancy - binary_sensor.cloakroom_presence_occupancy - binary_sensor.main_bathroom_presence_occupancy - binary_sensor.jack_and_jill_presence_occupancy - binary_sensor.upper_landing_presence_occupancy - binary_sensor.garage_camera_cell_motion_detection_2 from: 'off' to: 'on' id: Motion - platform: state entity_id: - binary_sensor.kitchen_presence_sensor_presence_sensor_1 - binary_sensor.kitchen_presence_sensor_presence_sensor_2 - binary_sensor.presence_sensor_fp2_4b3c_presence_sensor_3 - binary_sensor.presence_sensor_fp2_4b3c_presence_sensor_4 - binary_sensor.dining_room_presence_sensor_occupancy - binary_sensor.living_room_fp2_presence_sensor_1 - binary_sensor.hallway_camera_cell_motion_detection - binary_sensor.lower_landing_motion_occupancy - binary_sensor.seans_room_camera_cell_motion_detection - binary_sensor.jamie_s_room_cam_cell_motion_detection - binary_sensor.guest_bedroom_camera_cell_motion_detection - binary_sensor.guest_bedroom_motion_occupancy - binary_sensor.main_bedroom_fp2_presence_sensor_1 - binary_sensor.main_bedroom_fp2_presence_sensor_4 - binary_sensor.office_presence_sensor_occupancy - binary_sensor.cloakroom_presence_occupancy - binary_sensor.main_bathroom_presence_occupancy - binary_sensor.jack_and_jill_presence_occupancy - binary_sensor.upper_landing_presence_occupancy - binary_sensor.garage_camera_cell_motion_detection_2 from: 'on' to: 'off' id: No Motion - platform: state entity_id: - media_player.kitchen_echo_show - media_player.dave_s_echo_pop - media_player.dave_s_2nd_echo_pop - media_player.living_room_dot - media_player.seans_room_dot - media_player.dave_s_2nd_echo_pop_2 - media_player.guest_bedroom_echo_dot - media_player.main_bedroom_dot attribute: last_called to: 'true' id: Last Called Alexa - platform: state entity_id: - switch.living_room_tv - switch.ingrid_socket_1 - switch.casper_switch_0 from: 'off' to: 'on' id: TV Turned On - platform: state entity_id: - binary_sensor.back_door_sensor_contact - binary_sensor.front_door_sense_contact - binary_sensor.side_door_sensor_contact - binary_sensor.garage_door_left_contact - binary_sensor.garage_door_right_contact id: External Door Open - platform: state entity_id: - binary_sensor.living_room_fp2_presence_sensor_2 - binary_sensor.living_room_fp2_presence_sensor_3 - binary_sensor.living_room_fp2_presence_sensor_4 - binary_sensor.main_bedroom_fp2_presence_sensor_2 - binary_sensor.main_bedroom_fp2_presence_sensor_3 - binary_sensor.living_room_fp2_presence_sensor_5 from: 'off' to: 'on' id: Chair or Bed Occupied - platform: state entity_id: - binary_sensor.living_room_fp2_presence_sensor_2 - binary_sensor.living_room_fp2_presence_sensor_3 - binary_sensor.living_room_fp2_presence_sensor_4 - binary_sensor.main_bedroom_fp2_presence_sensor_2 - binary_sensor.main_bedroom_fp2_presence_sensor_3 - binary_sensor.living_room_fp2_presence_sensor_5 from: 'on' to: 'off' id: Chair or Bed Vacated condition: [] action: - choose: - conditions: - condition: trigger id: - Motion - TV Turned On - Last Called Alexa - condition: template value_template: '{{"Living" in trigger.to_state.attributes.friendly_name }}' alias: Filter Living Room sequence: - service: input_text.set_value data: value: living_room target: entity_id: input_text.room_presence - service: input_boolean.turn_on data: {} target: entity_id: input_boolean.living_room_occupied - conditions: - condition: trigger id: - No Motion - condition: template value_template: '{{"Living" in trigger.to_state.attributes.friendly_name }}' alias: 'Filter Living Room ' - condition: state entity_id: switch.living_room_tv state: 'off' sequence: - service: input_boolean.turn_off data: {} target: entity_id: input_boolean.living_room_occupied - conditions: - condition: trigger id: - Chair or Bed Occupied - condition: template value_template: '{{"Sofa" in trigger.to_state.attributes.friendly_name }}' alias: Filter Sofa sequence: - service: input_text.set_value data: value: living_room_sofa target: entity_id: input_text.room_presence - service: input_boolean.turn_on data: {} target: entity_id: input_boolean.living_room_sofa_occupied - conditions: - condition: trigger id: - Chair or Bed Vacated - condition: template value_template: '{{"Sofa" in trigger.to_state.attributes.friendly_name }}' alias: Filter Sofa sequence: - service: input_boolean.turn_off data: {} target: entity_id: input_boolean.living_room_sofa_occupied - conditions: - condition: trigger id: - Chair or Bed Occupied - condition: template value_template: '{{"Recliner" in trigger.to_state.attributes.friendly_name }}' alias: Filter Recliner sequence: - service: input_text.set_value data: value: living_room_recliner target: entity_id: input_text.room_presence - service: input_boolean.turn_on data: {} target: entity_id: input_boolean.recliner_sofa_occupied - conditions: - condition: trigger id: - Chair or Bed Vacated - condition: template value_template: '{{"Recliner" in trigger.to_state.attributes.friendly_name }}' alias: Filter Recliner sequence: - service: input_boolean.turn_off data: {} target: entity_id: input_boolean.recliner_sofa_occupied - conditions: - condition: trigger id: - Chair or Bed Occupied - condition: template value_template: '{{"Corner" in trigger.to_state.attributes.friendly_name }}' alias: 'Filter Corner Chair ' sequence: - service: input_text.set_value data: value: living_room_corner_chair target: entity_id: input_text.room_presence - service: input_boolean.turn_on data: {} target: entity_id: input_boolean.living_room_corner_chair_occupied - conditions: - condition: trigger id: - Chair or Bed Vacated - condition: template value_template: '{{"Corner" in trigger.to_state.attributes.friendly_name }}' alias: Filter Corner Chair sequence: - service: input_boolean.turn_off data: {} target: entity_id: input_boolean.living_room_corner_chair_occupied - conditions: - condition: trigger id: - Chair or Bed Occupied - condition: template value_template: '{{"Desk" in trigger.to_state.attributes.friendly_name }}' alias: Filter Desk sequence: - service: input_text.set_value data: value: living_room_desk target: entity_id: input_text.room_presence - service: input_boolean.turn_on data: {} target: entity_id: input_boolean.living_room_desk_occupied - conditions: - condition: trigger id: - Chair or Bed Vacated - condition: template value_template: '{{"Desk" in trigger.to_state.attributes.friendly_name }}' alias: Filter Desk sequence: - service: input_boolean.turn_off data: {} target: entity_id: input_boolean.living_room_desk_occupied - conditions: - condition: trigger id: - Motion - Last Called Alexa - TV Turned On - condition: or conditions: - condition: template value_template: '{{"Ingrid" in trigger.to_state.attributes.friendly_name}}' alias: Filter Ingrid - condition: template value_template: '{{"Kitchen" in trigger.to_state.attributes.friendly_name }}' alias: Filter Kitchen sequence: - service: input_text.set_value data: value: kitchen target: entity_id: input_text.room_presence - service: input_boolean.turn_on data: {} target: entity_id: input_boolean.room_occupied_kitchen - conditions: - condition: trigger id: - No Motion - condition: template value_template: '{{"Kitchen" in trigger.to_state.attributes.friendly_name }}' alias: Filter Kitchen - condition: state entity_id: switch.ingrid_socket_1 state: 'off' sequence: - service: input_boolean.turn_off data: {} target: entity_id: input_boolean.room_occupied_kitchen - conditions: - condition: trigger id: - Motion - Last Called Alexa - condition: template value_template: '{{"Dining" in trigger.to_state.attributes.friendly_name }}' alias: Filter Dining Room sequence: - service: input_text.set_value data: value: dining_room target: entity_id: input_text.room_presence - service: input_boolean.turn_on data: {} target: entity_id: input_boolean.room_occupied_dining_room - conditions: - condition: trigger id: - No Motion - condition: template value_template: '{{"Dining" in trigger.to_state.attributes.friendly_name }}' alias: Filter Dining Room sequence: - service: input_boolean.turn_off data: {} target: entity_id: input_boolean.room_occupied_dining_room - conditions: - condition: trigger id: - Motion - condition: template value_template: '{{"Hallway" in trigger.to_state.attributes.friendly_name }}' alias: Filter Hallway sequence: - service: input_text.set_value data: value: hallway target: entity_id: input_text.room_presence - service: input_boolean.turn_on data: {} target: entity_id: input_boolean.room_occupied_hallway - conditions: - condition: trigger id: - No Motion - condition: template value_template: '{{"Hallway" in trigger.to_state.attributes.friendly_name }}' alias: Filter Hallway sequence: - service: input_boolean.turn_off data: {} target: entity_id: input_boolean.room_occupied_hallway - conditions: - condition: trigger id: - Motion - condition: template value_template: '{{"Lower" in trigger.to_state.attributes.friendly_name }}' alias: Filter Lower Landing sequence: - service: input_text.set_value data: value: lower_landing target: entity_id: input_text.room_presence - service: input_boolean.turn_on data: {} target: entity_id: input_boolean.lower_landing_occupancy - conditions: - condition: trigger id: - No Motion - condition: template value_template: '{{"Lower" in trigger.to_state.attributes.friendly_name }}' alias: Filter Lower Landing sequence: - service: input_boolean.turn_off data: {} target: entity_id: input_boolean.lower_landing_occupancy - conditions: - condition: trigger id: - Motion - Last Called Alexa - condition: template value_template: '{{"Main" in trigger.to_state.attributes.friendly_name }}' alias: Filter Main Bedroom sequence: - service: input_text.set_value data: value: main_bedroom target: entity_id: input_text.room_presence - service: input_boolean.turn_on data: {} target: entity_id: input_boolean.room_occupied_main_bedroom - conditions: - condition: trigger id: - No Motion - condition: template value_template: '{{"Main" in trigger.to_state.attributes.friendly_name }}' alias: Filter Main Bedroom sequence: - service: input_boolean.turn_off data: {} target: entity_id: input_boolean.room_occupied_main_bedroom - conditions: - condition: trigger id: - Chair or Bed Occupied - condition: template value_template: '{{"Daves" in trigger.to_state.attributes.friendly_name }}' alias: Filter Dad's Side of Bed sequence: - service: input_text.set_value data: value: dads_side_of_bed target: entity_id: input_text.room_presence - service: input_boolean.turn_on data: {} target: entity_id: input_boolean.dad_s_side_of_bed_occupied - conditions: - condition: trigger id: - Chair or Bed Vacated - condition: template value_template: '{{"Daves" in trigger.to_state.attributes.friendly_name }}' alias: Filter Dad's Side of Bed sequence: - service: input_boolean.turn_off data: {} target: entity_id: input_boolean.dad_s_side_of_bed_occupied - conditions: - condition: trigger id: - Chair or Bed Occupied - condition: template value_template: '{{"Gem" in trigger.to_state.attributes.friendly_name }}' alias: Filter Gem's Side of Bed sequence: - service: input_text.set_value data: value: mums_side_of_bed target: entity_id: input_text.room_presence - service: input_boolean.turn_on data: {} target: entity_id: input_boolean.mum_s_side_of_bed_occupied - conditions: - condition: trigger id: - Chair or Bed Vacated - condition: template value_template: '{{"Gem" in trigger.to_state.attributes.friendly_name }}' alias: Filter Gem's Side of Bed sequence: - service: input_boolean.turn_off data: {} target: entity_id: input_boolean.mum_s_side_of_bed_occupied - conditions: - condition: trigger id: - Motion - condition: template value_template: '{{"Suite" in trigger.to_state.attributes.friendly_name }}' alias: Filter En-Suite Bathroom sequence: - service: input_text.set_value data: value: en_suite target: entity_id: input_text.room_presence - service: input_boolean.turn_on data: {} target: entity_id: input_boolean.room_occupied_en_suite_bathroom - conditions: - condition: trigger id: - No Motion - condition: template value_template: '{{"Suite" in trigger.to_state.attributes.friendly_name }}' alias: Filter En-Suite Bathroom sequence: - service: input_boolean.turn_off data: {} target: entity_id: input_boolean.room_occupied_en_suite_bathroom - conditions: - condition: trigger id: - Motion - Last Called Alexa - condition: template value_template: '{{"Jamie" in trigger.to_state.attributes.friendly_name }}' alias: Filter Jamie's Room sequence: - service: input_text.set_value data: value: jamies_room target: entity_id: input_text.room_presence - service: input_boolean.turn_on data: {} target: entity_id: input_boolean.room_occupied_jamie_s_room - conditions: - condition: trigger id: - No Motion - condition: template value_template: '{{"Jamie" in trigger.to_state.attributes.friendly_name }}' alias: Filter Jamie's Room sequence: - service: input_boolean.turn_off data: {} target: entity_id: input_boolean.room_occupied_jamie_s_room - conditions: - condition: trigger id: - Motion - Last Called Alexa - condition: template value_template: '{{"Sean" in trigger.to_state.attributes.friendly_name }}' alias: Filter Sean's Room sequence: - service: input_text.set_value data: value: seans_room target: entity_id: input_text.room_presence - service: input_boolean.turn_on data: {} target: entity_id: input_boolean.room_occupied_sean_s_room - conditions: - condition: trigger id: - No Motion - condition: template value_template: '{{"Sean" in trigger.to_state.attributes.friendly_name }}' alias: Filter Sean's Room sequence: - service: input_boolean.turn_off data: {} target: entity_id: input_boolean.room_occupied_sean_s_room - conditions: - condition: trigger id: - Motion - Last Called Alexa - condition: template value_template: '{{"Guest" in trigger.to_state.attributes.friendly_name }}' alias: Filter Guest Bedroom sequence: - service: input_text.set_value data: value: guest_bedroom target: entity_id: input_text.room_presence - service: input_boolean.turn_on data: {} target: entity_id: input_boolean.room_occupied_guest_bedroom - conditions: - condition: trigger id: - No Motion - condition: template value_template: '{{"Guest" in trigger.to_state.attributes.friendly_name }}' alias: Filter Guest Bedroom sequence: - service: input_boolean.turn_off data: {} target: entity_id: input_boolean.room_occupied_guest_bedroom - conditions: - condition: trigger id: - Motion - Last Called Alexa - condition: template value_template: '{{"Office" in trigger.to_state.attributes.friendly_name }}' alias: Filter Office sequence: - service: input_text.set_value data: value: office target: entity_id: input_text.room_presence - service: input_boolean.turn_on data: {} target: entity_id: input_boolean.room_occupied_office - conditions: - condition: trigger id: - No Motion - condition: template value_template: '{{"Office" in trigger.to_state.attributes.friendly_name }}' alias: Filter Office sequence: - service: input_boolean.turn_off data: {} target: entity_id: input_boolean.room_occupied_office - conditions: - condition: trigger id: - Motion - condition: template value_template: '{{"Garage" in trigger.to_state.attributes.friendly_name }}' alias: Filter Garage sequence: - service: input_text.set_value data: value: garage target: entity_id: input_text.room_presence - service: input_boolean.turn_on data: {} target: entity_id: input_boolean.room_occupied_garage - conditions: - condition: trigger id: - No Motion - condition: template value_template: '{{"Garage" in trigger.to_state.attributes.friendly_name }}' alias: Filter Garage sequence: - service: input_boolean.turn_off data: {} target: entity_id: input_boolean.room_occupied_garage - conditions: - condition: trigger id: - Motion - condition: template value_template: '{{"Cloakroom" in trigger.to_state.attributes.friendly_name }}' alias: 'Filter Cloakroom ' sequence: - service: input_text.set_value data: value: cloakroom target: entity_id: input_text.room_presence - service: input_boolean.turn_on data: {} target: entity_id: input_boolean.room_occupied_cloakroom - conditions: - condition: trigger id: - No Motion - condition: template value_template: '{{"Cloakroom" in trigger.to_state.attributes.friendly_name }}' alias: Filter Cloakroom sequence: - service: input_boolean.turn_off data: {} target: entity_id: input_boolean.room_occupied_cloakroom - conditions: - condition: trigger id: - Motion - condition: template value_template: '{{"Bathroom" in trigger.to_state.attributes.friendly_name}}' alias: Filter Bathroom sequence: - service: input_text.set_value data: value: bathroom target: entity_id: input_text.room_presence - service: input_boolean.turn_on data: {} target: entity_id: - input_boolean.room_occupied_main_bathroom - conditions: - condition: trigger id: - No Motion - condition: template value_template: '{{"Bathroom" in trigger.to_state.attributes.friendly_name}}' alias: Filter Main Bathroom sequence: - service: input_boolean.turn_off data: {} target: entity_id: input_boolean.room_occupied_main_bathroom - conditions: - condition: trigger id: - Motion - condition: template value_template: '{{"Upper" in trigger.to_state.attributes.friendly_name }}' alias: Filter Upper Landing sequence: - service: input_text.set_value data: value: upper_landing target: entity_id: input_text.room_presence - service: input_boolean.turn_on data: {} target: entity_id: input_boolean.upper_landing_occupied - conditions: - condition: trigger id: - No Motion - condition: template value_template: '{{"Upper" in trigger.to_state.attributes.friendly_name }}' sequence: - service: input_boolean.turn_off data: {} target: entity_id: input_boolean.upper_landing_occupied - conditions: - condition: trigger id: - Motion - condition: template value_template: '{{"Jack" in trigger.to_state.attributes.friendly_name }}' alias: Filter Kids Bathroom sequence: - service: input_text.set_value data: value: kids_bathroom target: entity_id: input_text.room_presence - service: input_boolean.turn_on data: {} target: entity_id: input_boolean.room_occupied_jack_jill - conditions: - condition: trigger id: - No Motion - condition: template value_template: '{{"Jack" in trigger.to_state.attributes.friendly_name }}' sequence: - service: input_boolean.turn_off data: {} target: entity_id: input_boolean.room_occupied_jack_jill - conditions: - condition: trigger id: - Motion - alias: Filter Kitchen Table condition: template value_template: '{{"Dinner" in trigger.to_state.attributes.friendly_name }}' sequence: - service: input_text.set_value data: value: kitchen_table target: entity_id: input_text.room_presence - service: input_boolean.turn_on data: {} target: entity_id: input_boolean.kitchen_table_occupied - conditions: - condition: trigger id: - No Motion - condition: template value_template: '{{"Dinner" in trigger.to_state.attributes.friendly_name }}' alias: Filter Kitchen Table sequence: - service: input_boolean.turn_off data: {} target: entity_id: input_boolean.kitchen_table_occupied - conditions: - condition: trigger id: - Motion - condition: template value_template: '{{"Back" in trigger.to_state.attributes.friendly_name }}' alias: Filter Back Door Zone sequence: - service: input_text.set_value data: value: back_door_zone target: entity_id: input_text.room_presence - service: input_boolean.turn_on data: {} target: entity_id: input_boolean.back_door_zone_occupied - conditions: - condition: trigger id: - No Motion - condition: template value_template: '{{"Back" in trigger.to_state.attributes.friendly_name }}' sequence: - service: input_boolean.turn_off data: {} target: entity_id: input_boolean.back_door_zone_occupied - conditions: - condition: trigger id: - Motion - condition: template value_template: '{{"Utility" in trigger.to_state.attributes.friendly_name }}' alias: Filter Utility Room sequence: - service: input_text.set_value data: value: utility_room target: entity_id: input_text.room_presence - service: input_boolean.turn_on data: {} target: entity_id: input_boolean.utility_room_occupied - conditions: - condition: trigger id: - No Motion - condition: template value_template: '{{"Utility" in trigger.to_state.attributes.friendly_name }}' sequence: - service: input_boolean.turn_off data: {} target: entity_id: input_boolean.utility_room_occupied mode: restart - alias: All Tablet Automations description: '' triggers: - entity_id: sensor.sm_t736b_battery_state to: full id: Daves tablet charged trigger: state - entity_id: sensor.sm_t736b_battery_state to: charging id: Daves tablet charging trigger: state - entity_id: sensor.jamie_s_samsung_tablet_network_type id: Jamie Network Type trigger: state - entity_id: sensor.jamie_s_samsung_tablet_battery_level below: 10 id: Jamie Low Battery trigger: numeric_state - entity_id: sensor.jamie_s_samsung_tablet_battery_level above: 99 id: Jamie Fully Charged trigger: numeric_state - entity_id: sensor.sean_s_samsung_galaxy_network_type id: Sean Network Type trigger: state - entity_id: sensor.sean_s_samsung_galaxy_battery_level below: 10 id: Sean Low Battery trigger: numeric_state - entity_id: sensor.sean_s_samsung_galaxy_battery_level above: 99 id: Sean Fully Charged trigger: numeric_state conditions: [] actions: - choose: - conditions: - condition: trigger id: Daves tablet charged sequence: - action: script.text_notify_dave data: title: TABLET CHARGED message: Your tablet is charged. - conditions: - condition: trigger id: Jamie Network Type - condition: state entity_id: person.jamie state: home sequence: - action: script.text_notify_dave data: title: JAMIE TABLET message: Jamie's tablet has changed network. - conditions: - condition: trigger id: Jamie Low Battery sequence: - action: script.text_notify_dave data: title: JAMIE TABLET message: Jamie's tablet needs charged. - conditions: - condition: trigger id: Jamie Fully Charged sequence: - action: script.text_notify_dave data: title: JAMIE TABLET message: Jamie's tablet is charged. - conditions: - condition: trigger id: Sean Network Type - condition: state entity_id: person.sean state: home sequence: - action: script.text_notify_dave data: title: SEAN TABLET message: Sean's tablet has changed network. - conditions: - condition: trigger id: Sean Low Battery sequence: - action: script.text_notify_dave data: title: SEAN TABLET message: Sean's tablet needs charged. - conditions: - condition: trigger id: Sean Fully Charged sequence: - action: script.text_notify_dave data: title: SEAN TABLET message: Sean's tablet is charged. mode: single initial_state: true - alias: All Tablet Automations V2.0 triggers: - entity_id: sensor.sm_t736b_battery_state to: full id: dave_charged trigger: state - entity_id: sensor.sm_t736b_battery_state to: charging id: dave_charging trigger: state - entity_id: sensor.jamie_s_samsung_tablet_network_type id: jamie_network trigger: state - entity_id: sensor.jamie_s_samsung_tablet_battery_level below: 10 id: jamie_low_battery trigger: numeric_state - entity_id: sensor.jamie_s_samsung_tablet_battery_level above: 99 id: jamie_charged trigger: numeric_state - entity_id: sensor.sean_s_samsung_galaxy_network_type id: sean_network trigger: state - entity_id: sensor.sean_s_samsung_galaxy_battery_level below: 10 id: sean_low_battery trigger: numeric_state - entity_id: sensor.sean_s_samsung_galaxy_battery_level above: 99 id: sean_charged trigger: numeric_state - entity_id: sensor.jamie_s_samsung_tablet_battery_state to: charging id: jamie_now_charging trigger: state - entity_id: sensor.sean_s_samsung_galaxy_battery_state to: charging id: sean_now_charging trigger: state conditions: - condition: or conditions: - condition: not conditions: - condition: template value_template: '{{ trigger.id in [''jamie_network'', ''sean_network''] }}' - condition: and conditions: - condition: template value_template: '{{ trigger.id == ''jamie_network'' }}' - condition: state entity_id: person.jamie state: home - condition: and conditions: - condition: template value_template: '{{ trigger.id == ''sean_network'' }}' - condition: state entity_id: person.sean state: home actions: - choose: - conditions: - condition: template value_template: '{{ trigger.id in [''jamie_now_charging'', ''sean_now_charging''] }}' sequence: - data: notification_id: "{% if trigger.id == 'jamie_now_charging' %}\n jamie_tablet_still_not_charging\n\ {% elif trigger.id == 'sean_now_charging' %}\n sean_tablet_still_not_charging\n\ {% endif %}\n" action: persistent_notification.dismiss - data: title: '{% if trigger.id == ''dave_charged'' %}TABLET CHARGED {% elif trigger.id.startswith(''jamie'') %}JAMIE TABLET {% elif trigger.id.startswith(''sean'') %}SEAN TABLET {% else %}TABLET STATUS{% endif %} ' message: "{% if trigger.id == 'dave_charged' %}\n Your tablet is charged.\n\ {% elif trigger.id == 'jamie_network' %}\n Jamie's tablet has changed network.\n\ {% elif trigger.id == 'jamie_low_battery' %}\n Jamie's tablet needs charged.\n\ {% elif trigger.id == 'jamie_charged' %}\n Jamie's tablet is charged.\n{%\ \ elif trigger.id == 'sean_network' %}\n Sean's tablet has changed network.\n\ {% elif trigger.id == 'sean_low_battery' %}\n Sean's tablet needs charged.\n\ {% elif trigger.id == 'sean_charged' %}\n Sean's tablet is charged.\n{% elif\ \ trigger.id == 'jamie_now_charging' %}\n Jamie's tablet has started charging.\n\ {% elif trigger.id == 'sean_now_charging' %}\n Sean's tablet has started\ \ charging.\n{% else %}Tablet status changed.{% endif %}\n" action: script.text_notify_dave - if: - condition: template value_template: '{{ trigger.id == ''jamie_low_battery'' }}' then: - delay: 00:10:00 - condition: state entity_id: binary_sensor.jamie_s_samsung_tablet_is_charging state: 'off' - data: title: Jamie's Tablet Still Not Charging message: Jamie's tablet is still below 10% and hasn't been plugged in after 10 minutes. notification_id: jamie_tablet_still_not_charging action: persistent_notification.create alias: Notify if Jamie's tablet is still not charging after 10 minutes - if: - condition: template value_template: '{{ trigger.id == ''sean_low_battery'' }}' then: - delay: 00:10:00 - condition: state entity_id: binary_sensor.sean_s_samsung_galaxy_is_charging state: 'off' - data: title: Sean's Tablet Still Not Charging message: Sean's tablet is still below 10% and hasn't been plugged in after 10 minutes. notification_id: sean_tablet_still_not_charging action: persistent_notification.create alias: Notify if Sean's tablet is still not charging after 10 minutes mode: single initial_state: true - input_datetime: workday_wakeup_time: name: Workday Wakeup Time has_date: false has_time: true wakeup: name: Wakeup Time has_date: false has_time: true morning_report: name: Morning Report has_date: false has_time: true morning_report_earliest_time: name: Morning Report Earliest Time has_date: false has_time: true morning_report_latest_time: name: Morning Report Latest Time has_date: false has_time: true nightly_report: name: Nightly Report has_date: false has_time: true daily_report: name: Daily Report has_date: false has_time: true seans_morning_briefing: name: Seans Morning Briefing has_date: false has_time: true get_ready_for_schools_out: name: Get Ready For Schools Out has_date: false has_time: true input_boolean: seans_morning_briefing_played: name: Seans Morning Briefing Played sean_dressed_first: name: Sean Dressed First announcement_playing: name: Announcement Playing icon: mdi:bullhorn - alias: Audible Notifications description: '' trigger: - platform: time at: input_datetime.audible_notification_on id: 'on' - platform: time at: input_datetime.audible_notification_off id: 'off' condition: [] action: - choose: - conditions: - condition: trigger id: 'on' - condition: state entity_id: binary_sensor.family_home state: 'on' sequence: - data: {} target: entity_id: input_boolean.audible_notifications action: input_boolean.turn_on - conditions: - condition: trigger id: 'off' - condition: state entity_id: input_boolean.audible_notifications state: 'on' sequence: - data: {} target: entity_id: input_boolean.audible_notifications action: input_boolean.turn_off default: [] mode: single - id: a3739bb0-632d-4526-bf82-ee4e27b80882 alias: Set Room With Alexa Presence mode: restart trigger: - platform: state entity_id: sensor.room_audio action: - action: input_text.set_value data: entity_id: input_text.room_with_alexa_presence value: '{{ states(''sensor.room_audio'') }}' - action: mqtt.publish data: topic: house/presence/current_room payload: '{{ states(''sensor.room_audio'') }}' retain: true - action: mqtt.publish data: topic: house/presence/backup_room payload: '{{ states(''input_text.room_presence'') }}' retain: true - id: 28c0e7a6-4024-48c9-a422-8b8ffc3a86d1 alias: Set Last Alexa Called Time initial_state: true trigger: - platform: state entity_id: - media_player.kitchen_echo_show - media_player.living_room_pop - media_player.dining_room_pop - media_player.main_bedroom_dot - media_player.guest_bedroom_echo_dot - media_player.office_pop - media_player.jamie_s_room_dot - media_player.sean_s_room_dot condition: - condition: template value_template: '{{ trigger.to_state.attributes.last_called_timestamp | float > trigger.from_state.attributes.last_called_timestamp | float }}' action: - action: input_datetime.set_datetime target: entity_id: input_datetime.last_time_alexa_called data: datetime: '{{ now().strftime(''%Y-%m-%d %H:%M:%S'') }}' - alias: Aura Lamp description: '' triggers: - event: sunset id: Sunset trigger: sun enabled: true - event: sunrise id: Sunrise trigger: sun enabled: true - trigger: state entity_id: - binary_sensor.morning id: Morning to: 'on' from: 'off' - trigger: state entity_id: - binary_sensor.lunchtime id: Lunchtime from: 'off' to: 'on' - trigger: state entity_id: - binary_sensor.afternoon id: Afternoon from: 'off' to: 'on' - trigger: state entity_id: - binary_sensor.dinner_time id: Dinnertime from: 'off' to: 'on' - trigger: state entity_id: - binary_sensor.evening id: Evening from: 'off' to: 'on' conditions: [] actions: - choose: - conditions: - condition: trigger id: - Sunrise sequence: - action: light.turn_on target: entity_id: light.kitchen_aura_lamp_2 data: effect: Sunrise - delay: hours: 0 minutes: 30 seconds: 0 milliseconds: 0 - if: - condition: state entity_id: input_boolean.washing_machine_finished state: 'on' then: - action: light.turn_on target: entity_id: light.kitchen_aura_lamp_2 data: rgb_color: - 255 - 0 - 0 brightness_pct: 1 else: - if: - condition: state entity_id: input_boolean.garage_dehumidifier_full state: 'on' then: - action: light.turn_on target: entity_id: light.kitchen_aura_lamp_2 data: rgb_color: - 133 - 255 - 255 brightness_pct: 1 else: - action: light.turn_on target: entity_id: light.kitchen_aura_lamp_2 data: effect: Morning - conditions: - condition: trigger id: - Sunset sequence: - action: light.turn_on target: entity_id: light.kitchen_aura_lamp_2 data: effect: Sunset - delay: hours: 0 minutes: 30 seconds: 0 milliseconds: 0 - if: - condition: state entity_id: binary_sensor.afternoon state: 'on' then: - action: light.turn_on target: entity_id: light.kitchen_aura_lamp_2 data: effect: Forest else: - if: - condition: state entity_id: binary_sensor.dinner_time state: 'on' then: - action: light.turn_on target: entity_id: light.kitchen_aura_lamp_2 data: effect: Eating Dots else: - action: light.turn_on target: entity_id: light.kitchen_aura_lamp_2 data: effect: Firefly - conditions: - condition: trigger id: - Morning sequence: - action: light.turn_on target: entity_id: light.kitchen_aura_lamp_2 data: effect: Morning - conditions: - condition: trigger id: - Lunchtime sequence: - action: light.turn_on target: entity_id: light.kitchen_aura_lamp_2 data: effect: Falling Petals - conditions: - condition: trigger id: - Afternoon sequence: - action: light.turn_on target: entity_id: light.kitchen_aura_lamp_2 data: effect: Forest - conditions: - condition: trigger id: - Dinnertime sequence: - action: light.turn_on target: entity_id: light.kitchen_aura_lamp_2 data: effect: Eating Dots - conditions: - condition: trigger id: - Evening sequence: - action: light.turn_on target: entity_id: light.kitchen_aura_lamp_2 data: effect: Firefly mode: parallel initial_state: true - alias: Aurora Alert description: '' triggers: - entity_id: - sensor.aurora_aurora_visibility_visibility above: 10 id: aurora on trigger: numeric_state - entity_id: - sensor.aurora_aurora_visibility_visibility below: 5 id: aurora off trigger: numeric_state conditions: [] actions: - choose: - conditions: - condition: trigger id: aurora on sequence: - action: script.text_notify_parents metadata: {} data: title: AURORA ALERT - HIGHLY PROBABLE message: There may be a visible aurora tonight - condition: state entity_id: input_boolean.audible_notifications state: 'on' - if: - condition: state entity_id: binary_sensor.dave_home state: 'on' then: - action: script.jarvis_speech_engine_v3_0 data: where: dave message: Sorry to interrupt, but there is a good chance of seeing the Northern Lights tonight. else: - action: script.jarvis_speech_engine_v3_0 data: where: gem message: Sorry to interrupt, but there is a good chance of seeing the Northern Lights tonight. alias: Announce if Dave or Gem is home. - conditions: - condition: trigger id: aurora off sequence: - action: script.text_notify_parents metadata: {} data: title: AURORA ALERT - ALERT OVER message: That will be that for the Northern Lights then. - condition: state entity_id: input_boolean.audible_notifications state: 'on' - if: - condition: state entity_id: binary_sensor.dave_home state: 'on' then: - action: script.jarvis_speech_engine_v3_0 data: where: dave message: Sorry to interrupt, but there is a good chance you missed the Northern Lights tonight. else: - action: script.jarvis_speech_engine_v3_0 data: where: gem message: Sorry to interrupt, but there is a good chance you missed the Northern Lights tonight. alias: Announce if Dave or Gem is home. mode: single - alias: 'ESPHome: Update all ESPHome devices' description: '' triggers: - trigger: template value_template: '{{ integration_entities(''esphome'') | select(''match'',''^update.'') | select(''is_state'',''on'') | list | count > 0 }}' alias: When an ESPHome update is available conditions: [] actions: - action: script.esphome_update_all_esphome_devices metadata: {} data: {} mode: single - alias: Automations Control Automation description: Turn on automations and activation toggles when needed trigger: - platform: time at: '15:30:00' id: Enable - platform: time at: '19:30:00' id: Disable - platform: state entity_id: - input_boolean.kids_bedtime_announcement_played - input_boolean.school_morning_announcement_played - input_boolean.school_pick_up_announcement_played - input_boolean.morning_briefing_played from: 'off' to: 'on' id: Toggle On condition: [] action: - choose: - conditions: - condition: trigger id: - Enable sequence: - service: automation.turn_on data: {} target: entity_id: automation.get_desired_battery_discharge - service: automation.turn_on data: {} target: entity_id: automation.discharge_battery_to_desired - conditions: - condition: trigger id: - Disable sequence: - service: automation.turn_off data: stop_actions: true target: entity_id: automation.get_desired_battery_discharge - service: automation.turn_off data: stop_actions: true target: entity_id: automation.discharge_battery_to_desired - conditions: - condition: trigger id: - Toggle On - condition: template value_template: '{{"Bedtime" in trigger.to_state.attributes.friendly_name}}' alias: Filter Bedtime Announcement sequence: - if: - condition: or conditions: - condition: state entity_id: switch.daddys_bedside_lamp_socket_1 state: 'on' - condition: state entity_id: switch.mummys_bedside_lamp_socket_1 state: 'on' then: - service: switch.turn_off data: {} target: entity_id: - switch.mummys_bedside_lamp_socket_1 - switch.daddys_bedside_lamp_socket_1 alias: Turn off the lamps if they are on. - service: input_boolean.turn_off data: {} target: entity_id: input_boolean.main_bedroom_bedside_lamps_active mode: single - alias: Automations That Run When HA Starts or When Groups Reload description: '' mode: single triggers: - event: start id: HA Start trigger: homeassistant - entity_id: - group.kitchen_occupancy to: unknown id: Group Reset trigger: state conditions: [] actions: - action: script.update_critical_battery_group_2 data: {} - delay: hours: 0 minutes: 1 seconds: 0 milliseconds: 0 - action: script.update_rechargeable_battery_group data: {} - delay: hours: 0 minutes: 1 seconds: 0 milliseconds: 0 - action: script.update_srv_critical_battery_group data: {} - delay: hours: 0 minutes: 1 seconds: 0 milliseconds: 0 - action: script.update_occupancy_groups data: {} - alias: Guest Bedroom Lights with presence description: '' trigger: - platform: state entity_id: - binary_sensor.guest_bedroom_motion_occupancy from: 'off' to: 'on' id: Light on - platform: state entity_id: - binary_sensor.guest_bedroom_motion_occupancy from: 'on' to: 'off' id: Light off for: hours: 0 minutes: 1 seconds: 0 - platform: numeric_state entity_id: sensor.upstairs_light_level below: 20 id: Low Light - platform: numeric_state entity_id: sensor.upstairs_light_level id: Good Light above: 80 condition: - condition: state entity_id: input_boolean.guest_bedroom_bedside_lamps_active state: 'on' - condition: state entity_id: input_boolean.holiday_mode state: 'off' - condition: state entity_id: binary_sensor.lights_out state: 'off' action: - choose: - conditions: - condition: trigger id: Light on - condition: state entity_id: binary_sensor.lights_out state: 'off' - condition: numeric_state entity_id: sensor.average_light_level_upstairs below: 20 sequence: - service: light.turn_on data: color_temp: 500 brightness_pct: 5 target: entity_id: light.guest_bedroom_bedside_lamp_left - service: light.turn_on data: color_temp: 500 brightness_pct: 5 target: entity_id: - light.guest_bedroom_bedside_lamp_right - conditions: - condition: trigger id: Light off - condition: state entity_id: light.guest_bedroom_bedside_lamp_left state: 'on' - condition: state entity_id: light.guest_bedroom_bedside_lamp_right state: 'on' sequence: - service: light.turn_off data: {} target: entity_id: - light.guest_bedroom_bedside_lamp_left - light.guest_bedroom_bedside_lamp_right - conditions: - condition: trigger id: - Low Light - condition: and conditions: - condition: state entity_id: light.guest_bedroom_bedside_lamp_left state: 'off' - condition: state entity_id: light.guest_bedroom_bedside_lamp_right state: 'off' - condition: state entity_id: input_boolean.room_occupied_guest_bedroom state: 'on' sequence: - service: light.turn_on data: color_temp: 500 brightness_pct: 50 target: entity_id: - light.guest_bedroom_bedside_lamp_left - light.guest_bedroom_bedside_lamp_right - conditions: - condition: trigger id: - Good Light - condition: state entity_id: input_boolean.room_occupied_guest_bedroom state: 'on' - condition: and conditions: - condition: state entity_id: light.guest_bedroom_bedside_lamp_left state: 'on' - condition: state entity_id: light.guest_bedroom_bedside_lamp_right state: 'on' sequence: - service: light.turn_off data: {} target: entity_id: - light.guest_bedroom_bedside_lamp_left - light.guest_bedroom_bedside_lamp_right mode: restart - id: kitchen_lights_with_presence alias: Kitchen Lights with Presence description: '' trigger: - platform: state entity_id: - binary_sensor.kitchen_presence_sensor_presence_sensor_1 from: 'off' to: 'on' id: Lights On - platform: state entity_id: - binary_sensor.kitchen_presence_sensor_presence_sensor_1 from: 'on' to: 'off' id: Lights Off for: hours: 0 minutes: 0 seconds: 30 - platform: state entity_id: - binary_sensor.presence_sensor_fp2_4b3c_presence_sensor_3 from: 'off' to: 'on' id: BDZ On - platform: state entity_id: - binary_sensor.presence_sensor_fp2_4b3c_presence_sensor_3 from: 'on' to: 'off' for: hours: 0 minutes: 0 seconds: 30 id: BDZ Off - platform: state entity_id: - binary_sensor.back_door_sensor_contact from: 'off' to: 'on' id: Back Door Entry - platform: state entity_id: - binary_sensor.presence_sensor_fp2_4b3c_presence_sensor_4 from: 'off' to: 'on' id: Utility On - platform: state entity_id: - binary_sensor.presence_sensor_fp2_4b3c_presence_sensor_4 from: 'on' to: 'off' id: Utility Off for: hours: 0 minutes: 0 seconds: 30 - platform: numeric_state entity_id: sensor.kitchen_presence_sensor_light_sensor_light_level below: input_number.low_light_threshold id: Low Light - platform: numeric_state entity_id: sensor.kitchen_presence_sensor_light_sensor_light_level above: input_number.upper_light_threshold_level id: Good Light - platform: state entity_id: - binary_sensor.lunchtime from: 'off' to: 'on' id: Lunchtime starts - platform: state entity_id: - binary_sensor.lunchtime id: lunchtime ends from: 'on' to: 'off' - platform: state entity_id: - binary_sensor.dinner_time from: 'off' to: 'on' id: Dinner Time Starts - platform: state entity_id: - binary_sensor.dinner_time from: 'on' to: 'off' id: Dinner Time Ends - platform: state entity_id: - binary_sensor.lights_out to: 'off' id: Allow Lights on condition: - condition: state entity_id: input_boolean.holiday_mode state: 'off' action: - choose: - conditions: - condition: trigger id: - Lights On - condition: state entity_id: binary_sensor.overnight state: 'on' sequence: - service: light.turn_on data: rgb_color: - 255 - 254 - 223 brightness: 10 target: entity_id: light.kitchen_lights_2 - conditions: - condition: trigger id: - Lights On - condition: or conditions: - condition: state entity_id: binary_sensor.morning state: 'on' - condition: state entity_id: binary_sensor.afternoon state: 'on' - condition: state entity_id: binary_sensor.evening state: 'on' - condition: numeric_state entity_id: sensor.kitchen_presence_sensor_light_sensor_light_level below: input_number.low_light_threshold sequence: - service: light.turn_on data: color_temp: 367 brightness: 28 target: entity_id: light.kitchen_lights_2 - conditions: - condition: trigger id: - Lights On - condition: or conditions: - condition: state entity_id: binary_sensor.lunchtime state: 'on' - condition: state entity_id: binary_sensor.dinner_time state: 'on' - condition: numeric_state entity_id: sensor.kitchen_presence_sensor_light_sensor_light_level below: input_number.low_light_threshold sequence: - service: light.turn_on data: color_temp: 200 brightness: 255 target: entity_id: light.kitchen_lights_2 - conditions: - condition: trigger id: - Lights Off sequence: - service: light.turn_off data: {} target: entity_id: light.kitchen_lights_2 - conditions: - condition: trigger id: - Back Door Entry - condition: sun before: sunrise after: sunset - condition: state entity_id: light.back_door_zone_light state: 'off' sequence: - service: light.turn_on data: color_temp: 500 brightness: 127 target: entity_id: light.back_door_zone_light - conditions: - condition: trigger id: - BDZ On - condition: or conditions: - condition: numeric_state entity_id: sensor.kitchen_presence_sensor_light_sensor_light_level below: input_number.low_light_threshold - condition: and conditions: - condition: or conditions: - condition: state entity_id: sensor.season state: autumn - condition: state entity_id: sensor.season state: winter - condition: time after: '17:35:00' before: '21:00:00' sequence: - service: light.turn_on data: color_temp: 500 brightness: 128 target: entity_id: light.back_door_zone_light - conditions: - condition: trigger id: - BDZ Off sequence: - service: light.turn_off data: {} target: entity_id: light.back_door_zone_light - conditions: - condition: trigger id: - Utility On - condition: state entity_id: binary_sensor.lights_out state: 'off' - condition: sun after: sunset before: sunrise sequence: - service: light.turn_on data: color_temp: 500 brightness: 199 target: entity_id: light.utility_room_light - conditions: - condition: trigger id: - Utility Off sequence: - service: light.turn_off data: {} target: entity_id: light.utility_room_light - conditions: - condition: trigger id: - Low Light - condition: state entity_id: binary_sensor.kitchen_presence_sensor_presence_sensor_1 state: 'on' - condition: or conditions: - condition: state entity_id: binary_sensor.morning state: 'on' - condition: state entity_id: binary_sensor.afternoon state: 'on' - condition: state entity_id: binary_sensor.evening state: 'on' - condition: state entity_id: light.kitchen_lights_2 state: 'off' sequence: - service: light.turn_on data: color_temp: 367 brightness: 28 target: entity_id: light.kitchen_lights_2 - conditions: - condition: trigger id: - Low Light - condition: state entity_id: binary_sensor.kitchen_presence_sensor_presence_sensor_1 state: 'on' - condition: or conditions: - condition: state entity_id: binary_sensor.lunchtime state: 'on' - condition: state entity_id: binary_sensor.dinner_time state: 'on' - condition: state entity_id: light.kitchen_lights_2 state: 'off' sequence: - service: light.turn_on data: color_temp: 200 brightness: 255 target: entity_id: light.kitchen_lights_2 - conditions: - condition: trigger id: - Good Light sequence: - service: light.turn_off data: {} target: entity_id: light.kitchen_lights_2 - conditions: - condition: trigger id: - Lunchtime starts - Dinner Time Starts - condition: state entity_id: light.kitchen_lights_2 state: 'on' sequence: - service: light.turn_on data: color_temp: 200 brightness: 255 target: entity_id: light.kitchen_lights_2 - conditions: - condition: trigger id: - lunchtime ends - Dinner Time Ends - condition: state entity_id: light.kitchen_lights_2 state: 'on' sequence: - service: light.turn_on data: color_temp: 367 brightness: 28 target: entity_id: light.kitchen_lights_2 - conditions: - condition: trigger id: - Allow Lights on - condition: state entity_id: input_boolean.room_occupied_kitchen state: 'on' - condition: numeric_state entity_id: sensor.kitchen_presence_sensor_light_sensor_light_level below: input_number.low_light_threshold sequence: - service: light.turn_on data: color_temp: 367 brightness: 28 target: entity_id: light.kitchen_lights_2 - alias: Main Bedroom Lights with Presence description: '' trigger: - platform: state entity_id: - binary_sensor.main_bedroom_fp2_presence_sensor_2 - binary_sensor.main_bedroom_fp2_presence_sensor_3 id: Lights On from: 'off' to: 'on' - platform: state entity_id: - binary_sensor.main_bedroom_fp2_presence_sensor_2 - binary_sensor.main_bedroom_fp2_presence_sensor_3 id: Lights Off from: 'on' to: 'off' for: hours: 0 minutes: 1 seconds: 0 - platform: numeric_state entity_id: sensor.main_bedroom_fp2_light_sensor_light_level below: input_number.low_light_threshold id: Low Light - platform: numeric_state entity_id: sensor.main_bedroom_fp2_light_sensor_light_level id: Good Light above: input_number.upper_light_threshold_level condition: - condition: state entity_id: input_boolean.holiday_mode state: 'off' - condition: state entity_id: binary_sensor.lights_out state: 'off' action: - choose: - conditions: - condition: trigger id: - Lights On - condition: template value_template: '{{"Daves" in trigger.to_state.attributes.friendly_name }}' alias: Filter Dave's side of bed - condition: numeric_state entity_id: sensor.main_bedroom_fp2_light_sensor_light_level below: input_number.low_light_threshold - condition: state entity_id: input_boolean.main_bedroom_bedside_lamps_active state: 'on' sequence: - service: light.turn_on data: brightness_pct: 5 color_temp: 500 target: entity_id: light.sonoff_1001f6d950 - conditions: - condition: trigger id: - Lights On - condition: template value_template: '{{"Gem" in trigger.to_state.attributes.friendly_name }}' alias: Filter Gem's side of bed - condition: numeric_state entity_id: sensor.main_bedroom_fp2_light_sensor_light_level below: input_number.low_light_threshold - condition: state entity_id: input_boolean.main_bedroom_bedside_lamps_active state: 'on' sequence: - service: light.turn_on data: color_temp: 500 brightness_pct: 5 target: entity_id: light.sonoff_1001f6d982 - conditions: - condition: trigger id: - Lights Off - condition: template value_template: '{{"Daves" in trigger.to_state.attributes.friendly_name }}' alias: Filter Dave's side of bed - condition: state state: 'on' entity_id: light.sonoff_1001f6d950 sequence: - service: light.turn_off data: {} target: entity_id: light.sonoff_1001f6d950 - conditions: - condition: trigger id: - Lights Off - condition: template value_template: '{{"Gem" in trigger.to_state.attributes.friendly_name }}' alias: Filter Gem's side of bed - condition: state state: 'on' entity_id: light.sonoff_1001f6d982 sequence: - service: light.turn_off data: {} target: entity_id: light.sonoff_1001f6d982 - conditions: - condition: trigger id: - Low Light - condition: state entity_id: input_boolean.room_occupied_main_bedroom state: 'on' - condition: state entity_id: input_boolean.main_bedroom_bedside_lamps_active state: 'on' sequence: - service: light.turn_on data: color_temp: 500 brightness_pct: 5 target: entity_id: - light.sonoff_1001f6d950 - light.sonoff_1001f6d982 - conditions: - condition: trigger id: - Good Light - condition: or conditions: - condition: state entity_id: light.sonoff_1001f6d950 state: 'on' - condition: state entity_id: light.sonoff_1001f6d982 state: 'on' sequence: - service: light.turn_off data: {} target: entity_id: - light.sonoff_1001f6d982 - light.sonoff_1001f6d950 mode: restart - alias: Peak/Cheap rate select for Go Utility meter description: '' trigger: - platform: time at: 00:30:00 variables: tariff: Off Peak - platform: time at: 04:30:00 variables: tariff: Peak action: - service: select.select_option target: entity_id: select.octopus_go data: option: '{{ tariff }}' mode: single - alias: Back Door Light Needed description: '' triggers: - entity_id: - switch.back_door_light_switch from: 'off' to: 'on' trigger: state - entity_id: - switch.back_door_light_switch from: 'on' to: 'off' trigger: state conditions: [] actions: - choose: - conditions: - condition: state entity_id: light.back_door_light state: 'off' sequence: - data: {} target: entity_id: light.back_door_light action: light.turn_on default: - data: {} target: entity_id: light.back_door_light action: light.turn_off mode: single - alias: Back Door Related Automations description: Lights and announcements etc triggers: - entity_id: - binary_sensor.back_door_sensor_contact to: 'on' id: Chime from: 'off' trigger: state - entity_id: - binary_sensor.back_door_sensor_contact from: 'off' to: 'on' for: hours: 0 minutes: 2 seconds: 0 id: Door still open trigger: state - entity_id: - binary_sensor.back_door_sensor_contact from: 'on' to: 'off' id: Chime Off trigger: state - trigger: sun event: sunrise id: Sunrise conditions: [] actions: - choose: - conditions: - condition: trigger id: - Chime sequence: - alias: Turn on back door light if needed if: - condition: sun before: sunrise after: sunset then: - action: light.turn_on target: entity_id: light.back_door_light data: brightness: 255 - alias: Turn on back door zone light if needed if: [] then: - data: {} target: entity_id: light.back_door_zone_light action: light.turn_on - if: - condition: state entity_id: input_boolean.audible_notifications state: 'on' - condition: state entity_id: input_boolean.announcement_playing state: 'off' then: - action: media_player.play_media data: entity_id: media_player.jarvis_kitchen_media_player media_content_id: http://192.168.0.95:8123/local/Sounds/tos-turboliftdoor.mp3 media_content_type: music alias: Play door swish if allowed - conditions: - condition: trigger id: - Chime Off sequence: - if: - condition: state entity_id: input_boolean.announcement_playing state: 'off' - condition: state entity_id: input_boolean.audible_notifications state: 'on' then: - action: media_player.play_media data: entity_id: media_player.jarvis_kitchen_media_player media_content_id: http://192.168.0.95:8123/local/Sounds/tos-turboliftdoor.mp3 media_content_type: music alias: Play door swish if allowed - alias: Dim back door light to off if needed if: - condition: and conditions: - condition: state entity_id: light.back_door_light state: 'on' then: - data: {} action: script.back_door_light_dim_when_door_closed - conditions: - condition: trigger id: Door Still Open - condition: and conditions: - condition: state entity_id: input_boolean.audible_notifications state: 'on' - condition: state entity_id: input_boolean.guest_mode state: 'off' sequence: - if: - condition: template value_template: '{{is_state(''binary_sensor.dave_home'',''on'')}}' then: - action: script.jarvis_speech_engine_v3_0 data: where: dave message: "The {{ trigger.to_state.attributes.friendly_name }} {{ [\n \ \ ' is standing open.',\n ' is open.',\n ' does not close on its own.',\n\ \ ' was left standing open.'\n] | random }} {{ [\n 'Can a human\ \ be so kind and close it?',\n 'The air quality in this house has\ \ actually improved.',\n 'Closing the door would improve the internal\ \ climate of the house.',\n 'Hey. The door was just opened and this\ \ is crazy. But now you know. So close it maybe.',\n 'If at first\ \ you do not succeed in closing the door, please try again. Like, Right\ \ now seems like a good time to try again.',\n 'And the automatic\ \ door closer appears to be broken. So, you know what to do. Time to\ \ get physical.',\n 'I would close it for you. But I lack legs. And\ \ Arms.'\n] | random }}\n" else: - action: script.jarvis_speech_engine_v3_0 data: where: gem message: "The {{ trigger.to_state.attributes.friendly_name }} {{ [\n \ \ ' is standing open.',\n ' is open.',\n ' does not close on its own.',\n\ \ ' was left standing open.'\n] | random }} {{ [\n 'Can a human\ \ be so kind and close it?',\n 'The air quality in this house has\ \ actually improved.',\n 'Closing the door would improve the internal\ \ climate of the house.',\n 'Hey. The door was just opened and this\ \ is crazy. But now you know. So close it maybe.',\n 'If at first\ \ you do not succeed in closing the door, please try again. Like, Right\ \ now seems like a good time to try again.',\n 'And the automatic\ \ door closer appears to be broken. So, you know what to do. Time to\ \ get physical.',\n 'I would close it for you. But I lack legs. And\ \ Arms.'\n] | random }}\n" - conditions: - condition: trigger id: - Sunrise sequence: - if: - condition: state entity_id: light.back_door_light state: 'on' then: - action: light.turn_off target: entity_id: light.back_door_light data: {} alias: If the light is still on at sunrise, turn it off mode: restart - alias: Back Door Zone Light Needed description: '' mode: single triggers: - entity_id: - switch.kitchen_light_switch_left from: 'off' to: 'on' trigger: state - entity_id: - switch.kitchen_light_switch_left from: 'on' to: 'off' trigger: state conditions: [] actions: - choose: - conditions: - condition: state entity_id: light.back_door_zone_light state: 'off' sequence: - action: light.turn_on target: entity_id: light.back_door_zone_light data: {} default: - action: light.turn_off target: entity_id: light.back_door_zone_light data: {} - alias: Bathrooms Presence description: '' mode: parallel triggers: - entity_id: - binary_sensor.cloakroom_presence_occupancy from: 'off' to: 'on' id: Cloak Presence trigger: state - entity_id: - binary_sensor.cloakroom_presence_occupancy from: 'on' to: 'off' id: Cloak Absence for: hours: 0 minutes: 0 seconds: 30 trigger: state - entity_id: - binary_sensor.jack_and_jill_presence_occupancy from: 'off' to: 'on' id: Boys Bathroom Presence trigger: state - entity_id: - binary_sensor.jack_and_jill_presence_occupancy from: 'on' to: 'off' id: Boys Bathroom Absence for: hours: 0 minutes: 0 seconds: 30 trigger: state - entity_id: - binary_sensor.main_bathroom_presence_occupancy from: 'off' to: 'on' id: Main Bathroom Presence trigger: state - entity_id: - binary_sensor.main_bathroom_presence_occupancy from: 'on' to: 'off' id: Main Bathroom Absence for: hours: 0 minutes: 0 seconds: 30 trigger: state conditions: [] actions: - choose: - conditions: - condition: trigger id: - Cloak Presence sequence: - action: input_text.set_value metadata: {} data: value: cloakroom target: entity_id: input_text.room_presence - action: input_boolean.turn_on metadata: {} data: {} target: entity_id: input_boolean.room_occupied_cloakroom - conditions: - condition: trigger id: - Cloak Absence sequence: - action: input_boolean.turn_off metadata: {} data: {} target: entity_id: input_boolean.room_occupied_cloakroom - conditions: - condition: trigger id: - Main Bathroom Presence sequence: - action: input_text.set_value metadata: {} data: value: main_bathroom target: entity_id: input_text.room_presence - action: input_boolean.turn_on metadata: {} data: {} target: entity_id: input_boolean.room_occupied_main_bathroom - conditions: - condition: trigger id: - Main Bathroom Absence sequence: - action: input_boolean.turn_off metadata: {} data: {} target: entity_id: input_boolean.room_occupied_main_bathroom - conditions: - condition: trigger id: - Boys Bathroom Presence sequence: - action: input_text.set_value metadata: {} data: value: boys_bathroom target: entity_id: input_text.room_presence - action: input_boolean.turn_on metadata: {} data: {} target: entity_id: input_boolean.room_occupied_jack_jill - conditions: - condition: trigger id: - Boys Bathroom Absence sequence: - action: input_boolean.turn_off metadata: {} data: {} target: entity_id: input_boolean.room_occupied_jack_jill - alias: Battery Increased Notification description: Battery Increased Notification mode: queued triggers: - event_type: battery_notes_battery_increased trigger: event conditions: [] actions: - action: persistent_notification.create data: title: '{{ trigger.event.data.device_name }} Battery Increased ' message: 'The device has increased its battery level. Consequently, I have marked it as replaced. If this is not the case, you know what to do. ' - alias: Battery Low Notification description: Battery Low Notification with auto dismiss mode: queued triggers: - event_type: battery_notes_battery_threshold event_data: battery_low: true id: low alias: Battery went low trigger: event - event_type: battery_notes_battery_threshold event_data: battery_low: false id: high alias: Battery went high trigger: event conditions: [] actions: - choose: - conditions: - condition: trigger id: - low sequence: - action: persistent_notification.create data: title: '{{ trigger.event.data.device_name }} Battery Low ' notification_id: '{{ trigger.event.data.device_id }}-{{ trigger.event.data.source_entity_id }}' message: 'The device has a battery level of {{ trigger.event.data.battery_level }}% {{ ''\n'' -}} You need {{ trigger.event.data.battery_quantity }}× {{ trigger.event.data.battery_type }} ' - conditions: - condition: trigger id: - high sequence: - action: persistent_notification.dismiss data: notification_id: '{{ trigger.event.data.device_id }}-{{ trigger.event.data.source_entity_id }}' - alias: Battery Replaced description: Battery Replaced mode: queued triggers: - event_type: battery_notes_battery_increased trigger: event conditions: [] actions: - action: battery_notes.set_battery_replaced data: device_id: '{{ trigger.event.data.device_id }}' source_entity_id: '{{ trigger.event.data.source_entity_id }}' - alias: Battery Settings Confirm description: checks to see if battery settings are correct and sets an input boolean toggle mode: parallel max: 10 triggers: - entity_id: - select.solaredge_i1_storage_default_mode from: Maximize Self Consumption id: Storage Default Mode Wrong trigger: state - entity_id: - select.solaredge_i1_storage_default_mode id: Storage Default Mode Correct to: Maximize Self Consumption trigger: state - entity_id: - select.solaredge_i1_storage_command_mode from: Maximize Self Consumption id: Storage Cmd Mode Wrong trigger: state - entity_id: - select.solaredge_i1_storage_command_mode id: Storage Cmd Mode Correct to: Maximize Self Consumption trigger: state - entity_id: - select.solaredge_i1_storage_control_mode from: Remote Control id: Storage Control Mode Wrong trigger: state - entity_id: - select.solaredge_i1_storage_control_mode id: Storage Control Mode Correct to: Remote Control trigger: state conditions: [] actions: - choose: - conditions: - condition: trigger id: Storage Default Mode Wrong - condition: state entity_id: input_boolean.desired_storage_default_mode_correct state: 'on' sequence: - action: input_boolean.toggle data: {} target: entity_id: input_boolean.desired_storage_default_mode_correct - conditions: - condition: trigger id: Storage Default Mode Correct - condition: state entity_id: input_boolean.desired_storage_default_mode_correct state: 'off' sequence: - action: input_boolean.toggle data: {} target: entity_id: input_boolean.desired_storage_default_mode_correct - conditions: - condition: trigger id: Storage Cmd Mode Wrong - condition: state entity_id: input_boolean.desired_storage_cmd_mode_correct state: 'on' sequence: - action: input_boolean.toggle data: {} target: entity_id: input_boolean.desired_storage_cmd_mode_correct - conditions: - condition: trigger id: Storage Cmd Mode Correct - condition: state entity_id: input_boolean.desired_storage_cmd_mode_correct state: 'off' sequence: - action: input_boolean.toggle data: {} target: entity_id: input_boolean.desired_storage_cmd_mode_correct - conditions: - condition: trigger id: Storage Control Mode Wrong - condition: state entity_id: input_boolean.desired_storage_control_mode_correct state: 'on' sequence: - action: input_boolean.toggle data: {} target: entity_id: input_boolean.desired_storage_control_mode_correct - conditions: - condition: trigger id: Storage Control Mode Correct - condition: state entity_id: input_boolean.desired_storage_control_mode_correct state: 'off' sequence: - action: input_boolean.toggle data: {} target: entity_id: input_boolean.desired_storage_control_mode_correct - alias: Bedtime and Get up Actions description: A list of things that happen in the house when we go to bed and then get up. triggers: - trigger: state entity_id: - binary_sensor.master_bed_occupancy_bed_occupied_both from: 'on' to: 'off' for: hours: 0 minutes: 1 seconds: 0 id: someone is up - trigger: state entity_id: - binary_sensor.master_bed_occupancy_bed_occupied_both from: 'off' to: 'on' for: hours: 0 minutes: 1 seconds: 0 id: we are in bed enabled: true - trigger: state entity_id: - binary_sensor.master_bed_occupancy_bed_occupied_either from: 'on' to: 'off' for: hours: 0 minutes: 2 seconds: 0 id: we are up - trigger: state entity_id: - binary_sensor.master_bed_occupancy_bed_occupied_either from: 'off' to: 'on' for: hours: 0 minutes: 1 seconds: 0 id: someone is in bed conditions: [] actions: - choose: - conditions: - condition: trigger id: - we are in bed - condition: time after: '21:30:00' - condition: state entity_id: input_boolean.we_are_in_bed state: 'off' sequence: - action: script.goodnight_2 data: {} - conditions: - condition: trigger id: - we are up - condition: state entity_id: input_boolean.we_are_in_bed state: 'on' - condition: time after: 06:55:00 before: '21:00:00' sequence: - action: script.good_morning_2 data: {} - conditions: - condition: trigger id: - someone is in bed - condition: time after: '21:00:00' - condition: or conditions: - condition: state entity_id: binary_sensor.dave_home state: 'off' - condition: state entity_id: binary_sensor.gem_home state: 'off' - condition: state entity_id: input_boolean.we_are_in_bed state: 'off' sequence: - action: script.goodnight_2 data: {} mode: single - alias: Bedtime for Jamie description: '' triggers: - trigger: conversation command: - it's bedtime - goodnight - It is bedtime id: Voice - trigger: state entity_id: - input_boolean.we_are_in_bed from: 'off' to: 'on' id: Stop play conditions: [] actions: - choose: - conditions: - condition: trigger id: - Voice - condition: state entity_id: assist_satellite.jarvis_jamie_assist_satellite state: processing sequence: - alias: Silence normal response. set_conversation_response: '' - alias: Respond with a goodnight message. action: assist_satellite.announce target: entity_id: assist_satellite.jarvis_jamie_assist_satellite metadata: {} data: message: "{{ [\n \"The Minecraft mobs are asleep — so power up your dreams\ \ Jamie for tomorrow's building adventures!\",\n \"Blaze has crossed\ \ the finish line and left Crusher in the dust — now it's your turn Jamie,\ \ to race into dreamland!\",\n \"Topsy and Tim have finished their\ \ busy day — rest up for your next big adventure Jamie!\",\n \"Blippi’s\ \ backpack is packed away — I hope yours is too Jamie because it's time\ \ to dream up tomorrow’s discoveries!\",\n \"The Ninjago team have\ \ defended the city — now it's your mission to rest like a true ninja\ \ Jamie!\",\n \"Paw Patrol mission complete — even Chase knows heroes,\ \ like you Jamie, need their sleep!\",\n \"Bluey’s imagination is recharging\ \ overnight — what stories will you dream up to share with her tomorrow\ \ Jamie?\",\n \"Peppa Pig’s day of adventures is done — time to jump\ \ into bed Jamie, not muddy puddles!\",\n \"Minecraft Steve just built\ \ the best base ever — it's epic. So now, Jamie, it's time for you to\ \ build the best dreams!\",\n \"Ryder has called all pups to the lookout\ \ for a nap. Dream big, Jamie, and be ready for tomorrow’s rescue!\"\n\ \ ] | random }}" preannounce: false - action: media_player.volume_set target: entity_id: - media_player.jamie_s_room_dot data: volume_level: '{{ states(''input_number.alexa_volume_level_low'') | float(0) }}' - parallel: - action: media_player.play_media data: media_content_id: Play Bedtime music from Amazon Music media_content_type: custom target: entity_id: - media_player.jamie_s_room_dot - action: input_boolean.turn_off target: entity_id: - input_boolean.jamies_light_toggle data: {} - conditions: - condition: trigger id: - Stop play sequence: - action: media_player.media_stop metadata: {} data: {} target: entity_id: - media_player.jamie_s_room_dot mode: single - alias: Bedtime for Sean description: '' triggers: - trigger: conversation command: - it's bedtime - goodnight - It is bedtime id: Voice - trigger: state entity_id: - input_boolean.we_are_in_bed from: 'off' to: 'on' id: Stop play conditions: [] actions: - choose: - conditions: - condition: trigger id: - Voice - condition: state entity_id: assist_satellite.jarvis_sean_assist_satellite state: processing sequence: - alias: Silence normal response. set_conversation_response: '' - alias: Respond with a Marvel goodnight. action: assist_satellite.announce target: entity_id: assist_satellite.jarvis_sean_assist_satellite metadata: {} data: message: "{{ [\"Sleep tight, Spidey! Your spider-sense needs to rest for\ \ the day and your web shooters need a recharge so you're ready to swing\ \ into action tomorrow!\",\n \"Close your eyes Avenger. We assemble\ \ tomorrow when the world might need you to save the day!\",\n \"Okay\ \ Iron Man. Helmet off and power down all systems. Friday will look after\ \ you as you sleep!\",\n \"Rest up, young hero! Captain America can\ \ do this all day, but you need sleep to stay strong for your next mission.\"\ ,\n \"Time to relax big guy. Sleep well my wee Hulk, and try not to\ \ smash your duvet in your sleep!\",\n \"The stars are your Infinity\ \ Stones, so your dreams are powered by the most elemental forces. Sleep\ \ tight.\",\n \"Time to get some sleep Thor. So put the hammer down,\ \ close your eyes and the gods of Aasgard will watch over you\",\n \ \ \"The mirror dimension is calling you Doctor Strange. So open the eye\ \ of agamoto and prepare for some magical dreams\",\n \"Director Fury\ \ of SHIELD has assigned you a mission: Get a full night’s rest so you\ \ can be a hero tomorrow!\"\n ] | random }}" preannounce: false - delay: hours: 0 minutes: 0 seconds: 10 milliseconds: 0 - action: media_player.volume_set target: entity_id: media_player.jarvis_sean_media_player data: volume_level: 0.25 - parallel: - action: music_assistant.play_media target: entity_id: - media_player.jarvis_sean_media_player_2 data: media_id: library://audiobook/5 alias: Read an audiobook on JARVIS media player - action: input_boolean.turn_off target: entity_id: input_boolean.seans_light_toggle data: {} - conditions: - condition: trigger id: - Stop play sequence: - action: media_player.media_stop metadata: {} data: {} target: entity_id: media_player.jarvis_sean_media_player_2 mode: single - alias: Birthday Announcements description: '' triggers: - event: start offset: '7:45:0' entity_id: calendar.birthdays trigger: calendar conditions: - condition: template value_template: '{{ is_state(''input_boolean.audible_notifications'',''on'') }}' actions: - alias: Pump up the volume action: media_player.volume_set target: entity_id: media_player.living_room_pop data: volume_level: 0.4 - action: script.birthday_announcement data: where: living_room - delay: hours: 0 minutes: 0 seconds: 15 milliseconds: 0 - data: entity_id: media_player.living_room_pop media_content_id: Awesome Birthday Song in everywhere group media_content_type: AMAZON_MUSIC action: media_player.play_media alias: Play Happy Birthday everywhere. - action: media_player.volume_set target: entity_id: media_player.living_room_pop data: volume_level: 0.4 alias: Let down the volume mode: single initial_state: true - alias: Boys Bedroom Presence and Lights description: '' triggers: - entity_id: - binary_sensor.jamie_room_presence_occupancy from: 'off' to: 'on' id: Jamie Presence trigger: state - entity_id: - binary_sensor.jamies_room_occupied from: 'on' to: 'off' id: Jamie Absence trigger: state - entity_id: - binary_sensor.sean_room_presence_occupancy from: 'off' to: 'on' id: Sean Presence trigger: state - entity_id: - binary_sensor.seans_room_occupied from: 'on' to: 'off' id: Sean Absence trigger: state conditions: [] actions: - choose: - conditions: - condition: trigger id: - Jamie Presence sequence: - parallel: - action: input_text.set_value metadata: {} data: value: jamies_room target: entity_id: input_text.room_presence - action: input_boolean.turn_on metadata: {} data: {} target: entity_id: input_boolean.room_occupied_jamie_s_room - if: - condition: numeric_state entity_id: sensor.jamies_room_light_level below: input_number.low_light_threshold - condition: time after: 08:00:00 before: '19:45:00' weekday: - sun - sat - fri - thu - wed - tue - mon then: - action: input_boolean.turn_on target: entity_id: input_boolean.jamies_light_toggle data: {} alias: If low light between 8am and 7:45pm turn on the light. alias: Set text and toggles. - conditions: - condition: trigger id: - Sean Presence sequence: - alias: Set text and toggles. parallel: - action: input_text.set_value metadata: {} data: value: seans_room target: entity_id: input_text.room_presence - action: input_boolean.turn_on metadata: {} data: {} target: entity_id: input_boolean.room_occupied_sean_s_room - alias: If low light between 8am and 7:45pm turn on the light. if: - condition: numeric_state entity_id: sensor.seans_room_light_level below: input_number.low_light_threshold - condition: time after: 08:00:00 before: '19:45:00' weekday: - sun - sat - fri - thu - wed - tue - mon then: - action: input_boolean.turn_on target: entity_id: input_boolean.seans_light_toggle data: {} - conditions: - condition: trigger id: - Jamie Absence sequence: - action: input_boolean.turn_off metadata: {} data: {} target: entity_id: - input_boolean.room_occupied_jamie_s_room - input_boolean.jamies_light_toggle - conditions: - condition: trigger id: - Sean Absence sequence: - action: input_boolean.turn_off metadata: {} data: {} target: entity_id: - input_boolean.room_occupied_sean_s_room - input_boolean.seans_light_toggle mode: single - alias: Boys Bedtime Announcements v2.0 description: '' triggers: - at: input_datetime.school_night_jamie id: School Bedtime Jamie trigger: time enabled: true - at: input_datetime.school_night_sean id: School Bedtime Sean trigger: time enabled: true - at: input_datetime.non_school_night id: Non School Bedtime trigger: time enabled: true conditions: [] actions: - choose: - conditions: - condition: trigger id: - School Bedtime Sean - condition: state entity_id: sensor.school_tomorrow state: 'True' - condition: state entity_id: input_boolean.audible_notifications state: 'on' - condition: state entity_id: input_boolean.seans_bedtime_announcement_played state: 'off' sequence: - action: script.sean_bedtime_announcement data: {} - conditions: - condition: trigger id: - School Bedtime Jamie - condition: state entity_id: sensor.school_tomorrow state: 'True' - condition: state entity_id: input_boolean.audible_notifications state: 'on' - condition: state entity_id: input_boolean.jamies_bedtime_announcement_played state: 'off' sequence: - action: script.jamie_bedtime_announcement data: {} - conditions: - condition: trigger id: Non School Bedtime - condition: state entity_id: sensor.school_tomorrow state: 'False' - condition: state entity_id: input_boolean.audible_notifications state: 'on' - condition: and conditions: - condition: state entity_id: input_boolean.seans_bedtime_announcement_played state: 'off' - condition: state entity_id: input_boolean.jamies_bedtime_announcement_played state: 'off' sequence: - action: script.boys_bedtime_announcement data: {} mode: single initial_state: true - alias: Boys' room blinds description: '' triggers: - at: 07:30:00 id: weekday open trigger: time - at: 08:00:00 id: weekend open trigger: time - trigger: sun event: sunset offset: 0 id: Winter close conditions: [] actions: - choose: - conditions: - condition: trigger id: - weekday open - condition: state entity_id: sensor.day_of_week state: - Monday - Tuesday - Wednesday - Thursday - Friday - condition: or conditions: - condition: state entity_id: binary_sensor.schoolday state: 'on' - condition: state entity_id: binary_sensor.fridayschool state: 'on' alias: If it is a school day sequence: - action: cover.open_cover target: entity_id: - cover.jamies_room_blind - cover.seans_room_blind data: {} - conditions: - condition: trigger id: - weekday open - condition: or conditions: - condition: state entity_id: sensor.day_of_week state: - Saturday - Sunday - condition: and conditions: - condition: state entity_id: binary_sensor.schoolday state: 'off' - condition: state entity_id: binary_sensor.fridayschool state: 'off' alias: If weekend or school holiday sequence: - action: cover.open_cover target: entity_id: - cover.jamies_room_blind - cover.seans_room_blind data: {} - conditions: - condition: trigger id: - Winter close sequence: - action: cover.close_cover target: entity_id: - cover.jamies_room_blind - cover.seans_room_blind data: {} mode: single - alias: Boys' room blinds V2.0 description: Opens and closes Jamie's and Sean's blinds depending on school schedule. triggers: - at: input_datetime.jamie_s_room_blind_opening_time id: jamie_open trigger: time - at: input_datetime.sean_s_room_blind_opening_time id: sean_open trigger: time - at: 07:32:00 id: fallback_school_open trigger: time - at: 07:47:00 id: fallback_weekend_open trigger: time - event: sunset id: winter_close trigger: sun - at: '19:30:00' id: summer_close trigger: time conditions: [] actions: - choose: - conditions: - condition: trigger id: jamie_open sequence: - target: entity_id: cover.jamies_room_blind action: cover.open_cover data: {} - target: entity_id: input_boolean.jamie_s_bedside_lamp action: input_boolean.turn_off data: {} - conditions: - condition: trigger id: sean_open sequence: - target: entity_id: cover.seans_room_blind action: cover.open_cover data: {} - target: entity_id: input_boolean.sean_s_bedside_lamp action: input_boolean.turn_off data: {} - conditions: - condition: trigger id: fallback_school_open - condition: template value_template: "{{ is_state('binary_sensor.schoolday', 'on')\n or is_state('binary_sensor.fridayschool',\ \ 'on') }}\n" alias: If it's a schoolday. - condition: state entity_id: cover.jamies_room_blind state: closed sequence: - target: entity_id: - cover.jamies_room_blind - cover.seans_room_blind action: cover.open_cover data: {} - target: entity_id: - input_boolean.jamie_s_bedside_lamp - input_boolean.sean_s_bedside_lamp action: input_boolean.turn_off data: {} - data: title: Fallback Trigger Used message: 'Both blinds opened at 07:30 using fallback school day logic. Because `sensor.school_tomorrow` is {{ states(''sensor.school_tomorrow'') }}. ' action: persistent_notification.create - conditions: - condition: trigger id: fallback_weekend_open - condition: template value_template: "{{ is_state('binary_sensor.schoolday', 'off')\n and is_state('binary_sensor.fridayschool',\ \ 'off') }}\n" - condition: state entity_id: cover.jamies_room_blind state: closed sequence: - target: entity_id: - cover.jamies_room_blind - cover.seans_room_blind action: cover.open_cover data: {} - target: entity_id: - input_boolean.jamie_s_bedside_lamp - input_boolean.sean_s_bedside_lamp action: input_boolean.turn_off data: {} - data: title: Fallback Trigger Used message: 'Both boys'' blinds opened at 07:45 using fallback weekend/holiday logic. Because `sensor.school_tomorrow` is {{ states(''sensor.school_tomorrow'') }}. ' action: persistent_notification.create - conditions: - condition: trigger id: winter_close sequence: - target: entity_id: - cover.jamies_room_blind - cover.seans_room_blind action: cover.close_cover data: {} - target: entity_id: - input_boolean.jamie_s_bedside_lamp - input_boolean.sean_s_bedside_lamp action: input_boolean.turn_on data: {} - conditions: - condition: trigger id: summer_close sequence: - target: entity_id: - cover.jamies_room_blind - cover.seans_room_blind action: cover.close_cover data: {} - target: entity_id: - input_boolean.jamie_s_bedside_lamp - input_boolean.sean_s_bedside_lamp action: input_boolean.turn_on data: {} mode: parallel max: 3 - alias: Bread Maker description: '' triggers: - trigger: numeric_state entity_id: - sensor.kitchen_socket_power_power for: hours: 0 minutes: 0 seconds: 15 above: 50 id: Start - trigger: event event_type: timer.finished event_data: entity_id: timer.bread_timer id: Time alias: When bread timer finishes. conditions: [] actions: - choose: - conditions: - condition: trigger id: - Start - condition: state entity_id: input_boolean.bread_done state: 'off' - condition: template value_template: '{{ trigger.from_state.state not in [''unknown'', ''unavailable''] }}' sequence: - parallel: - action: input_boolean.turn_on target: entity_id: input_boolean.bread_done data: {} - action: timer.start metadata: {} data: {} target: entity_id: timer.bread_timer - conditions: - condition: trigger id: - Time - condition: state entity_id: input_boolean.bread_done state: 'on' - condition: numeric_state entity_id: sensor.kitchen_socket_power_power below: 10 sequence: - parallel: - action: input_boolean.turn_off target: entity_id: input_boolean.bread_done data: {} - action: script.text_notify_parents data: title: BREAD DONE! message: It has been 3 hours since you put the bread maker on. Its probaby done making another loaf, but I suggest checking. mode: single - alias: Calendar Event Announcements description: '' triggers: - event: start offset: -0:32:0 entity_id: calendar.forrester_events trigger: calendar conditions: - condition: state entity_id: input_boolean.audible_notifications state: 'on' actions: - alias: Announce to Dave if home, else Gem. if: - condition: state entity_id: binary_sensor.dave_home state: 'on' then: - action: script.jarvis_speech_engine_v3_0 data: where: dave message: "{%- macro getReport() -%}\n {% set response = state_attr('sensor.calendar_events',\ \ 'calendar_response') %}\n {% set cal = response['calendar.forrester_events']\ \ if response and 'calendar.forrester_events' in response else {} %}\n \ \ {% set events = cal['events'] if 'events' in cal else [] %}\n {% set\ \ now = now() %}\n {% set upcoming = events\n | selectattr('start',\ \ 'defined')\n | selectattr('start', '>', now.isoformat())\n | sort(attribute='start')\n\ \ | list %}\n \n {% if upcoming %}\n {% set next = upcoming[0] %}\n\ \ {% set event_title = next.summary %}\n {% set event_description\ \ = (next.description or '') | lower %}\n {% set car_tags = ['#car',\ \ '#drive', '#needscar', '#trip'] %}\n {% set needs_car = car_tags |\ \ select('in', event_description) | list | count > 0 %}\n \n You have\ \ {{ event_title }} at {{ as_datetime(next.start).strftime('%H:%M') }} —\ \ in about half an hour.\n \n {%- if needs_car and is_state('input_boolean.car_plugged_in',\ \ 'on') -%}\n The car is still plugged in — don't forget to unplug\ \ it!\n {%- elif is_state('input_boolean.car_plugged_in', 'on') -%}\n\ \ If the car is needed, remember that it is still plugged in.\n \ \ {%- endif -%}\n {% else %}\n No upcoming events found.\n {% endif\ \ %}\n{%- endmacro -%}\n\n{%- macro cleanup(data) -%}\n {%- for item in\ \ data.split(\"\\n\") if item | trim != \"\" -%}\n {{ item | trim }}\ \ {% endfor -%}\n{%- endmacro -%}\n\n{%- macro mother_of_all_macros() -%}\n\ \ {{ getReport() }}\n{%- endmacro -%}\n\n{{- cleanup(mother_of_all_macros())\ \ -}}" else: - action: script.jarvis_speech_engine_v3_0 data: where: gem message: "{%- macro getReport() -%}\n {% set response = state_attr('sensor.calendar_events',\ \ 'calendar_response') %}\n {% set cal = response['calendar.forrester_events']\ \ if response and 'calendar.forrester_events' in response else {} %}\n \ \ {% set events = cal['events'] if 'events' in cal else [] %}\n {% set\ \ now = now() %}\n {% set upcoming = events\n | selectattr('start',\ \ 'defined')\n | selectattr('start', '>', now.isoformat())\n | sort(attribute='start')\n\ \ | list %}\n \n {% if upcoming %}\n {% set next = upcoming[0] %}\n\ \ {% set event_title = next.summary %}\n {% set event_description\ \ = (next.description or '') | lower %}\n {% set car_tags = ['#car',\ \ '#drive', '#needscar', '#trip'] %}\n {% set needs_car = car_tags |\ \ select('in', event_description) | list | count > 0 %}\n \n You have\ \ {{ event_title }} at {{ as_datetime(next.start).strftime('%H:%M') }} —\ \ in about half an hour.\n \n {%- if needs_car and is_state('input_boolean.car_plugged_in',\ \ 'on') -%}\n The car is still plugged in — don't forget to unplug\ \ it!\n {%- elif is_state('input_boolean.car_plugged_in', 'on') -%}\n\ \ If the car is needed, remember that it is still plugged in.\n \ \ {%- endif -%}\n {% else %}\n No upcoming events found.\n {% endif\ \ %}\n{%- endmacro -%}\n\n{%- macro cleanup(data) -%}\n {%- for item in\ \ data.split(\"\\n\") if item | trim != \"\" -%}\n {{ item | trim }}\ \ {% endfor -%}\n{%- endmacro -%}\n\n{%- macro mother_of_all_macros() -%}\n\ \ {{ getReport() }}\n{%- endmacro -%}\n\n{{- cleanup(mother_of_all_macros())\ \ -}}" mode: single initial_state: true - alias: 'Charge Battery from Clipped Solar ' description: Effectively charges battery from clipped DC power when solar production estimate is high. In reality, the charge rate is dynamically adjusted to allow max DC production while the battery charges. triggers: - alias: When battery finishes grid charge or car finishes charging. entity_id: - input_boolean.home_battery_grid_charging - input_boolean.rolec_battery_master to: 'off' from: 'on' id: Grid Charge Finished trigger: state - trigger: numeric_state entity_id: sun.sun attribute: elevation above: 10 id: Smart Sunrise Trigger - entity_id: - sensor.solaredge_b1_state_of_energy above: 99.5 id: Charge Complete trigger: numeric_state - trigger: time_pattern minutes: /5 id: Update conditions: [] actions: - choose: - conditions: - condition: trigger id: - Grid Charge Finished - condition: numeric_state entity_id: sensor.solcast_pv_forecast_forecast_today above: 30 sequence: - action: input_boolean.turn_on data: {} target: entity_id: input_boolean.charge_rate_limited - action: number.set_value target: entity_id: - number.solaredge_i1_storage_charge_limit data: value: '{{states(''input_number.storage_charge_limit'')|float(0)}}' - conditions: - condition: trigger id: Smart Sunrise Trigger - condition: state entity_id: input_boolean.charge_rate_limited state: 'off' - condition: state entity_id: input_boolean.home_battery_grid_charging state: 'off' - condition: numeric_state entity_id: sensor.solcast_pv_forecast_forecast_today above: 30 sequence: - target: entity_id: input_boolean.charge_rate_limited action: input_boolean.turn_on data: {} - target: entity_id: number.solaredge_i1_storage_charge_limit data: value: '{{ states(''input_number.storage_charge_limit'') | float(0) }}' action: number.set_value - conditions: - condition: trigger id: - Charge Complete - condition: state entity_id: input_boolean.charge_rate_limited state: 'on' sequence: - action: input_boolean.turn_off target: entity_id: - input_boolean.charge_rate_limited data: {} - action: number.set_value metadata: {} data: value: '7000' target: entity_id: number.solaredge_i1_storage_charge_limit - conditions: - condition: trigger id: - Update - condition: state entity_id: input_boolean.charge_rate_limited state: 'on' sequence: - action: number.set_value target: entity_id: number.solaredge_i1_storage_charge_limit data: value: '{{ states(''sensor.battery_charge_limit_dynamic'') | float(0) }}' alias: Set charge rate limit dynamically to a max 2160W mode: parallel max: 3 - alias: Check the house is secure via Voice description: Runs a Security Check based on voice command and announces the result when ready. triggers: - command: - Run a security check - Check the house security - Perform a security check - Check for motion - Check the doors - Check the security cameras - Check the garage security trigger: conversation actions: - variables: query_map: Run a security check.: General Security Check | Query Everything Check the house security.: General Security Check | Query Everything Perform a security check.: General Security Check | Query Everything Check for motion.: Security Check | Query Motion and Door Contact Sensors Check the doors.: Security Check | Query Motion and Door Contact Sensors Check the security cameras.: Security Check | Query Camera Snapshots Check the garage security.: Security Check | Query Garage Camera Snapshot and Door Sensors selected_query: '{{ query_map[trigger.sentence] | default(''General Security Check | Query Everything'') }} ' - action: persistent_notification.create data: title: Security Query Debug message: 'Security Query: {{ selected_query }}' - data: security_query: '{{ selected_query }}' action: script.security_check response_variable: response - variables: camera_response: '{{ response.camera_check }} ' response: '{{ response.query_all_contact_sensors }} {{ response.query_all_motion_sensors }} ' - wait_template: '{{ camera_response != '''' or response != '''' }}' timeout: 00:00:30 continue_on_timeout: true enabled: true - action: google_generative_ai_conversation.generate_content metadata: {} data: prompt: You are a a security guard who has done a sweep of the house. You have checked the state of doors and windows and are now reporting your findings back to the house owner. Be brief and tell me tell me the state of the alarm, only mention doors or windows that are open and if you detected motion anywhere. Keep it conversational with no emojis as your response will be broadcast on a speaker. Here is the variable with the data to check {{ response }}. response_variable: security_response enabled: true - variables: full_response: '{{ camera_response.text}} {{ security_response.text }} ' - action: persistent_notification.create data: title: Script Response Debug message: 'Full Response: {{ full_response }}' - set_conversation_response: '{{ full_response.text }}' enabled: true mode: single - alias: Cloakroom Lights on with Presence description: Lights on and off with presence and timer triggers: - entity_id: - binary_sensor.cloakroom_presence_occupancy from: 'off' to: 'on' id: Presence alias: When someone goes into the cloakroom. trigger: state - entity_id: - binary_sensor.cloakroom_presence_occupancy from: 'on' to: 'off' for: hours: 0 minutes: 0 seconds: 0 id: Absence alias: When someone leaves the cloakroom. trigger: state - event_type: timer.finished event_data: entity_id: timer.cloakroom_light id: Timer Done alias: When cloakroom timer runs down. enabled: true trigger: event - alias: When light level is low. entity_id: - sensor.cloakroom_presence_illuminance below: 30 id: Low Light trigger: numeric_state - trigger: state entity_id: - binary_sensor.cloakroom_door from: 'off' to: 'on' id: Door Open conditions: [] actions: - choose: - conditions: - condition: trigger id: - Presence - Door Open - condition: state entity_id: binary_sensor.quiet_time_boys state: 'off' sequence: - alias: Turn on extractor. action: light.turn_on target: entity_id: - light.cloakroom_switch_light_2 data: {} - data: {} target: entity_id: timer.cloakroom_light action: timer.start - condition: or conditions: - condition: sun before: sunrise after: sunset - condition: numeric_state entity_id: sensor.cloakroom_presence_illuminance below: 30 - alias: Turn on light. action: light.turn_on target: entity_id: - light.cloakroom_switch_light data: {} alias: When someone enters cloakroom outside of quite time. - conditions: - condition: trigger id: - Presence - Door Open - condition: state entity_id: binary_sensor.quiet_time_boys state: 'on' - condition: or conditions: - condition: numeric_state entity_id: sensor.cloakroom_presence_illuminance below: 30 - condition: sun before: sunrise after: sunset sequence: - action: light.turn_on target: entity_id: - light.cloakroom_switch_light data: {} alias: Turn on light only. - data: {} target: entity_id: timer.cloakroom_light action: timer.start alias: When someone enters cloakroom during quite time. - conditions: - condition: trigger id: - Absence - condition: state entity_id: timer.cloakroom_light state: idle sequence: - data: {} target: entity_id: - light.cloakroom_switch_light action: light.turn_off alias: Turn off the light. - condition: state entity_id: light.cloakroom_switch_light_2 state: 'on' alias: Check if the extractor is on. - data: {} target: entity_id: - light.cloakroom_switch_light_2 action: light.turn_off alias: Turn off the extractor. alias: When someone leaves the cloakroom. - conditions: - condition: trigger id: - Timer Done - condition: state entity_id: binary_sensor.cloakroom_presence_occupancy state: 'off' sequence: - if: - condition: state entity_id: binary_sensor.quiet_time_boys state: 'off' then: - action: light.turn_off target: entity_id: light.cloakroom_switch_light_2 data: {} - if: - condition: state entity_id: light.cloakroom_switch_light state: 'on' then: - action: light.turn_off target: entity_id: light.cloakroom_switch_light data: {} else: - action: light.turn_off target: entity_id: light.cloakroom_switch_light data: {} alias: When cloakroom timer runs down. - conditions: - condition: trigger id: - Low Light - condition: state entity_id: binary_sensor.cloakroom_occupied state: 'on' sequence: - action: light.turn_on target: entity_id: light.cloakroom_switch_light data: {} alias: Turn on the light. mode: restart - alias: Clocks Changing description: '' trigger: - platform: time at: '10:00:00' - platform: time at: '19:00:00' condition: - condition: template value_template: '{{ states(''sensor.daylight_savings_days_until'') | int(0) in [7,1] }}' action: - service: script.text_notify_dave metadata: {} data: message: '{%- set days = states(''sensor.daylight_savings_days_until'') | int(0) %} {%- set plural = ''s'' if days | int(0) > 1 else '''' %} Clocks change in {{ days }} day{{plural}}, you will {{ states(''sensor.daylight_savings_phrase'') }}! ' - condition: template value_template: '{{states(''sensor.daylight_savings_days_until'') | int(0) == 0 }}' - service: input_boolean.toggle metadata: {} data: {} target: entity_id: - input_boolean.bst - input_boolean.gmt mode: single - alias: Clock Chime description: '' mode: restart triggers: - minutes: 0 id: '0' trigger: time_pattern - minutes: 15 id: '15' trigger: time_pattern - minutes: 30 id: '30' trigger: time_pattern - minutes: 45 id: '45' trigger: time_pattern conditions: - condition: time after: input_datetime.clock_chime_on_time before: input_datetime.clock_chime_off_time - condition: state entity_id: input_boolean.audible_notifications state: 'on' - condition: state entity_id: input_boolean.clock_chime state: 'on' - condition: or conditions: - condition: state state: 'on' entity_id: binary_sensor.family_home - condition: state entity_id: input_boolean.guest_mode state: 'on' actions: - choose: - conditions: - condition: or conditions: - condition: trigger id: '15' - condition: trigger id: '45' sequence: - condition: or conditions: - condition: state entity_id: input_boolean.clock_chime_quarter_toll state: 'off' - condition: state entity_id: input_select.clock_chime_sound state: Cuckoo Clock - stop: Quarter Toll Disabled - conditions: - condition: trigger id: '30' sequence: - condition: state entity_id: input_boolean.clock_chime_half_toll state: 'off' - stop: Half Toll Disabled default: [] - wait_template: '{{ not is_state("media_player.dave_s_2nd_echo_pop", "playing") }}' continue_on_timeout: false timeout: 00:02:00 - action: script.alexa_voice data: where: living room message: "{% if states(\"input_select.clock_chime_sound\") == \"Cuckoo Clock\"\ \ %}\n {% if trigger.id == \"30\" %}\n