I have some item states which are set based in, for example, sunset. So I have this:
Channel 'astro:sun:home:set#event' triggered START
Then I also have:
Item IsItDark changed to ON
But if I restart, they all get set back to NULL and nothing works unless I use the REST API to set everything back on track.
Is there a way to get round this?
What do you have set up for persistence?
Persisting and restoring your “dark” Item covers many cases.
It relies on your openHAB not being out of service for long, as it simply “remembers” the last state of the Item at boot up time.
There is a risk that if you reboot when an event is due - sunset, say - then the restored will be wrong, and stay wrong, until sunrise.
The most complete solution is a rule that runs after boot up, triggered by
This can compare if “now” is before sunrise or after sunset, and set your “dark” Item.
To do that, you would need to set up further Items linked to Astro binding’s state channels. These would get populated with sunrise and sunset times for that day at boot up or each midnight.
This topic was automatically closed 41 days after the last reply. New replies are no longer allowed.