[External Converter]: DCH-B122 from D-Link
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 15.7k
- Forks
- 2k
- Avg merge
- 18h 55m
- Merged PRs (30d)
- 35
Description
Link
https://www.dlink.com.au/home-solutions/DCH-B122-Smart-Motion-Sensor
Database entry
{"id":30,"type":"EndDevice","ieeeAddr":"0xc4e90afffe9247c3","nwkAddr":57539,"manufId":4469,"manufName":"D-Link","powerSource":"Battery","modelId":"DCH-B122","epList":[1],"endpoints":{"1":{"profId":260,"epId":1,"devId":1026,"inClusterList":[0,1,3,32,1280,2821,64641],"outClusterList":[25],"clusters":{"ssIasZone":{"attributes":{"65531":0,"iasCieAddr":"0x7c31fafffec76a0e","zoneState":1}},"genPollCtrl":{"attributes":{"checkinInterval":6480}},"genPowerCfg":{"attributes":{"batteryPercentageRemaining":200,"batteryVoltage":30,"batteryAlarmState":0}}},"binds":[{"cluster":32,"type":"endpoint","deviceIeeeAddress":"0x7c31fafffec76a0e","endpointID":1},{"cluster":1,"type":"endpoint","deviceIeeeAddress":"0x7c31fafffec76a0e","endpointID":1}],"configuredReportings":[{"cluster":1,"attrId":33,"minRepIntval":3600,"maxRepIntval":65000,"repChange":10}],"meta":{}}},"appVersion":71,"stackVersion":2,"hwVersion":1,"dateCode":"20190920-74","swBuildId":"1.00.03","zclVersion":3,"interviewCompleted":true,"interviewState":"SUCCESSFUL","meta":{"configured":"0.0.0"},"lastSeen":1784093613724,"checkinInterval":1620}
Zigbee2MQTT version
2.12.1 (unknown)
External converter
import * as fz from "zigbee-herdsman-converters/converters/fromZigbee";
import * as exposes from "zigbee-herdsman-converters/lib/exposes";
import * as reporting from "zigbee-herdsman-converters/lib/reporting";
const e = exposes.presets;
export default {
zigbeeModel: ["DCH-B122", "DCH-b122"],
model: "DCH-B122",
vendor: "D-Link",
description: "mydlink smart motion sensor",
fromZigbee: [fz.ias_occupancy_alarm_1_with_timeout, fz.ias_occupancy_alarm_1_report, fz.battery],
toZigbee: [],
exposes: [e.occupancy(), e.tamper(), e.battery_low(), e.battery()],
configure: async (device, coordinatorEndpoint) => {
const endpoint = device.getEndpoint(1);
await reporting.bind(endpoint, coordinatorEndpoint, ["genPowerCfg"]);
await reporting.batteryPercentageRemaining(endpoint);
},
};
What does/doesn't work with the external definition?
State still shows alarm_1 and alarm_2 instead of just occupancy & tamper. Not sure why alarm_1 shows true while occupancy shows false.
{
"alarm_1": true,
"alarm_2": false,
"battery": 100,
"battery_low": false,
"linkquality": 104,
"occupancy": false,
"tamper": false
}
Notes
software_build_id: 1.00.03
date_code: 20190920-74
endpoints:
{"1":{"clusters":{"input":["genBasic","genPowerCfg","genIdentify","genPollCtrl","ssIasZone","haDiagnostic","64641"],"output":["genOta"]}}}
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the supplied DCH-B122 external converter and compare its fromZigbee handlers and exposes with the reported database entry and state payload. Confirm the resulting state exposes occupancy and tamper without alarm_1 or alarm_2, and that motion events produce the expected occupancy value.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- embedded-iot
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 65/100