Home-AssistantConfig/automation/sunrise_turnon_and_off.yaml

57 lines
1.6 KiB
YAML
Raw Normal View History

2016-12-21 21:43:52 +00:00
###################################
## Sunrise and Sunset stuff
###################################
- alias: 'Sunset Stuff on'
trigger:
2017-02-02 02:15:33 +00:00
- platform: state
entity_id: sun.sun
state: 'below_horizon'
from: 'above_horizon'
action:
- service: switch.turn_on
entity_id:
- switch.front_door_outlet
2017-02-07 03:50:25 +00:00
- switch.living_room_outlet
- switch.den_outlet
- switch.foyer_outlet
- service: light.turn_on
entity_id:
- light.outdoor_bathroom
2017-02-03 00:05:26 +00:00
- group.living_room_accents
#- delay: '00:{{ (range(1, 20)|random|int) }}:00'
- service: script.monthly_color_scene
- service: script.Voice_notify
2017-02-07 03:50:25 +00:00
data_template:
value1: >
{% macro dark_outside() %}
{{ [
"It is pretty dark outside. I will turn on the outside lights now.",
"It's a little past Sunset. Time to turn on the outside lights. I'm on it.",
"I'll switch on the outside lights. It's getting dark outside.",
"Time to turn on the front lights. I'll take care of it."
] | random }}
{% endmacro %}
2017-02-15 01:51:58 +00:00
{{ dark_outside() }}
######################################################################
- alias: 'Sunset Stuff off'
trigger:
- platform: sun
event: sunrise
offset: '-01:00:00'
action:
- service: light.turn_off
entity_id:
- group.exterior_lights
- group.outdoor_front_lights
- group.outdoor_pool_lights
- group.all_lights
- service: script.interior_off