Closed GoogleCodeExporter closed 8 years ago
As you notice yourself, it is absolutely normal that the state is unknown after
a restart of openHAB. And using the last known state can be completely wrong,
so this is not done as a default behavior.
Nonetheless, openHAB supports this use case through its persistence services.
Please have a look at https://code.google.com/p/openhab/wiki/Persistence
openHAB 1.2 uses rrd4j as its default persistence service, which supports the
"restoreOnStartup" strategy. So in your rrd4j.persist file, you can decide for
which items you want their last known state to be restored at startup (don't
miss to add the rrd4j addon to your runtime).
Original comment by kai.openhab
on 24 Apr 2013 at 2:21
Actually the Binding tries to read all actual values from all configured
devices on every config change. That should include startup as well, but
apparently doesn't. This is a timing problem, because the CCU registering must
have happened before and all items must be known. The latter seems to be the
missing point.
@Kai: Could you perhaps provide me a hint from where where to call the
queryAndSendAllActualStates method?
Original comment by thomas.letsch.de
on 24 Apr 2013 at 6:35
@Thomas: Is it only possible to "query and send all actual states" for ALL
connected devices at once? Or could you also query a subset, i.e. as soon as
the item file is read you send a query for the contained items to the CCU?
Original comment by kai.openhab
on 24 Apr 2013 at 7:05
@Thomas: Btw, does openHAB recognize if the CCU or the LAN Adapter were
restarted and re-register?
Original comment by ingo.the...@googlemail.com
on 24 Apr 2013 at 7:12
[deleted comment]
@Kai:
Thats possible with queryAndSendActualState(..). Do you already have an idea
where to plug the querying of the devices?
@Ingo:
No, currently not. Lets open an issue for that.
Original comment by thomas.letsch.de
on 19 May 2013 at 1:45
As this issue is closed as rejected, let's continue discussion on state
initialization in issue 263.
Original comment by kai.openhab
on 19 May 2013 at 7:16
Original issue reported on code.google.com by
ingo.the...@googlemail.com
on 24 Apr 2013 at 6:22