I am pretty sure that this used to work a couple of years ago. Now, it doesn’t. What I want:
Automation description: If Office motion detector says I’m in the office, and it’s between sunset tonight and sun rise next morning, then turn on the desk lamp (basically, do this when it’s dark based on sun).
Automation triggers: every minute
Condition: Sensor must show I’m detected in the office; Must be dark based on sun - therefore, time must fall between sunset the current night, and sun rise the next morning.
What happens: condition fails even though I am inside the window - the sun has set, and it has not yet risen, therefore it’s still dark based on the sun’s state.
What I tried:
- Set to after sunset - works until midnight I think, then, automation no longer triggers.
- Set to before sunrise - Doesn’t work until past midnight, I think. Meaning there is a window between sun setting in the current evening, and HA resetting the “sun” which seems to be midnight!?
I do not want to deal with fixed timings because England could get dark at 10PM during summer, or 3PM during Winter. So if I set to 7, my office will be too dark until 7 in Winter, or it will waste electricity during Summer by turning on the lamp when it’s not needed.
The above way - after sunset / before sunrise used to work before, as I had an automation to control hallway lights that way and it worked. Then after some release I can’t remember, it stopped working.
Posting here first for advice, if this is a bug let me know and I’ll raise a report.