I have my ras pi 3 with aeon stick turn on two sets of lights i’ve grouped called “downstairs” at sunrise.
What I don’t really want is another section showing on home assistant, right now i have a section called “Automation” showing my sunrise and sunset timers. What i can’t find or figure out, can i put a second action within these to turn the lights off? OR does it have to be another “automation” section?
See my script:
You could add further actions (such as a delay followed by a light.turn_off. It’s likely to be better however to use further automations to turn the lights off, so that if you restart HA during that time window, the lights still turn off.
If you don’t want to see the new autmation look at the hidden option in customize or create a default view and only add what you want to see. (note everything will go away unless you add it to a view)
Thank you all for the answers/suggestions. I actually figured it out from piecing together a few other snippets I found throughout the forums. Then my indention was apparently off and that was a learning experiencing figuring out how I broke that LOL. Glad I did as I understand the syntax better now.
Bump. Anyone spot anything wrong with the automation 2? I added the delay and turn_off because obviously if we’re not home i don’t want the lights on all day. automation 1 is working. automation 2 did work, until I added the delay and second service entry. It was also set to a time, instead of sunset.
I was trying to turn them on 30 minutes prior to sunrise. Leave them on for 2 hours 45min’s and turn them off.
Here’s the latest version. I don’t see anything wrong… but then I’m a php developer not a python developer
Ok, i have the plex error fixed. Apparently when it creates the plex.conf, after discovering the plex server it incorrectly creates the parameters.
following the link below, the error disappeared. Guess I’ll see this evening if this causes the automation to work now.
Side note: the plex server had been off for a very long time. I recently just started using it again and thus why it makes sense that this only became a problem recently.
Have a look at my configuration there - Everything is under a single “automation:” section with each alias preceded by a “-” - Give that a try if nothing shows up in the log.
I’ll go look at that, I don’t mind the multiple automation sections. However, the original problem of the automation not working has been solved. After i sunrise stopped working, and then my tinkering, my other automation sunset stopped working. No errors, showing triggered, etc.
I upgraded from .43 to .49. I also changed my delay that triggers the lights off to a random generated sequence. code: delay: '{{ (range(0, 2)|random|int) }}:{{ (range(1, 59)|random|int) }}:00'
In the end nothing really changed from the first post after I added the delays, with 1 exception. I lowered the transitions to 120 seconds. Previously they were 900 and 450
This morning I got up to the lights being on. Hoping to see that the lights go off soon and come back on this evening. we’re leaving tomorrow for vacation.