Home-AssistantConfig/config/automation/Timed_Triggers/sunset_turn_on.yaml

58 lines
1.5 KiB
YAML
Executable File

###################################
## Sunrise and Sunset stuff
# @CCOSTAN
# Original Repo : https://github.com/CCOSTAN/Home-AssistantConfig
###################################
- alias: 'Sunset Stuff on'
id: d0db568c-0aa2-42cc-b5be-ba546e39b639
mode: queued
trigger:
- platform: sun
event: sunset
offset: "-00:15:00"
condition:
- condition: template
value_template: "{{ states('binary_sensor.powerwall_grid_status') == 'on' }}"
action:
- delay: '00:{{ (range(1, 20)|random|int) }}:00'
- service: script.speech_engine
data:
call_dark_outside: 1
call_window_check: 1
- service: homeassistant.turn_on
entity_id:
- switch.front_landscaping
- switch.villaneri
- light.bedroom
- group.outdoor_seasonal
- service: script.monthly_color_scene
- service: light.turn_on
entity_id:
- light.outdoor_bathroom
data:
brightness: >
{% if states.group.family.state == 'home' -%}
10
{% else %}
150
{% endif %}
- wait_template: >-
{{ states.group.family.state == 'home' }}
- service: homeassistant.turn_on
entity_id:
- group.master_bathroom_accents
- switch.back_landscaping
- switch.front_door_outlet
- switch.foyer_outlet
- switch.den_outlet
- switch.front_office_window
- switch.living_room_outlet
- switch.living_room_tv_outlet
- service: light.turn_on
entity_id:
- light.living_room_accents