I do know thereās an issue that I just canāt seem to fix. One day Iāll revisit it. Because there are so many scenarios, the problem shows up when you restart HA during a small window of time, it comes from the sun falling and time. That window is usually around 1 am to 3 am when restarting Home Assistant. I thought I was the only one working at that hour, most people are sleeping!
Hi @Blacky
Sorry, I know itās confusing but if we just look at it like this, maybe itāll be easier to understand.
I have the following automation that turns on/off based on a entity state. If I reboot HA after itās turned on, when HA finished restarting, all the lights controlled by this automation turn off. It could be 1 minute after they turn on or hours, itās not between 1 and 3 AM or anything too late.
Yes, that helps me understand. Because this blueprint covers so many scenarios, itās really hard to get all the conditions right. Youāre dealing with entity ON/OFF plus Time OFF, which makes it nearly impossible to cover every situation perfectly.
What Iāll do is update the blueprint to include an option to enable or disable the HA restart feature. This way, if you prefer, you can turn it off. The chances of something going wrong after a restart are very low, so disabling it would likely be the best option.
Keep an eye out for the next update, then simply disable HA restart.
Smart Lighting: Your Lights, Your Way - Take Control and Customize it to Perfection!
New Feature
HA Restart: Added an option to enable or disable the HA restart safeguard option. Because this automation supports many scenarios, the HA Restart safeguard option may not always behave as expected. In most cases it works fine, so itās enabled by default. However, if you find it causes issues in your setup, you can disable this option. In most cases, when HA restarts, the automation will not land on an ON or OFF state, so disabling this option gives you a higher chance that nothing goes wrong.
If you like this blueprint? Consider hitting the button in the top post
If you like my blueprints, and would like to show your support or just say thank you? Click Here
You are using a device as a light. Only entities are allowed. See this FAQ (my other blueprint FAQ but is the same) on how to expand it down to an entity, click here..
Hi @Blacky, thanks for this wonderful blueprint. You mention here that different values will be fine ā however, for dynamic lighting, thereās a hardcoded check that only runs interpolation when elevation is > -10. Iād like to set up my dimming to run from sun elevation falling from -10 to -30 (where -30 is 10pm). I could use night lights but Iād prefer an even dim down to my minimum. Any particular reason why -10 is set as an arbitrary cut off?
Edit: would something like the following not work as a simpler alternative (unless it interferes with night lights?
{% if elevation >= dynamic_lighting_sun_elevation_end_falling %} #maybe add a upper bound?
... # interpolate
{% else %}
... # clamp to min (or max)
{% endif %}
This setting is to force the min / max value depending on your DL selection. The sun elevation was design to mimic the sun and at -10 it should be completely dark.
If you would like it to go to 10pm then consider using the DL Time options 10, 11, 12 or 13.
Thanks for the note! Basically what Iām trying to do is start the lights when itās dark out based on solar elevation and then continually dim until we sleep (so not like true adaptive lighting based on solar cycle but more like ābright when itās dark and dim slowly till some solar timeā). I guess I could use ambient light or solar trigger and then time based dynamic lighting
Hi, Iām wondering is it possible to enable the light activation by sensor only in the noon. I want to turn the light on automatically when there is bad weather
Yes⦠you just need a sensor that detects what you consider ābad weather,ā and defines what you call ānoon.ā Once youāve created that sensor, you can use it in Trigger ā Entity State.
thank you for all the blueprints and the time and effort!
I have a question though, much like networkcrasher mentions, I have something weird: when HA restarts all my lights switch on (when they shouldnt and they were off before the restart).This also happens with other lights than the example below that use the same blueprint.
I just noticed the āHA restartā option, I will try that but do you think this will be able to help in this case?