eclipse-archived / smarthome

Eclipse SmartHome™ project
https://www.eclipse.org/smarthome/
Eclipse Public License 2.0
862 stars 787 forks source link

[MQTT-Binding / Homie]: No communication possible with Homie-Thing after restart #6828

Open euphi opened 5 years ago

euphi commented 5 years ago

My Homie-V3 test device was auto-discovered correctly and working fine (I manually linked the newly created items). However, after restart, the device is "Online", but communication is ignored by Openhab and any attempt to change state of settable properties results in error:

10:44:46.664 [INFO ] [smarthome.event.ItemCommandEvent     ] - Item 'Lab_Log_Loglevel' received command WARNING
10:44:46.704 [INFO ] [arthome.event.ItemStatePredictedEvent] - Lab_Log_Loglevel predicted to become WARNING
10:44:46.739 [INFO ] [ome.event.ThingStatusInfoChangedEvent] - 'mqtt:homie300:cf9ca1aa:lab_thermo' changed from ONLINE to OFFLINE (COMMUNICATION_ERROR): No connection or readOnly channel!

Restart of the Homie device

10:47:00.724 [INFO ] [ome.event.ThingStatusInfoChangedEvent] - 'mqtt:homie300:cf9ca1aa:lab_thermo' changed from OFFLINE (GONE): Device did not send heartbeat in time to ONLINE (CONFIGURATION_PENDING)
10:47:00.874 [INFO ] [ome.event.ThingStatusInfoChangedEvent] - 'mqtt:homie300:cf9ca1aa:lab_thermo' changed from ONLINE (CONFIGURATION_PENDING) to ONLINE
10:54:25.145 [INFO ] [smarthome.event.ItemCommandEvent     ] - Item 'Lab_Log_EnableDisableLogToSerialInterface' received command OFF
10:54:25.202 [INFO ] [arthome.event.ItemStatePredictedEvent] - Lab_Log_EnableDisableLogToSerialInterface predicted to become OFF
10:54:25.264 [INFO ] [ome.event.ThingStatusInfoChangedEvent] - 'mqtt:homie300:cf9ca1aa:lab_thermo' changed from ONLINE to OFFLINE (COMMUNICATION_ERROR): No connection or readOnly channel!
10:54:25.293 [INFO ] [smarthome.event.ItemStateChangedEvent] - Lab_Log_EnableDisableLogToSerialInterface changed from ON to OFF

No messages are sent to the MQTT broker by openhab, received messages are ignored.

Please note that the device is treated as online, as long as no command is sent to it. (If it disconnects or is "lost" this is also correctly detected by Openhab)

Also, the channels are no longer configurable after Openhab was restarted once after the Thing and its channels were auto-discovered. Just after auto-discovery it was possible to edit the channel configuration:

Screenshot of PaperUI ("Edit-Pen" missing for channels (same behaviour if device is still seen as "online"): image

Screenshot of PaperUI Control (no dropdown with valid Enum values for Loglevel):

image

PS: A manually added MQTT thing (Homie-2.0, so not auto-discoverable) works fine.

PPS: See also #6823 - this issue happend before the first retart of Openhab after the Homie-Thing was added.

PPPS: For completness, log of MQTT communication:

homie/lab_thermo/$state lost
homie/lab_thermo/$state init
homie/lab_thermo/$homie 3.0.1
homie/lab_thermo/$name Lab
homie/lab_thermo/$mac A0:20:A6:21:D0:53
homie/lab_thermo/$localip 192.168.0.155
homie/lab_thermo/$nodes Sensor,Log
homie/lab_thermo/$stats uptime
homie/lab_thermo/$stats/interval 0
homie/lab_thermo/$fw/name Test-Homie-V3
homie/lab_thermo/$fw/version 0.1.1
homie/lab_thermo/$fw/checksum 85594e520a110816a7a791f9c1b8f60d
homie/lab_thermo/$implementation esp8266
homie/lab_thermo/$implementation/config {"name":"Lab","device_id":"lab_thermo","wifi":{"ssid":"IA216"},"mqtt":{"host":"192.168.0.220","port":1883,"base_topic":"homie/","auth":false},"ota":{"enabled":true},"settings":{}}
homie/lab_thermo/$implementation/version 3.0.0
homie/lab_thermo/$implementation/ota/enabled true
homie/lab_thermo/Sensor/$name Sensor (Temperatur & Luftfeuchte)
homie/lab_thermo/Sensor/$type sensor_t_h
homie/lab_thermo/Sensor/$properties degrees,relH
homie/lab_thermo/Sensor/degrees/$name Temperatur
homie/lab_thermo/Sensor/degrees/$datatype float
homie/lab_thermo/Sensor/degrees/$unit °C
homie/lab_thermo/Sensor/degrees/$format -50:100
homie/lab_thermo/Sensor/relH/$name relative Luftfeuchte
homie/lab_thermo/Sensor/relH/$datatype float
homie/lab_thermo/Sensor/relH/$unit %
homie/lab_thermo/Sensor/relH/$format 0:100
homie/lab_thermo/Log/$name Logger
homie/lab_thermo/Log/$type Logger
homie/lab_thermo/Log/$properties Level,LogSerial
homie/lab_thermo/Log/Level/$name Loglevel
homie/lab_thermo/Log/Level/$settable true
homie/lab_thermo/Log/Level/$datatype enum
homie/lab_thermo/Log/Level/$format DEBUG,INFO,WARNING,ERROR,CRITICAL
homie/lab_thermo/Log/LogSerial/$name enable/disable log to serial interface
homie/lab_thermo/Log/LogSerial/$settable true
homie/lab_thermo/Log/LogSerial/$datatype boolean
homie/lab_thermo/$state ready
homie/lab_thermo/Log/ERROR/SensorNode Cannot read humidity on I2C
homie/lab_thermo/Sensor/relH 0
homie/lab_thermo/Log/ERROR/SensorNode Cannot read temperature on I2C
homie/lab_thermo/Sensor/degrees 15.00
homie/lab_thermo/$stats/signal 10
homie/lab_thermo/$stats/uptime 27