zigbee2mqtt icon indicating copy to clipboard operation
zigbee2mqtt copied to clipboard

WSDCGQ11LM values are getting lost with cache_state: true

Open Koenkk opened this issue 8 years ago • 6 comments

Zigbee2mqtt 0.1.7

Log: https://hastebin.com/uvipiliray.js

This sensor supports humidy, temperature and pressure but only 2 values are reported at the same time. It seems that the cache_state mechanism doesn't work correctly.

This causes errors in home assistant graphs. (https://imgur.com/a/uu8JE11)

Koenkk avatar Oct 15 '18 20:10 Koenkk

I have same issue

Oct 16 14:05:08 hassbian npm[28096]:   zigbee2mqtt:info 2018-10-16 14:05:08 MQTT publish, topic: 'zigbee2mqtt/livingroom_sensor_weather', payload: '{"temperature":32.48,"linkquality":123,"humidity":73.68}'
Oct 16 14:05:08 hassbian npm[28096]:   zigbee2mqtt:info 2018-10-16 14:05:08 MQTT publish, topic: 'zigbee2mqtt/livingroom_sensor_weather', payload: '{"humidity":73.68,"linkquality":123,"pressure":1006}'
Oct 16 14:07:19 hassbian npm[28096]:   zigbee2mqtt:info 2018-10-16 14:07:19 MQTT publish, topic: 'zigbee2mqtt/bedroom_sensor_weather', payload: '{"temperature":30.87,"linkquality":170}'
Oct 16 14:07:19 hassbian npm[28096]:   zigbee2mqtt:info 2018-10-16 14:07:19 MQTT publish, topic: 'zigbee2mqtt/bedroom_sensor_weather', payload: '{"temperature":30.87,"linkquality":168,"humidity":78.57}'
Oct 16 14:07:19 hassbian npm[28096]:   zigbee2mqtt:info 2018-10-16 14:07:19 MQTT publish, topic: 'zigbee2mqtt/bedroom_sensor_weather', payload: '{"humidity":78.57,"linkquality":168,"pressure":1005}'

2018-10-16 14:05:08 ERROR (MainThread) [homeassistant.helpers.template] Error parsing value: 'dict object' has no attribute 'humidity' (value: {"temperature":32.48,"linkquality":123}, template: {{ value_json.humidity  | round }})
2018-10-16 14:05:08 ERROR (MainThread) [homeassistant.helpers.template] Error parsing value: 'dict object' has no attribute 'temperature' (value: {"humidity":73.68,"linkquality":123,"pressure":1006}, template: {{ value_json.temperature  | round(1) }})
2018-10-16 14:07:19 ERROR (MainThread) [homeassistant.helpers.template] Error parsing value: 'dict object' has no attribute 'humidity' (value: {"temperature":30.87,"linkquality":170}, template: {{ value_json.humidity  | round }})
2018-10-16 14:07:19 ERROR (MainThread) [homeassistant.helpers.template] Error parsing value: 'dict object' has no attribute 'temperature' (value: {"humidity":78.57,"linkquality":168,"pressure":1005}, template: {{ value_json.temperature  | round(1) }})

mrfoxbit avatar Oct 16 '18 07:10 mrfoxbit

Having the same problem. Probably I am wrong (never used JS before) but it looks like commit 03d913d was missing one additional change. Currently it is necessary to change line 563 of controller.js to 'this.state.set(deviceID, messagePayload)'. As it is now cache state is set to the contents of the last zigbee message thus loosing the current cache contents.

Ton1965 avatar Oct 16 '18 08:10 Ton1965

@Ton1965 nice catch, this indeed fixes this issue, thanks!

Koenkk avatar Oct 16 '18 15:10 Koenkk

Thanks @Ton1965

mrfoxbit avatar Oct 16 '18 16:10 mrfoxbit

so, for the hassio add-on I should write to its developer?

mario-g0 avatar Oct 18 '18 15:10 mario-g0

No just use the edge version of the add on

ryanbeaton avatar Oct 19 '18 02:10 ryanbeaton