Skip to content

Commit

Permalink
Add missing ssIasZone attributeReport for TS0202. Koenkk/zigbee2mqtt#…
Browse files Browse the repository at this point in the history
  • Loading branch information
Koenkk committed May 29, 2021
1 parent 5627ce3 commit a15de4c
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
12 changes: 12 additions & 0 deletions converters/fromZigbee.js
Original file line number Diff line number Diff line change
Expand Up @@ -873,6 +873,18 @@ const converters = {
};
},
},
ias_occupancy_alarm_1_report: {
cluster: 'ssIasZone',
type: 'attributeReport',
convert: (model, msg, publish, options, meta) => {
const zoneStatus = msg.data.zoneStatus;
return {
occupancy: (zoneStatus & 1) > 0,
tamper: (zoneStatus & 1<<2) > 0,
battery_low: (zoneStatus & 1<<3) > 0,
};
},
},
ias_occupancy_alarm_2: {
cluster: 'ssIasZone',
type: 'commandStatusChangeNotification',
Expand Down
2 changes: 1 addition & 1 deletion devices/tuya.js
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ module.exports = [
model: 'TS0202',
vendor: 'TuYa',
description: 'Motion sensor',
fromZigbee: [fz.ias_occupancy_alarm_1, fz.battery, fz.ignore_basic_report],
fromZigbee: [fz.ias_occupancy_alarm_1, fz.battery, fz.ignore_basic_report, fz.ias_occupancy_alarm_1_report],
toZigbee: [],
exposes: [e.occupancy(), e.battery_low(), e.tamper(), e.battery()],
},
Expand Down

0 comments on commit a15de4c

Please sign in to comment.