Mqtt thing data not populated after OH2 restart

Hello and thanks to all for great work you are doing around this project!
I have a question about mqtt (homie3) and oh2

I’m running OH 2.4 with mqtt binding 2.5 m1 (2.4 works same way tho) and mosquitto on localhost. I have several things which are broadcasting homie3.0.1 structured messages and it works just perfect. Auto discovery, bindings, everything.

But, when I restart OH both broker and thing becomes online as i would expect, all channels and everything is ok under paperui -> config -> things, but actual data won’t get populated. They are all UNDEF

Only thing I can do is to remove mqtt thing and disable/enable mqtt broker thing to rediscover not working things. When I readd them, they got populated right away.

So I’m wondering if I’m missing some piece somewhere or it’s normal behaviour?

this is log after system restart and channels are not populated

2019-06-22 12:23:38.433 [hingStatusInfoChangedEvent] - 'mqtt:homie300:home:garden' changed from INITIALIZING to OFFLINE (BRIDGE_OFFLINE)
2019-06-22 12:23:38.470 [hingStatusInfoChangedEvent] - 'mqtt:broker:home' changed from OFFLINE to ONLINE
2019-06-22 12:23:38.474 [me.event.ThingUpdatedEvent] - Thing 'mqtt:broker:home' has been updated.
2019-06-22 12:23:38.559 [hingStatusInfoChangedEvent] - 'mqtt:homie300:home:garden' changed from OFFLINE (BRIDGE_OFFLINE) to ONLINE

both things went online as expected, but after that nothing
and this is log when removing garden thing and disable/enable broker for autodiscovery and data being populated

2019-06-22 12:26:21.543 [hingStatusInfoChangedEvent] - 'mqtt:broker:home' changed from ONLINE to UNINITIALIZED
2019-06-22 12:26:21.568 [hingStatusInfoChangedEvent] - 'mqtt:broker:home' changed from UNINITIALIZED to OFFLINE
2019-06-22 12:26:21.583 [hingStatusInfoChangedEvent] - 'mqtt:broker:home' changed from OFFLINE to UNINITIALIZED (DISABLED)
2019-06-22 12:26:24.062 [hingStatusInfoChangedEvent] - 'mqtt:broker:home' changed from UNINITIALIZED (DISABLED) to INITIALIZING
2019-06-22 12:26:24.068 [hingStatusInfoChangedEvent] - 'mqtt:broker:home' changed from INITIALIZING to OFFLINE
2019-06-22 12:26:24.104 [hingStatusInfoChangedEvent] - 'mqtt:broker:home' changed from OFFLINE to ONLINE
2019-06-22 12:26:24.110 [me.event.ThingUpdatedEvent] - Thing 'mqtt:broker:home' has been updated.
2019-06-22 12:26:24.150 [home.event.InboxAddedEvent] - Discovery Result with UID 'mqtt:homie300:home:garden' has been added.
2019-06-22 12:26:28.374 [vent.ItemStateChangedEvent] - Date changed from 2019-06-22T12:25:28.343+0200 to 2019-06-22T12:26:28.346+0200
2019-06-22 12:26:28.387 [vent.ItemStateChangedEvent] - Time changed from 2019-06-22T12:25:28.343+0200 to 2019-06-22T12:26:28.346+0200
2019-06-22 12:26:32.334 [me.event.InboxRemovedEvent] - Discovery Result with UID 'mqtt:homie300:home:garden' has been removed.
2019-06-22 12:26:32.346 [hingStatusInfoChangedEvent] - 'mqtt:homie300:home:garden' changed from UNINITIALIZED to INITIALIZING
2019-06-22 12:26:32.413 [hingStatusInfoChangedEvent] - 'mqtt:homie300:home:garden' changed from INITIALIZING to ONLINE
2019-06-22 12:26:34.019 [me.event.ThingUpdatedEvent] - Thing 'mqtt:homie300:home:garden' has been updated.
2019-06-22 12:26:34.243 [me.event.ThingUpdatedEvent] - Thing 'mqtt:homie300:home:garden' has been updated.
2019-06-22 12:26:34.287 [vent.ItemStateChangedEvent] - Weather_Humidity changed from UNDEF to 66
2019-06-22 12:26:34.336 [vent.ItemStateChangedEvent] - Weather_Temperature changed from UNDEF to 22.4
2019-06-22 12:26:34.342 [vent.ItemStateChangedEvent] - Weather_Light changed from UNDEF to 1727
2019-06-22 12:26:34.349 [vent.ItemStateChangedEvent] - Weather_Rain changed from UNDEF to No
2019-06-22 12:26:34.353 [vent.ItemStateChangedEvent] - Service_Air changed from UNDEF to ON
2019-06-22 12:26:34.366 [vent.ItemStateChangedEvent] - Light_Creek changed from UNDEF to OFF
2019-06-22 12:26:34.402 [vent.ItemStateChangedEvent] - Service_EAZY changed from UNDEF to ON
2019-06-22 12:26:34.419 [vent.ItemStateChangedEvent] - Weather_LastUpdate changed from 2019-06-22T12:23:38.568+0200 to 2019-06-22T12:26:34.322+0200
2019-06-22 12:26:34.422 [vent.ItemStateChangedEvent] - Light_Garden changed from UNDEF to OFF
2019-06-22 12:26:34.445 [vent.ItemStateChangedEvent] - Service_NEXUS changed from UNDEF to ON
2019-06-22 12:26:34.454 [vent.ItemStateChangedEvent] - Light_Pond changed from UNDEF to OFF
2019-06-22 12:26:34.458 [vent.ItemStateChangedEvent] - Light_Trees changed from UNDEF to OFF
2019-06-22 12:26:34.462 [vent.ItemStateChangedEvent] - Service_UV changed from UNDEF to ON
2019-06-22 12:26:34.466 [vent.ItemStateChangedEvent] - Water_Temperature changed from UNDEF to 22.4
2019-06-22 12:26:35.757 [vent.ItemStateChangedEvent] - Water_LastUpdate changed from 2019-06-22T12:22:29.612+0200 to 2019-06-22T12:26:35.738+0200
2019-06-22 12:26:35.786 [vent.ItemStateChangedEvent] - Weather_Temp_Max changed from NULL to 22.4
2019-06-22 12:26:35.799 [vent.ItemStateChangedEvent] - Weather_Hum_Max changed from NULL to 66
2019-06-22 12:26:35.817 [vent.ItemStateChangedEvent] - Weather_Temp_Min changed from NULL to 22.4

