zigbee2mqtt icon indicating copy to clipboard operation
zigbee2mqtt copied to clipboard

Tuya water leak does not reports periodically its status

Open galbip opened this issue 4 years ago • 8 comments

What happened?

Tuya TS0207_water_leak_detector reports its status only when the "leak sensor" changes status. No periodical reports if "leak sensor" status is not changing.

What did you expect to happen?

A water leak should periodically, (at least once a day) send its status regardless there is a water leak or not. This assure the sensor is working and ready to send alarm when water leak will happen.

I don't know if this is a sensor issue/behaviour or something related to zigbee2mqtt

How to reproduce it (minimal and precise)

No response

Zigbee2MQTT version

1.25.1 commit: 3f6a137

Adapter firmware version

0x26720700

Adapter

Conbee II

Debug log

No response

galbip avatar Jun 16 '22 11:06 galbip

I use a

Zigbee Model: TS0207
Zigbee Manufacturer: _TZ3000_upgcbody
Model: ts0207_water_leak_detector

and last_seen is regularly updated every <2 hours. Maybe it updates regularly because of enabled battery reporting like this? image

AlexKay88 avatar Jun 21 '22 16:06 AlexKay88

thanks. I have exactly same model and same settings for the battery reporting. However, when I try to "apply" the reporting parameters, I got following error:

Error 2022-06-21 20:54:33Request 'zigbee2mqtt/bridge/request/device/configure_reporting' failed with error: 'Bind 0xa4c13842315d1f30/1 genPowerCfg from '0x00212effff06deb6/1' failed (waiting for response TIMEOUT)'

Then, looking at some log, I notices the device send this ZB message every four hours:

debug 2022-06-21 17:34:19: Received Zigbee message from 'leak_tombino_scala', type 'read', cluster 'genTime', data '["localTime"]' from endpoint 1 with groupID null

however this message doesn't trigger any MQTT messages. :-(

galbip avatar Jun 21 '22 19:06 galbip

What MQTT message do you expect? water_leak value stays the same until device reports a change. If device does not report anything, Z2M can't do anything.

AlexKay88 avatar Jun 22 '22 13:06 AlexKay88

any MQTT message that would confirm the device is functional and alive regardless water_leak status.

From Tuya documentation: [https://developer.tuya.com/en/docs/iot-device-dev/tuya-zigbee-water-sensor-access-standard?id=K9ik6zvon7orn] it is reported the device send every 4hrs the battery level, but I do not see this in the log.

galbip avatar Jun 22 '22 14:06 galbip

Your refer to docs how the device should be implemented in theory, but this device does obviously not completely follow the developer guidelines. If you do not see expected communication in debug log, then the device does simply not send it. State attribute last_seen is updated with timestamp of last received Zigbee message from device. For Z2M device availability checks, see https://www.zigbee2mqtt.io/guide/configuration/device-availability.html

AlexKay88 avatar Jun 22 '22 14:06 AlexKay88

I checked myself after enabling debug logging and indeed, my water leak sensor reports every 5 minutes cluster:ssIasZone, zonestatus:1 which is translated to water_leak: true:

# grep Wasser /opt/zigbee2mqtt/data/log/current/log.txt
debug 2022-06-22 17:03:11: Received Zigbee message from 'Balkon_Wasser', type 'commandStatusChangeNotification', cluster 'ssIasZone', data '{"extendedstatus":0,"zonestatus":1}' from endpoint 1 with groupID null
info  2022-06-22 17:03:11: MQTT publish: topic 'zigbee2mqtt/Balkon_Wasser', payload '{"battery":100,"battery_low":false,"last_seen":"2022-06-22T15:03:11.000Z","linkquality":255,"tamper":false,"voltage":3000,"water_leak":true}'
debug 2022-06-22 17:08:11: Received Zigbee message from 'Balkon_Wasser', type 'commandStatusChangeNotification', cluster 'ssIasZone', data '{"extendedstatus":0,"zonestatus":1}' from endpoint 1 with groupID null
info  2022-06-22 17:08:11: MQTT publish: topic 'zigbee2mqtt/Balkon_Wasser', payload '{"battery":100,"battery_low":false,"last_seen":"2022-06-22T15:08:11.029Z","linkquality":255,"tamper":false,"voltage":3000,"water_leak":true}'
debug 2022-06-22 17:13:10: Received Zigbee message from 'Balkon_Wasser', type 'commandStatusChangeNotification', cluster 'ssIasZone', data '{"extendedstatus":0,"zonestatus":1}' from endpoint 1 with groupID null
info  2022-06-22 17:13:10: MQTT publish: topic 'zigbee2mqtt/Balkon_Wasser', payload '{"battery":100,"battery_low":false,"last_seen":"2022-06-22T15:13:10.936Z","linkquality":255,"tamper":false,"voltage":3000,"water_leak":true}'

So you can see that each cluster:ssIasZone, zonestatus:1 is followed by an MQTT message. As water_leak status does not change, the only change on MQTT payload is last_seen.

AlexKay88 avatar Jun 22 '22 15:06 AlexKay88

correct. As long as the sensor has the water_leak status = true, it sends every 5 minute a message. The issue is when water_leak status = false and I'm not getting any messages that tell me the sensor is alive.

As per your previous suggestion, I have now enabled the device availability check on Z2M setting 8hrs timeout, this should trigger an "offline" MQTT message for the sensor if no zigbee messages are received in last 8hrs (regardless water_leak status)

galbip avatar Jun 23 '22 09:06 galbip

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 7 days

github-actions[bot] avatar Jul 24 '22 00:07 github-actions[bot]