Koenkk / zigbee2mqtt

Zigbee 🐝 to MQTT bridge 🌉, get rid of your proprietary Zigbee bridges 🔨
https://www.zigbee2mqtt.io
GNU General Public License v3.0
12.21k stars 1.68k forks source link

[New device support]: Tuya Zigbee Water Leak Detector #24759

Closed MilesTEG1 closed 1 week ago

MilesTEG1 commented 1 week ago

Link

https://fr.aliexpress.com/item/1005006512619030.html

Database entry

{"id":74,"type":"EndDevice","ieeeAddr":"0xa4c1382c55337701","nwkAddr":59608,"manufId":4742,"manufName":"_TZ3000_upgcbody","powerSource":"Battery","modelId":"SNZB-05","epList":[1],"endpoints":{"1":{"profId":260,"epId":1,"devId":1026,"inClusterList":[0,3,1,1280,32],"outClusterList":[25],"clusters":{"genBasic":{"attributes":{"hwVersion":0}},"ssIasZone":{"attributes":{"iasCieAddr":"0x847127fffedfe3cd","zoneState":1}},"genPollCtrl":{"attributes":{"checkinInterval":14400}},"genPowerCfg":{"attributes":{"batteryPercentageRemaining":114}}},"binds":[{"cluster":32,"type":"endpoint","deviceIeeeAddress":"0x847127fffedfe3cd","endpointID":1},{"cluster":1,"type":"endpoint","deviceIeeeAddress":"0x847127fffedfe3cd","endpointID":1}],"configuredReportings":[{"cluster":1,"attrId":33,"minRepIntval":3600,"maxRepIntval":65000,"repChange":10}],"meta":{}}},"appVersion":113,"stackVersion":2,"hwVersion":0,"swBuildId":"0122052017","zclVersion":3,"interviewCompleted":true,"meta":{"configured":332242049},"lastSeen":1731510955140,"checkinInterval":3600}

Zigbee2MQTT version

1.41.0

Comments

I paired the device, a Tuya Zigbee Water Leak Detector that is a Tuya TS0207_water_leak_detector_1, but it doesn't been supported, nor detected as TS0207_water_leak_detector_1. Instead, Z2M says that it's unsupported and this:

It should be detected as TS0207_water_leak_detector_1.

External definition

const {battery, iasZoneAlarm} = require('zigbee-herdsman-converters/lib/modernExtend');

const definition = {
    zigbeeModel: ['SNZB-05'],
    model: 'SNZB-05',
    vendor: '_TZ3000_upgcbody',
    description: 'Automatically generated definition',
    extend: [battery(), iasZoneAlarm({"zoneType":"generic","zoneAttributes":["alarm_1","alarm_2","tamper","battery_low"]})],
    meta: {},
};

module.exports = definition;

What does/doesn't work with the external definition?

alarm_1 is working: a water leak is detect when sensor in water. alarm_2 isn't working: nothing happens when sensor in water.

tamper: I don't know how to trigger this. battery_low: my battery is at 57%, so I don't know if it's working for now. battery indicate a %, so it seems to be working.

Koenkk commented 1 week ago

Added!

Changes will be available in the dev branch in a few hours from now.

MilesTEG1 commented 1 week ago

Hello @Koenkk Nice! Thank you! I have to figure out how to change the HA Z2M Addon to the Dev Branch without loosing any configuration data :) If it's possible.

MilesTEG1 commented 1 week ago

@Koenkk I just switched to the Edge version on HA Addon (after refreshing the repository as described in the Edge version doc). I put my configuration from stable version, and launched it. No problems, all my devices are working fine.

But... my leak sensor isn't detected as a TS0207_water_leak_detector_1 as it should be, but it is detected as a IH-K665 which is not. image

Can you do a correction of that please? and reopen this issue for now until this is fixed?

By the way, the exposes sensors are OK. If I simulate a water leak, it's being detected: CleanShot 2024-11-14 at 23 36 35@2x

Thanks very much.

Koenkk commented 1 week ago

Fixed!

Changes will be available in the dev branch in a few hours from now.

MilesTEG1 commented 1 week ago

Thanks you very much! 😇