MySensors MQTT integration no longer working after Ubuntu 20.04 LTS upgrade

Hello everybody,

Until this morning, I had a working MySensors integration on Home Assistant using the MQTTGateway. This morning, I upgraded my host-system to Ubuntu 20.04 LTS, and although Home Assistant itself is running perfectly, I can’t seem to get the MySensors integration part working again. I am not completely sure this is related to the upgrade, but it would be a very unlucky coincidence :wink:

I am running Home Assistant 0.109.3 using Hass.io, installed with Home Assistant supervised installer, running on an Intel NUC, on a Ubuntu 20.04 LTS server, upgrading from a Ubuntu 18.04 LTS server.

My configuration is still quite simple, with 2 remote sensors, one publishing the temperature based on a Dallas sensor, the other publishing both TEMP/HUM based on a DHT22. The configuration.yaml looks like this:

mysensors:
  gateways:
    - device: mqtt
      persistence_file: '/tmp/mysensors.json'
      topic_in_prefix: 'MySensorsOut'
      topic_out_prefix: 'MySensorsIn'

Now, the problem is in my opinion easily pinpointed to the MySensors integration, as the MQTTGateway has always continued writing sensor-values to the Queue, but since the update, no entities are created anymore.

In the Gateway logs, it looks ok aswell, I think.

0 MCO:BGN:INIT GW,CP=RNNGA—,FQ=16,REL=255,VER=2.3.2
4 TSM:INIT
5 TSF:WUR:MS=0
12 TSM:INIT:TSP OK
13 TSM:INIT:GW MODE
15 TSM:READY:ID=0,PAR=0,DIS=0
18 MCO:REG:NOT NEEDED
695 GWT:TPC:IP=xxx.xxx.xxx.xxx
1697 MCO:BGN:STP
1699 MCO:BGN:INIT OK,TSP=1
1816 GWT:TPC:IP=xxx.xxx.xxx.xxx
2820 GWT:RMQ:CONNECTING…
3027 GWT:RMQ:OK
3030 GWT:TPS:TOPIC=MySensorsOut/0/255/0/0/18,MSG SENT
3036 TSM:READY:NWD REQ
3041 ?TSF:MSG:SEND,0-0-255-255,s=255,c=3,t=20,pt=0,l=0,sg=0,ft=0,st=OK:
> 18961 TSF:MSG:READ,2-2-0,s=0,c=1,t=0,pt=7,l=5,sg=0:23.2
> 18966 GWT:TPS:TOPIC=MySensorsOut/2/0/1/0/0,MSG SENT
> 55791 TSF:MSG:READ,1-1-0,s=0,c=1,t=1,pt=7,l=5,sg=0:64.3
> 55797 GWT:TPS:TOPIC=MySensorsOut/1/0/1/0/1,MSG SENT

In the logs, I can see that the Home Assistant plugin is loaded correctly, and that a subscription is successfully done.

2020-05-04 14:11:16 INFO (MainThread) [homeassistant.setup] Setting up mysensors
2020-05-04 14:11:16 DEBUG (SyncWorker_9) [mysensors.persistence] Loading sensors from persistence file /tmp/mysensors.json
2020-05-04 14:11:16 DEBUG (SyncWorker_2) [mysensors.persistence] Saving sensors to persistence file /tmp/mysensors.json
2020-05-04 14:11:16 INFO (SyncWorker_4) [homeassistant.loader] Loaded google_translate from homeassistant.components.google_translate
2020-05-04 14:11:16 INFO (MainThread) [homeassistant.setup] Setting up tts
2020-05-04 14:11:16 INFO (MainThread) [homeassistant.setup] Setup of domain mysensors took 0.1 seconds.
2020-05-04 14:11:16 INFO (MainThread) [mysensors.gateway_mqtt] Setting up initial MQTT topic subscription
2020-05-04 14:11:16 DEBUG (MainThread) [mysensors.gateway_mqtt] Subscribing to: MySensorsOut/+/+/0/+/+, qos: 0
2020-05-04 14:11:16 DEBUG (MainThread) [mysensors.gateway_mqtt] Subscribing to: MySensorsOut/+/+/3/+/+, qos: 0
2020-05-04 14:11:16 INFO (MainThread) [homeassistant.setup] Setup of domain tts took 0.0 seconds.
2020-05-04 14:11:16 INFO (MainThread) [homeassistant.setup] Setting up hassio
2020-05-04 14:11:16 INFO (MainThread) [homeassistant.setup] Setup of domain hassio took 0.0 seconds.
2020-05-04 14:11:17 INFO (MainThread) [homeassistant.bootstrap] Home Assistant initialized in 9.94s
2020-05-04 14:11:17 INFO (MainThread) [homeassistant.core] Starting Home Assistant
2020-05-04 14:11:17 INFO (SyncWorker_3) [homeassistant.components.zeroconf] Starting Zeroconf broadcast
2020-05-04 14:11:17 INFO (MainThread) [homeassistant.core] Timer:starting

I also know this subscription works well, because creating a manual topic causes the system to react. Publishing MySensorsOut/3/0/0/0/0 causes the following item in the logs:

2020-05-04 14:16:22 DEBUG (MainThread) [mysensors.gateway_mqtt] Receiving 3;0;0;0;0;20
2020-05-04 14:16:22 WARNING (MainThread) [mysensors] Node 3 is unknown
2020-05-04 14:16:22 ERROR (MainThread) [mysensors.handler] Node 3 is unknown, will not add child 0

Other things I have allready tried, without success:

  • Restore of a snapshot from when MQTT was still working. Both with Restore and Restore & Wipe. Strangely enough, this doesn’t change anything.
  • Disabling and re-enabling of the Mysensors-integration.
  • Disabling the persistance-part in the config.
  • Restarting the MQTTGateway.
  • Restarting almost everything else including emptying the MQTT-queue.
  • Update to 0.109.

I have little knowledge about the exact mechanics of the HA MySensors integration. Can anybody else think of something else that could be causing this?

Many thanks & Stay healthy!
Hans.

Hello Friends,

It looks like the solution to this was actually quite simple. The only components that I did not restart were the sensors themselves. Once I pulled the battery out of one of them, they immediately started to show up again in my dashboards.

Hans.

I think the gateway requests also the presentation from nodes every now and then. Not sure thought.

Interesting why it didn’t load the sensors from persistence file. If the os update was the only one.

Well glad you got it sorted!

Indeed, it looks like Home Assistant is initially only listening on topics x/x/0/x/x and x/x/3/x/x, and since the values themselves are published on x/x/1/x/x, I’m guessing it needed a new presentation-message first (which I triggered by the restart of the nodes).