Hi all!
I’m quite new with home assistant and I’m trying to automate some outside lights which I want to turn on when sun sets and have it turned off after a couple of hours. The only “but” is that the time has to be at least 23:00 so seasonal difference where sun sets in the winter around 18:00 or in summer around 21:00 are not an issue when using a fixed amount of time.
I used to be a Homey automation user where I could set “trigger - condition - action and an else action”. Here I created a timer and when the timer was idle it went to the else if the condition was not met and the else-action would then be to add 10 more minutes to the timer. This would loop until the condition, after 23:00, was met and the timer went to idle to turn off the lights.
I think I need to have an other approach with home automation but I could not find a topic pointing me into the right direction.
Anyone have a idea for me?
What I have for now , and where I want to replace the delay with a timer, is:
- id: '1592462333363'
alias: Garden - Lights on sunset
description: ''
trigger:
- event: sunset
offset: -00:12:00
platform: sun
condition: []
action:
- brightness_pct: 70
device_id: c18977c18d0f49629536b2fd5a79edbb
domain: light
entity_id: light.Garden_light1
type: turn_on
- delay: 01:30:00
- device_id: c18977c18d0f49629536b2fd5a79edbb
domain: light
entity_id: light.Garden_light1
type: turn_off
mode: single