Koenkk / zigbee2mqtt

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

[New device support]: Linkoze Door Sensor lkdsz001 - tested working #18447

Closed AskDev2022 closed 1 year ago

AskDev2022 commented 1 year ago

Link

https://www.linkoze.com/products/door-sensor?variant=44110718402833

Database entry

{"id":18,"type":"EndDevice","ieeeAddr":"0xa4c138e200841b6b","nwkAddr":26656,"manufId":4417,"manufName":"_TZ3210_jowhpxop","powerSource":"Battery","modelId":"TS0203","epList":[1],"endpoints":{"1":{"profId":260,"epId":1,"devId":1026,"inClusterList":[1,1280,61184,0],"outClusterList":[25,10],"clusters":{"genBasic":{"attributes":{"65503":"\u0000\u0000\u0000\u0000\u0011A��+\u0012ܯ�+\u0012��+\u0012���+\u00162��+\u0012\u0000\u0000\u0000\u0000\u0011","65506":54,"65508":1,"65534":0,"stackVersion":0,"dateCode":"","manufacturerName":"_TZ3210_jowhpxop","zclVersion":3,"appVersion":65,"modelId":"TS0203","powerSource":3}},"ssIasZone":{"attributes":{"iasCieAddr":"0x00124b00257caed7","zoneState":1}},"genPowerCfg":{"attributes":{"batteryPercentageRemaining":200,"batteryVoltage":30}}},"binds":[{"cluster":1,"type":"endpoint","deviceIeeeAddress":"0x00124b00257caed7","endpointID":1}],"configuredReportings":[{"cluster":1,"attrId":33,"minRepIntval":3600,"maxRepIntval":62000,"repChange":0},{"cluster":1,"attrId":32,"minRepIntval":3600,"maxRepIntval":62000,"repChange":0}],"meta":{}}},"appVersion":65,"stackVersion":0,"hwVersion":1,"dateCode":"","zclVersion":3,"interviewCompleted":true,"meta":{"configured":-1440156621},"lastSeen":1690519113458,"defaultSendRequestWhen":"immediate"}

Comments

Created the external converter based on combination of TS0203 and LKMSZ001. Tested and it is working as expected.

Can someone add this device to next release?

External converter

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 e = exposes.presets;
const ea = exposes.access;
const tuya = require('zigbee-herdsman-converters/lib/tuya');

const definition = {
    fingerprint: [
        {
            modelID: 'TS0203',
            manufacturerName: '_TZ3210_jowhpxop',
        },
    ],
    model: 'TS0203_2',
    vendor: 'TuYa',
    description: 'Door sensor with scene switch',
    fromZigbee: [tuya.fz.datapoints, fz.ias_contact_alarm_1, fz.battery, fz.ignore_basic_report, fz.ias_contact_alarm_1_report],
    toZigbee: [tuya.fz.datapoints],
    onEvent: tuya.onEventSetTime,
    configure: tuya.configureMagicPacket,
    exposes: [
        e.action(['single', 'double', 'hold']), e.contact(), e.battery_low(), e.tamper(), e.battery(), e.battery_voltage()
    ],
    meta: {
        tuyaDatapoints: [
            [101, 'action', tuya.valueConverterBasic.lookup({'single': 0, 'double': 1, 'hold': 2})],
        ],
    },
    whiteLabel: [
        {vendor: 'Linkoze', model: 'LKDSZ001'},
    ],
};

module.exports = definition;

Supported color modes

No response

Color temperature range

No response

Koenkk commented 1 year ago

Added, thanks!

Changes will be available in the dev branch in a few hours from now. (https://www.zigbee2mqtt.io/advanced/more/switch-to-dev-branch.html)