Closed rknall closed 5 years ago
Hi Roland, the code as written is correct. You need to supply each property with the node it belongs too. In this case the node contains both the temperature and humidity properties.
With my change this is exactly what is happening. Both humidity and temperature are contained underneath the status node. Without the change, humidity does not get assigned to the status node, but rather assigned to the parent node, which leads to a different behavior for the variable humidity than temperature has, and furthermore humidity cannot be mapped correctly in openHAB.
have a look at the test file I just added. this works here with the code as is.
https://github.com/mjcumming/HomieV3/blob/master/homie/example_devices/test_temp_hum.py
NFO:homie.device_base:MQTT publish topic: homie/1583e61ee00001/status/humidity, payload: 10
INFO:root:Updated Temperature 10, Humidity 30
INFO:homie.device_base:MQTT publish topic: homie/1583e61ee00001/status/temperature, payload: 10
INFO:homie.device_base:MQTT publish topic: homie/1583e61ee00001/status/humidity, payload: 30
INFO:root:Updated Temperature 90, Humidity 90
INFO:homie.device_base:MQTT publish topic: homie/1583e61ee00001/status/temperature, payload: 90
INFO:homie.device_base:MQTT publish topic: homie/1583e61ee00001/status/humidity, payload: 90
INFO:root:Updated Temperature 50, Humidity 10
INFO:homie.device_base:MQTT publish topic: homie/1583e61ee00001/status/temperature, payload: 50
INFO:homie.device_base:MQTT publish topic: homie/1583e61ee00001/status/humidity, payload: 10
INFO:root:Updated Temperature 10, Humidity 30
INFO:homie.device_base:MQTT publish topic: homie/1583e61ee00001/status/temperature, payload: 10
INFO:homie.device_base:MQTT publish topic: homie/1583e61ee00001/status/humidity, payload: 30
INFO:root:Updated Temperature 90, Humidity 90
INFO:homie.device_base:MQTT publish topic: homie/1583e61ee00001/status/temperature, payload: 90
INFO:homie.device_base:MQTT publish topic: homie/1583e61ee00001/status/humidity, payload: 90
INFO:root:Updated Temperature 50, Humidity 10
INFO:homie.device_base:MQTT publish topic: homie/1583e61ee00001/status/temperature, payload: 50
INFO:homie.device_base:MQTT publish topic: homie/1583e61ee00001/status/humidity, payload: 10
INFO:root:Updated Temperature 10, Humidity 30
Yes it does, due to the fix you introduced to temperature_humidity. It was not correct two days ago, when I pushed the pull request.
Humidity should be transported as node as well.