Hello,
I used to have this working:
condition: sun
after: sunset
before_offset: "1:40:00"
Now, no more. The condition never passes until the sunset it’s reach which it’s not the purpose.
What is wrong?
Hello,
I used to have this working:
condition: sun
after: sunset
before_offset: "1:40:00"
Now, no more. The condition never passes until the sunset it’s reach which it’s not the purpose.
What is wrong?
Will not contest your ‘used to’ but it is a bit odd from my pov… I would expect a ‘after’ with a ‘after_offset’ …the latter could be negative. Maybe things got ‘fixed’ and now you cannot mix them anylonger?
Well, just trying that unique condition and it’s never true.
This is not the one used to worked, but part of it, time before sunset.
The code is from the UI.
Is this the fix you mentioned?: Sunset/Sunrise condition not working as per documentaion · Issue #70781 · home-assistant/core · GitHub , but can not come true the condition of time before sunset
Not really but it comes close… seeing the setup of the sun automation, I would expect a ‘before’ to tie up with ‘before_offset’ and similarly for ‘after’…it would make sense imo.
Just my 2cts… you could try this out by changing the sun sensor attribs data in Developer Tools > States
That is not configured correctly. You can’t use an after offset with a before condition.
See the graphic at the bottom of this section: https://www.home-assistant.io/docs/scripts/conditions/#sun-condition Also see the first example.
When do you want the condition to be true?
I suspect you want this:
condition: sun
after: sunset
after_offset: "-1:40:00"
Which will be true from 1h40m before sunset to midnight.
Forgot to mention I tried also negative value, but the condition didn’t pass either and it was like forty minutes for the sunset
And I want just that: trigger a light 1 hour and 40 minutes before the sunset.
But that is a condition, not a trigger?
The problem is the UI it is not able to do that I guess.
So if I understand correctly, from midnight to 1h40 after the sunrise would be:
condition: sun
before: sunrise
before_offset: "1:40:00"
Thanks for the explanation and help.
Yeah, the trigger to switch on the light is a motion sensor and a door sensor, sorry for missusing the words.
Correct.