Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IKEA Badring E2202 not reporting water leak correctly #21794

Closed
mgwoj opened this issue Mar 14, 2024 · 5 comments · Fixed by Koenkk/zigbee-herdsman-converters#7219
Closed

IKEA Badring E2202 not reporting water leak correctly #21794

mgwoj opened this issue Mar 14, 2024 · 5 comments · Fixed by Koenkk/zigbee-herdsman-converters#7219
Labels
problem Something isn't working

Comments

@mgwoj
Copy link

mgwoj commented Mar 14, 2024

What happened?

I've noticed that water leak is not reported correctly. When I simulate the leak, device beeps and red light is blinking, the MQTT messages are generated, but water_leak is always false

MQTT publish: topic 'zigbee2mqtt/0x38398ffffe0axxxx/water_leak', payload 'false'

What did you expect to happen?

Payload should contain true for water_leak when device is reporting leak visually

How to reproduce it (minimal and precise)

No response

Zigbee2MQTT version

1.36.0-dev commit: 720fc49

Adapter firmware version

20211217

Adapter

zzh!

Setup

Pi 3B+

Debug log

debug 2024-03-14 13:29:11: Received Zigbee message from '0x38398ffffe0ac380', type 'commandStatusChangeNotification', cluster 'ssIasZone', data '{"extendedstatus":0,"zonestatus":1}' from endpoint 1 with groupID 0
info  2024-03-14 13:29:11: MQTT publish: topic 'zigbee2mqtt/0x38398ffffe0ac380/last_seen', payload '2024-03-14T13:29:11+01:00'
info  2024-03-14 13:29:11: MQTT publish: topic 'zigbee2mqtt/0x38398ffffe0ac380/linkquality', payload '3'
info  2024-03-14 13:29:11: MQTT publish: topic 'zigbee2mqtt/0x38398ffffe0ac380/battery', payload '100'
info  2024-03-14 13:29:11: MQTT publish: topic 'zigbee2mqtt/0x38398ffffe0ac380/water_leak', payload 'false'
info  2024-03-14 13:29:11: MQTT publish: topic 'zigbee2mqtt/0x38398ffffe0ac380/tamper', payload 'false'
info  2024-03-14 13:29:11: MQTT publish: topic 'zigbee2mqtt/0x38398ffffe0ac380/battery_low', payload 'false'
info  2024-03-14 13:29:11: MQTT publish: topic 'zigbee2mqtt/0x38398ffffe0ac380/supervision_reports', payload 'false'
info  2024-03-14 13:29:11: MQTT publish: topic 'zigbee2mqtt/0x38398ffffe0ac380/restore_reports', payload 'false'
info  2024-03-14 13:29:11: MQTT publish: topic 'zigbee2mqtt/0x38398ffffe0ac380/trouble', payload 'false'
info  2024-03-14 13:29:11: MQTT publish: topic 'zigbee2mqtt/0x38398ffffe0ac380/ac_status', payload 'false'
info  2024-03-14 13:29:11: MQTT publish: topic 'zigbee2mqtt/0x38398ffffe0ac380/test', payload 'false'
info  2024-03-14 13:29:11: MQTT publish: topic 'zigbee2mqtt/0x38398ffffe0ac380/battery_defect', payload 'false'
debug 2024-03-14 13:29:12: Received Zigbee message from '0x38398ffffe0ac380', type 'commandStatusChangeNotification', cluster 'ssIasZone', data '{"extendedstatus":0,"zonestatus":0}' from endpoint 1 with groupID 0
info  2024-03-14 13:29:12: MQTT publish: topic 'zigbee2mqtt/0x38398ffffe0ac380/last_seen', payload '2024-03-14T13:29:12+01:00'
info  2024-03-14 13:29:12: MQTT publish: topic 'zigbee2mqtt/0x38398ffffe0ac380/linkquality', payload '7'
info  2024-03-14 13:29:12: MQTT publish: topic 'zigbee2mqtt/0x38398ffffe0ac380/battery', payload '100'
info  2024-03-14 13:29:12: MQTT publish: topic 'zigbee2mqtt/0x38398ffffe0ac380/water_leak', payload 'false'
info  2024-03-14 13:29:12: MQTT publish: topic 'zigbee2mqtt/0x38398ffffe0ac380/tamper', payload 'false'
info  2024-03-14 13:29:12: MQTT publish: topic 'zigbee2mqtt/0x38398ffffe0ac380/battery_low', payload 'false'
info  2024-03-14 13:29:12: MQTT publish: topic 'zigbee2mqtt/0x38398ffffe0ac380/supervision_reports', payload 'false'
info  2024-03-14 13:29:12: MQTT publish: topic 'zigbee2mqtt/0x38398ffffe0ac380/restore_reports', payload 'false'
info  2024-03-14 13:29:12: MQTT publish: topic 'zigbee2mqtt/0x38398ffffe0ac380/trouble', payload 'false'
info  2024-03-14 13:29:12: MQTT publish: topic 'zigbee2mqtt/0x38398ffffe0ac380/ac_status', payload 'false'
info  2024-03-14 13:29:12: MQTT publish: topic 'zigbee2mqtt/0x38398ffffe0ac380/test', payload 'false'
info  2024-03-14 13:29:12: MQTT publish: topic 'zigbee2mqtt/0x38398ffffe0ac380/battery_defect', payload 'false'
@mrskycriper
Copy link
Contributor

