Home-AssistantConfig/config/automation/System/watchdog_light.yaml

55 lines
1.4 KiB
YAML
Executable File

##############################################################################
### Detect when things are on and forgotten about. Like any Good Watchdog.
##############################################################################
- alias: Automated Light WatchDog!
trigger:
- platform: state
entity_id:
- light.hallway
- group.hallway_lights
- group.foyer_lights
- switch.printer_outlet
to: 'on'
for: '00:20:00'
- platform: state
entity_id:
- group.upstairs
- switch.garage_outlet
to: 'on'
for: '02:00:00'
#Turn it off!
action:
- service: homeassistant.turn_off
data_template:
entity_id: "{{ trigger.entity_id }}"
- alias: Make it Right WatchDog!
trigger:
- platform: time_pattern
minutes: '/15'
condition:
- condition: state
entity_id: sun.sun
state: 'above_horizon'
#Turn it off!
action:
- service: homeassistant.turn_off
data_template:
entity_id:
- switch.front_landscaping
- switch.back_landscaping
- light.outdoor_foyer
- light.outdoor_sconce_1
- light.outdoor_sconce_2
- light.outdoor_sconce_3
- light.led_garage_large
- light.led_garage_snip
- light.led_garage_small
- light.led_outdoor_den
- light.outdoor_bathroom