Aqara temperature sensor (WSDCGQ11LM)
Hi,
I have some issues with Aqara temperature sensor (WSDCGQ11LM). I were set retain: true. The sensor keeping data after restart. But, this is my log:
HA restart at Aug 04 11:15:10. Between Aug 04 11:15 and Aug 04 11:18. The sensor keeping data. Between Aug 04 11:18 and Aug 04 11:23. The value of temperature, humidity, and pressure is empty
Aug 04 11:18:17 hassbian npm[538]: 2018-8-4 11:18:17 INFO MQTT publish, topic: 'zigbee2mqtt/livingroom_sensor_weather', payload: '{"battery":"100.00","voltage":3015}'
Aug 04 11:23:49 hassbian npm[538]: 2018-8-4 11:23:49 INFO MQTT publish, topic: 'zigbee2mqtt/livingroom_sensor_weather', payload: '{"battery":"100.00","voltage":3015,"temperature":30.46}'
Aug 04 11:23:49 hassbian npm[538]: 2018-8-4 11:23:49 INFO MQTT publish, topic: 'zigbee2mqtt/livingroom_sensor_weather', payload: '{"battery":"100.00","voltage":3015,"temperature":30.46,"humidity":71.75}'
Aug 04 11:23:49 hassbian npm[538]: 2018-8-4 11:23:49 INFO MQTT publish, topic: 'zigbee2mqtt/livingroom_sensor_weather', payload: '{"battery":"100.00","voltage":3015,"temperature":30.46,"humidity":71.75,"pressure":1004}'
retain: true keeps data for the MQTT clients (e.g. your home automation software), not for zigbee2mqtt.
When zigbee2mqtt starts it doesn't know the value of the sensor anymore, so it has to wait for the sensor to resend it values.
Is there any way to change this behavior, i.e. to keep sensor values after zigbee2mqtt restart? The aqara sensors send values only on changes over a certain threshold. I had the issue that the temperature of my in-house sensors got updated hours after a restart because the temperature is very constant. I have solved it by storing the last value in HA, but it would be nice to have this already at the source. Another solution would be to poll the sensors after restart, but AFAIR this is not supported by aqara sensors.
This would be a new feature, I've created an issue for it #249