I am trying to make the light brightness and delay dynamic according to the system time. So I want my living room lights to perform the following action:
At or after 08:00: full brightness with a delay of 30 minutes
At or after 23:00: brightness set to 20% with a delay of 5 minutes
It works partly, at 00:00 it will set the brightness to 20% with a delay of 5 minutes. Whatever value I use in the script (23, 22, 21 etc.), it always performs its action at 00:00. So I think the script performs its ELSE statement. What is wrong with my code?
I found this article and I tried to implement it in my code:
I liked the idea of creating a sensor, as described by @moskovskiy82. This solution works great! Thanks a lot for the help. @CCOSTAN, thank you for sharing your solution as well.
This is a very useful piece of info @moskovskiy82 thanks! As a noob still coming to terms with templating, it is very helpful.
if I’d like my ‘nightfall’ to run, for example, between 11pm and 2am (i’m a night owl), how would i best have it cross the 24/0 threshold? would i require two arguments? one for 11 until 0 and one from 0 until 2? would they need to have different names?
Also, if i wanted to change colour based on time, and have low red lights in ‘night’, would that simply require a second data template for rgb colour? is it as simple as dropping a second data template in the action, or can you not have more than one data template per action?