-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Description
Link
Database entry
{"id":7,"type":"EndDevice","ieeeAddr":"0xa4c138a677416cc6","nwkAddr":1145,"manufId":4417,"manufName":"_TZE284_u8ouaqsz","powerSource":"Battery","modelId":"TS0601","epLi>
Zigbee2MQTT version
2.7.1
External converter
const exposes = require('zigbee-herdsman-converters/lib/exposes');
const tuya = require('zigbee-herdsman-converters/lib/tuya');
const e = exposes.presets;
const ea = exposes.access;
const definition = {
fingerprint: [{ modelID: 'TS0601', manufacturerName: '_TZE284_u8ouaqsz' }],
model: 'tuya_door_sensor_alarm',
vendor: 'Tuya',
description: 'Tuya door sensor / alarm',
extend: [tuya.modernExtend.tuyaBase({dp: true})],
exposes: [
e.enum("doorcontact_state", ea.STATE, ["open", "closed"]).withDescription("Contact state"),
e.numeric('battery_percentage', ea.STATE)
.withUnit('%')
.withValueMin(0)
.withValueMax(100)
.withDescription('Battery percentage'),
e.binary('armed_state', ea.STATE_SET, true, false).withDescription('Alarm armed state'),
e.binary('led', ea.STATE_SET, true, false).withDescription('LED state'),
e.numeric('volume', ea.STATE_SET)
.withValueMin(0).withValueMax(100)
.withDescription('Alarm volume level'),
exposes.numeric('alarm_duration', ea.STATE_SET)
.withUnit('s').withValueMin(0).withValueMax(180)
.withDescription('Alarm duration'),
],
meta: {
tuyaDatapoints: [
[1, 'doorcontact_state', tuya.valueConverterBasic.lookup({open: tuya.enum(true), closed: tuya.enum(false)})],
[2, 'battery_percentage', tuya.valueConverter.raw],
[101, 'armed_state', tuya.valueConverter.raw],
[102, 'led', tuya.valueConverter.raw],
[103, 'volume', tuya.valueConverter.raw],
[104, 'alarm_duration', tuya.valueConverter.raw],
],
},
onEvent: (type, data, device) => {
if (type === 'deviceAnnounce') {
return;
}
},
};
module.exports = definition;What does/doesn't work with the external definition?
every thing is working correctly, supported properties:
{ "result":
{ "properties": [
{ "code": "doorcontact_state", "custom_name": "", "dp_id": 1, "time": 1767189486120, "type": "bool", "value": false },
{ "code": "battery_percentage", "custom_name": "", "dp_id": 2, "time": 1767189701477, "type": "value", "value": 90 },
{ "code": "distributed", "custom_name": "", "dp_id": 101, "time": 1767189701477, "type": "bool", "value": false },
{ "code": "led", "custom_name": "", "dp_id": 102, "time": 1767189701477, "type": "bool", "value": true },
{ "code": "volume", "custom_name": "", "dp_id": 103, "time": 1767189701477, "type": "value", "value": 1 },
{ "code": "time", "custom_name": "", "dp_id": 104, "time": 1767189701477, "type": "value", "value": 4 } ] }
Notes
software_build_id: undefined
date_code: ``
endpoints:
{"1":{"clusters":{"input":["genGroups","genScenes","manuSpecificTuya","genBasic","zosungIRTransmit"],"output":["genOta","genTime"]}}}