Failed to parse state from DateTime with Remote openHAB 2 ==> 3

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.

Have you applied a profile to that OH3 Item-remoteopenhab:server:xxx channel link?

Looking what is at index 23 in your string, I think you provide to many numbers. If I correctly remember, what is expected is by default milliseconds, so 3 numbers after the last point.

I had previously. I think cleaning the cache fixed that.

Confirmed, milliseconds are expected.

That would be a bug in OH2 core then, not parsing a ISO string into the form ‘preferred’ by openHAB for a DateTime state? (or rejecting it if it doesn’t like it)
And that bug is also carried into OH3 which is updating its DateTime Item with it as well? (albeit with a complaint)

The date format I used in the remote openHAB binding is normally the default date time format defined by the core framework for a DateTime item state.

By the way, it would be better to send a DateTimeType rather than a string in the place (rule?) the OH2 item state was updated.

I don’t know how to do that.

I triend changing the DateTime item to a string in both OH’s, did a cleancache and restart of both. But OH3 is not picking up the changes.

OH2
String eBUSrestart_lastUpdate "eBUS restarted at [%s]" <time>

OH3

String eBUSrestart_lastUpdate "eBUS restarted at [%s]" <time> (gWarmtepomp) {channel="remoteopenhab:server:esera:eBUSrestart_lastUpdate"}

For now I moved the rule from OH2 to OH3, then I get what I want.

Thnx for your time anyway.