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

66 lines
2.6 KiB
YAML
Executable File

###################################
## Sunrise and Sunset stuff
###################################
- alias: 'Sunset Stuff off'
trigger:
- platform: sun
event: sunrise
offset: '-02:00:00'
action:
- service: script.interior_off
- service: homeassistant.turn_off
entity_id:
- group.landscaping
- service: script.tweet_engine_image
data_template:
tweet: >
{{ [
"Even though they are sleeping, I still turn off the outdoor lights before sunrise.",
"Birds are awake, tweeting and chirping and so is the Bear Stone House. Good morning everyone!",
"It was a beautiful sunrise. Time to turn off the exterior lights. (https://www.vcloudinfo.com/2017/08/diy-outdoor-smart-home-led-strips.html)",
"If the sun is out, we do not need the exterior lights on. (https://github.com/CCOSTAN/Home-AssistantConfig#landscaping)",
"The sun is up so it is time to turn the outside lights off.",
"I see the sun! Time to turn off the outside lights",
"The Sun is up!",
"Dawn has broken in #Florida. Turning off the outside lights. ",
"Everyone will be up soon so time to turn off the outdoor landscaping lights. (https://www.vcloudinfo.com/2018/09/unboxing-philips-hue-calla-landscape.html)",
"Good morning Twitter, the sun is up so it is time for me to turn the outside lights off."
] | random + "#HomeAutomation"}}
image: >-
{{ [
"/config/www/custom_ui/floorplan/images/branding/sunrise.png",
"/config/www/custom_ui/floorplan/images/branding/sunrise2.png",
"/config/www/custom_ui/floorplan/images/branding/Bear_Stone_Coffee.png"
] | random }}
- delay: '00:{{ range(0,5) | random | int }}{{ range(0,9) | random | int }}:00'
- service: homeassistant.turn_off
entity_id:
- group.exterior_lights
- light.outdoor_front_lights
- light.outdoor_pool_lights
- group.outdoor_xmas_lights
- service: light.turn_off
entity_id: all
- wait_template: >-
{{ states.sun.sun.state == 'above_horizon' }}
- service: homeassistant.turn_off
entity_id:
- group.master_bathroom_accents
- group.exterior_lights
- light.outdoor_front_lights
- group.outdoor_xmas_lights
- service: input_boolean.turn_off
entity_id:
- input_boolean.medicine
- input_boolean.daylight_override
- input_boolean.guest_mode
- service: homeassistant.update_entity #Look for a new Home Assistant Version
entity_id: binary_sensor.updater