I’ll look into that. Also, could you please share the entry from database.db? I think it can do a little bit more than the current converter is exposing.

@mgwoj
Copy link
Author

mgwoj commented Mar 14, 2024

Here it is

{"id":43,"type":"EndDevice","ieeeAddr":"0x38398ffffe0ac380","nwkAddr":12472,"manufId":4476,"manufName":"IKEA of Sweden","powerSource":"Battery","modelId":"BADRING Water Leakage Sensor","epList":[1],"endpoints":{"1":{"profId":260,"epId":1,"devId":1026,"inClusterList":[0,1,3,32,1280,2821,64636,64641],"outClusterList":[3,4,25],"clusters":{"genBasic":{"attributes":{"modelId":"BADRING Water Leakage Sensor","manufacturerName":"IKEA of Sweden","powerSource":3,"zclVersion":8,"appVersion":1,"stackVersion":113,"hwVersion":1,"dateCode":"20230508","swBuildId":"1.0.7"}},"ssIasZone":{"attributes":{"iasCieAddr":"0x00124b0021b76a8f","zoneState":1}},"genPollCtrl":{"attributes":{"checkinInterval":172800}},"genPowerCfg":{"attributes":{"batteryPercentageRemaining":200}}},"binds":[{"cluster":32,"type":"endpoint","deviceIeeeAddress":"0x00124b0021b76a8f","endpointID":1},{"cluster":1,"type":"endpoint","deviceIeeeAddress":"0x00124b0021b76a8f","endpointID":1}],"configuredReportings":[{"cluster":1,"attrId":33,"minRepIntval":3600,"maxRepIntval":65000,"repChange":10,"manufacturerCode":null}],"meta":{}}},"appVersion":1,"stackVersion":113,"hwVersion":1,"dateCode":"20230508","swBuildId":"1.0.7","zclVersion":8,"interviewCompleted":true,"meta":{"configured":1324213189},"lastSeen":1710419352631,"checkinInterval":43200}

@Mettchen
Copy link

What it is reporting on my side: (Looks the same)
Zigbee2MQTT:debug 2024-03-14 18:06:38: Received Zigbee message from 'DishwasherLeak', type 'commandStatusChangeNotification', cluster 'ssIasZone', data '{"extendedstatus":0,"zonestatus":0}' from endpoint 1 with groupID 0 Zigbee2MQTT:info 2024-03-14 18:06:38: MQTT publish: topic 'zigbee2mqtt/DishwasherLeak', payload '{"battery":90,"battery_low":false,"linkquality":112,"tamper":false,"water_leak":false}'

The converter that works on my side:

`// Add the lines below
const fz = require('zigbee-herdsman-converters/converters/fromZigbee');
const tz = require('zigbee-herdsman-converters/converters/toZigbee');
const exposes = require('zigbee-herdsman-converters/lib/exposes');
const reporting = require('zigbee-herdsman-converters/lib/reporting');
const extend = require('zigbee-herdsman-converters/lib/extend');
const ota = require('zigbee-herdsman-converters/lib/ota');
const tuya = require('zigbee-herdsman-converters/lib/tuya');
const {} = require('zigbee-herdsman-converters/lib/tuya');
const utils = require('zigbee-herdsman-converters/lib/utils');
const globalStore = require('zigbee-herdsman-converters/lib/store');
const e = exposes.presets;
const ea = exposes.access;

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

const definition = {
zigbeeModel: ['BADRING Water Leakage Sensor'],
model: 'BADRING Water Leakage Sensor',
vendor: 'IKEA of Sweden',
fromZigbee: [fz.ias_water_leak_alarm_1],
toZigbee: [], // Should be empty, unless device can be controlled (e.g. lights, switches).
description: 'IKEA Water Leakage Detection Sensor and Alarm',
extend: [batteryPercentage(), identify()],
exposes: [e.water_leak()], // Defines what this device exposes, used for e.g. Home Assistant discovery and in the frontend
};

module.exports = definition;`

It was updated in Koenkk/zigbee-herdsman-converters#7196 after my commit. Maybe something went wrong there?

@mrskycriper
Copy link
Contributor

I've double checked the converter, extend and even the boolean math. I can't find anything out of the ordinary. That is so strange

@mrskycriper
Copy link
Contributor

I've found the bug. When the alarms have the same name, the returning object has the same property name twice. Which is impossible and the second one (alarm_2) overrides the first one. I'll make the fix ASAP.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
problem Something isn't working
Projects
None yet
3 participants