I have an openHAB 2.5.12 setup which reads my Valliant eBUS. My main openHAB is 3.1.0 which uses Remote openHAB to read from the other openHAB install.
My openHAB2 items etc:
Switch eBUSrestart "eBUS restarted within last 5 min." <switch> {expire="5m,state=OFF"}
DateTime eBUSrestart_lastUpdate "eBUS restarted at [%1$td-%1$tm-%1$tY, %1$tR]" <time>
rule "Restart eBUS binding"
when
Thing "ebus:bridge:62ae3bf8" changed from ONLINE //or
//Item Test_switch changed
then
logInfo("Restart eBUS", "eBUS offline, restarting...")
executeCommandLine("/usr/bin/ssh -p 8101 -i /home/esera/karaf_keys/openhab.id_rsa openhab@localhost bundle:restart org.openhab.binding.ebus", 6000)
eBUSrestart.sendCommand(ON)
end
My openhab 3 items etc:
Switch eBUSrestart "eBUS restarted within last 5 min." <switch> (gWarmtepomp) {channel="remoteopenhab:server:esera:eBUSrestart"}
DateTime eBUSrestart_lastUpdate "eBUS restarted at [%1$td-%1$tm-%1$tY, %1$tR]" <switch> (gWarmtepomp) {channel="remoteopenhab:server:esera:eBUSrestart_lastUpdate"}
Now if I manually switch eBUSrestart ON within OH2 I see this in the log:
2021-07-20 13:31:53.463 [ome.event.ItemCommandEvent] - Item 'eBUSrestart' received command ON
2021-07-20 13:31:53.468 [vent.ItemStateChangedEvent] - eBUSrestart changed from OFF to ON
2021-07-20 13:31:53.479 [vent.ItemStateChangedEvent] - eBUSrestart_lastUpdate changed from 2021-07-20T13:23:21.064140+0200 to 2021-07-20T13:31:53.474857+0200
And this in OH3:
2021-07-20 13:31:53.465 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'eBUSrestart' changed from OFF to ON
2021-07-20 13:31:53.465 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'eBUSrestart_lastUpdate' changed from 2021-07-20T13:28:20.983364+0200 to 2021-07-20T13:31:53.464989+0200
2021-07-20 13:31:53.466 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'eBUSrestart_lastUpdate' changed from 2021-07-20T13:31:53.464989+0200 to 2021-07-20T13:31:53.465044+0200
==> /var/log/openhab/openhab.log <==
2021-07-20 13:31:53.466 [INFO ] [del.script.Restart eBUS notification] - eBUS offline, restarting...
2021-07-20 13:31:53.474 [WARN ] [l.handler.RemoteopenhabBridgeHandler] - Failed to parse state "2021-07-20T13:31:53.474857+0200" for item eBUSrestart_lastUpdate: Text '2021-07-20T13:31:53.474857+0200' could not be parsed at index 23
==> /var/log/openhab/events.log <==
2021-07-20 13:31:53.475 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'eBUSrestart_lastUpdate' changed from 2021-07-20T13:31:53.465044+0200 to UNDEF
==> /var/log/openhab/openhab.log <==
2021-07-20 13:31:53.476 [WARN ] [l.handler.RemoteopenhabBridgeHandler] - Failed to parse state "2021-07-20T13:31:53.474857+0200" for item eBUSrestart_lastUpdate: Text '2021-07-20T13:31:53.474857+0200' could not be parsed at index 23
That probably has something to do with the new java time in OH3 I’ve read DateTime Conversion (openHAB 3.x) , but I don’t know what to do.
And second issue is when eBUSrestart changes to OFF in OH2:
2021-07-20 13:34:37.945 [ome.event.ItemCommandEvent] - Item 'eBUSrestart' received command OFF
2021-07-20 13:34:37.950 [vent.ItemStateChangedEvent] - eBUSrestart changed from ON to OFF
In OH3:
2021-07-20 13:34:37.947 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'eBUSrestart' changed from ON to OFF
2021-07-20 13:34:37.947 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'eBUSrestart_lastUpdate' changed from UNDEF to 2021-07-20T13:34:37.947037+0200
2021-07-20 13:34:37.947 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'eBUSrestart_lastUpdate' changed from 2021-07-20T13:34:37.947037+0200 to 2021-07-20T13:34:37.947061+0200
Why is it updating the timestamp? I would say that would be impossible with my rules? And why does it successfully update the timestamp in OH3 where it would fail if I switch it ON?
I’ve tried adding autoupdate="false"
to both items, but that doesn’t change a thing.
UPDATE: Second issue has been resolved by a restart and clean cache on both OH’s.