Hi!
I'm new on HA (just few days old π ) I have an light/motion automation and I want it to run at 30 min before sunset and stop at 23:30. Now I have after sunset -00:30 and before sunrise -08:00. And didn't stop at 23:30 but it not end at 23:30. Can I combine sunset and hour ?
Let's say to run before sunset -00:30 and stop at 23:30. I don't want to make time related I want it to run at sunset
#Sunset/sunrise and hour
1 messages Β· Page 1 of 1 (latest)
You mean in your conditions? Youβd just have two conditions. One for the sun, and another for the time.
Now I have one condition for tsun and 2 for person location and main light switch. Do you mean that I have to make one condition for the sun and one for the time separately?
Yup. One for the sun and one for time.
Just tested, I have set-up time to 22:36 and still run.
Post the YAML for your automation.
Please use a code share site to share code or logs, for example:
- https://dpaste.org/ (select YAML for the language, and consider picking a longer expiry)
- http://pastie.org/ (select YAML for the language)
- https://paste.debian.net/ (you guessed it, select YAML as the language)
Please don't use Pastebin, since it can randomly add spaces to the main view. Please also don't share text as images since it makes it harder for people to help you. Remember that others may have colour blindness, impaired vision, etc.
I want this automation to work at 30min before sunset and end at 23:30
Are you pressing the RUN button in the GUI? That'll skip the conditions
The automation work very good: it start on sunset, light up on motion triggered, turn off light after 1 min (if no motion) but it run also after 23:30 π
Its based on that
π€ .. now I see the code... I guess I have to change the time check condition from "or" to "and" ... π³
gonna test...
Yes, it now has to be either after sunset (minus 30 minutes) or before 23:30
You can remove the entire weekday part if you want it on every day
π It work's . I've changed building block condition from or to and... Thank you both... π
Great, can you please mark this thread as resolved, by adding the tag?
It has to be set the weekday to work... Today after sunset it hasn't until I added weekdays
Did you remove them in the GUI? That will leave an empty weekday: line, you need to remove that in YAML mode