This has got to be so trivial - but the light stubbornly remains off:
Using the Automations UI:
- Trigger set to sunset.
- Condition - Time set to before 23:00
- Action - switch light on.
This renders in YAML to:
- id: '1592063073391'
alias: Fireside Light On at Sunset
- event: sunset
- before: '23:00'
(I’ve set the bulb IP address as static in my router)
I’d be grateful for some help, please?
Is the automation enabled (on). Check the developer tools / states menu.
Are you aware that this will only turn on at sunset? It will not turn on ANY other time? For some reason, I get the impression that you expect it to turn on anytime between sunset and 11pm.
To add to what Petro said…
It also won’t switch back off at 23:00 either. You will need either another automation to do that or some “fancy” coding to get it done in one automation.
Just to keep it simple I would go the two automation route until you get more experience.
I was expecting the light to go on at sunset and turn off at 23:00.
I see now that I need another automation to turn off the light.
I may have been able to do some “fancy” coding in ‘C’ or Perl, but I’m finding YAML particularly opaque!
Many thanks for the replies.
Right. that’s because of the way the trigger in the automation works.
the automation “listens” for the trigger state to be satisfied then it runs the actions as long as the condition(s) is/are met. the trigger only happens at one instant in time. It doesn’t wait around for the conditions to be true to run the actions. If the conditions aren’t true at the instance the trigger becomes true then the actions won’t be run.
It really isn’t bad at all once you get a bit of experience, especially if you have experience coding in other languages.
I assumed that the automation conditions would be periodically polled.
No they are only evaluated after a trigger event.