Wondering if someone can tell me why the first automation is working fine but the second one doesn’t work?
I created the 2nd as a duplicate of the 1s so can’t understand why it isn’t working.
This one does work.
alias: Garden lights on at dusk
description: ‘’
trigger:
Please post formatted code. Proper indentation is required for YAML and no one can inspect it when the code is posted unformatted.
Select the code and click the </> icon in the forum’s editor.
Alternately, type three consecutive back-quotes ``` on a separate line before the block of code and then three more on a separate line after the code. Everything between the two sets of triple back-quotes will be automatically formatted.
In addition, the Numeric State Trigger will not trigger if the value is already above the threshold. It only triggers when the value crosses the threshold.
The only significant difference between the two is the second automation’s condition checks a half-hour later.
If the light level rises and crosses the threshold value (9) just after 15:30, the first automation’s action will be executed but not the second one because it requires the time to be after 16:00.
Done. The second automation will no longer be triggered because of the way a Numeric State Trigger works. It only triggers when the value crosses the threshold.
I think that may well be the issue, the value is already above the trigger level by the time the time condition is met.
Any thoughts on how I would achieve this, I want the light to come on when it starts to get dark but not before say 4pm otherwise my living room lights are on for hours before I need them.
Yes I was just typing this as you replied.
Now it can be triggered by either the light level or the time. The condition must check both light level and time because the trigger can be either one.
A Numeric State Condition, unlike a Numeric State Trigger, isn’t concerned about crossing the threshold, just if the value is above the threshold (or below if using the below: option).