or do I need to persis whole mqtt tree to reinitalise data after OH restart? I thought it would do it automatically when thing gets online because homie is using qos 1

Thanks! :slight_smile:

edit / add:

it looks like it happends as well when installing some new addons, at time of instalation every installed addon went offline and back online. Sadly it means, mqtt channels went to UNDEF and never came back.
Yep remove/add again.

2019-06-22 15:38:14.295 [hingStatusInfoChangedEvent] - 'mqtt:homie300:home:garden' changed from ONLINE to UNINITIALIZED
2019-06-22 15:38:14.335 [hingStatusInfoChangedEvent] - 'mqtt:homie300:home:garden' changed from UNINITIALIZED to UNINITIALIZED (HANDLER_MISSING_ERROR)
2019-06-22 15:38:14.404 [hingStatusInfoChangedEvent] - 'mqtt:broker:home' changed from ONLINE to UNINITIALIZED
2019-06-22 15:38:14.519 [hingStatusInfoChangedEvent] - 'mqtt:broker:home' changed from UNINITIALIZED to OFFLINE
2019-06-22 15:38:14.545 [hingStatusInfoChangedEvent] - 'mqtt:broker:home' changed from OFFLINE to UNINITIALIZED (HANDLER_MISSING_ERROR)
2019-06-22 15:38:14.569 [hingStatusInfoChangedEvent] - 'ntp:ntp:local' changed from ONLINE to UNINITIALIZED
2019-06-22 15:38:14.582 [hingStatusInfoChangedEvent] - 'ntp:ntp:local' changed from UNINITIALIZED to UNINITIALIZED (HANDLER_MISSING_ERROR)
2019-06-22 15:38:14.755 [hingStatusInfoChangedEvent] - 'astro:sun:local' changed from ONLINE to UNINITIALIZED
2019-06-22 15:38:14.761 [hingStatusInfoChangedEvent] - 'astro:sun:local' changed from UNINITIALIZED to UNINITIALIZED (HANDLER_MISSING_ERROR)
2019-06-22 15:38:14.768 [hingStatusInfoChangedEvent] - 'astro:moon:local' changed from ONLINE to UNINITIALIZED
2019-06-22 15:38:14.775 [hingStatusInfoChangedEvent] - 'astro:moon:local' changed from UNINITIALIZED to UNINITIALIZED (HANDLER_MISSING_ERROR)
2019-06-22 15:38:21.535 [hingStatusInfoChangedEvent] - 'ntp:ntp:local' changed from UNINITIALIZED (HANDLER_MISSING_ERROR) to INITIALIZING
2019-06-22 15:38:21.646 [hingStatusInfoChangedEvent] - 'mqtt:broker:home' changed from UNINITIALIZED (HANDLER_MISSING_ERROR) to INITIALIZING
2019-06-22 15:38:21.678 [hingStatusInfoChangedEvent] - 'mqtt:broker:home' changed from INITIALIZING to OFFLINE
2019-06-22 15:38:21.738 [hingStatusInfoChangedEvent] - 'mqtt:broker:home' changed from OFFLINE to ONLINE
2019-06-22 15:38:21.762 [hingStatusInfoChangedEvent] - 'ntp:ntp:local' changed from INITIALIZING to ONLINE
2019-06-22 15:38:21.770 [me.event.ThingUpdatedEvent] - Thing 'mqtt:broker:home' has been updated.
2019-06-22 15:38:21.781 [vent.ItemStateChangedEvent] - Date changed from 2019-06-22T15:37:59.554+0200 to 2019-06-22T15:38:21.785+0200
2019-06-22 15:38:21.805 [vent.ItemStateChangedEvent] - Time changed from 2019-06-22T15:37:59.554+0200 to 2019-06-22T15:38:21.785+0200
2019-06-22 15:38:21.846 [vent.ItemStateChangedEvent] - Date changed from 2019-06-22T15:38:21.785+0200 to 2019-06-22T15:38:21.848+0200
2019-06-22 15:38:21.851 [vent.ItemStateChangedEvent] - Time changed from 2019-06-22T15:38:21.785+0200 to 2019-06-22T15:38:21.848+0200
2019-06-22 15:38:21.958 [hingStatusInfoChangedEvent] - 'mqtt:homie300:home:garden' changed from UNINITIALIZED (HANDLER_MISSING_ERROR) to INITIALIZING
2019-06-22 15:38:22.064 [hingStatusInfoChangedEvent] - 'mqtt:homie300:home:garden' changed from INITIALIZING to ONLINE
2019-06-22 15:38:22.075 [vent.ItemStateChangedEvent] - Weather_Temperature changed from 20.3 to UNDEF
2019-06-22 15:38:22.097 [vent.ItemStateChangedEvent] - Weather_Light changed from 1395 to UNDEF
2019-06-22 15:38:22.099 [vent.ItemStateChangedEvent] - Weather_Humidity changed from 87 to UNDEF
2019-06-22 15:38:22.103 [vent.ItemStateChangedEvent] - Weather_Rain changed from No to UNDEF
2019-06-22 15:38:22.164 [vent.ItemStateChangedEvent] - Service_Air changed from ON to UNDEF
2019-06-22 15:38:22.166 [vent.ItemStateChangedEvent] - Light_Creek changed from OFF to UNDEF
2019-06-22 15:38:22.169 [vent.ItemStateChangedEvent] - Weather_LastUpdate changed from 2019-06-22T15:33:13.457+0200 to 2019-06-22T15:38:22.084+0200
2019-06-22 15:38:22.177 [vent.ItemStateChangedEvent] - Service_EAZY changed from ON to UNDEF
2019-06-22 15:38:22.184 [vent.ItemStateChangedEvent] - Light_Garden changed from OFF to UNDEF
2019-06-22 15:38:22.186 [vent.ItemStateChangedEvent] - Service_NEXUS changed from ON to UNDEF
2019-06-22 15:38:22.201 [vent.ItemStateChangedEvent] - Light_Pond changed from OFF to UNDEF
2019-06-22 15:38:22.203 [vent.ItemStateChangedEvent] - Light_Trees changed from OFF to UNDEF
2019-06-22 15:38:22.205 [vent.ItemStateChangedEvent] - Service_UV changed from ON to UNDEF
2019-06-22 15:38:22.207 [vent.ItemStateChangedEvent] - Water_Temperature changed from 22.4 to UNDEF
2019-06-22 15:38:22.232 [vent.ItemStateChangedEvent] - Water_LastUpdate changed from 2019-06-22T15:27:13.000+0200 to 2019-06-22T15:38:22.161+0200
2019-06-22 15:38:22.530 [hingStatusInfoChangedEvent] - 'astro:sun:local' changed from UNINITIALIZED (HANDLER_MISSING_ERROR) to INITIALIZING
2019-06-22 15:38:22.555 [hingStatusInfoChangedEvent] - 'astro:sun:local' changed from INITIALIZING to ONLINE

I think there have been some bugs fixed for Homie even after the m1 version. You should try the latest snapshot for the binding.

Gotcha,
Is there a way how to update only specific addon? Or I have to copy whole 2.5 snapshot kar file into the addons directory and restart OH

Thanks

I imagine you can do the same thing you did to get MQTT 2.5 M1 running on OH 2.4. Though it’s possible that the latest snapshots won’t work on OH 2.4 because of some recent changes to the core.