[New device support]: New Fingerprint for ZG-103Z, currently detected as TS0210 with no functionality
Link
https://www.zigbee2mqtt.io/devices/ZG-103Z.html
Database entry
{"id":36,"type":"EndDevice","ieeeAddr":"0xa4c138155119e4ef","nwkAddr":37363,"manufId":4417,"manufName":"_TZ32101000000_5oy7cysk","powerSource":"Battery","modelId":"TS0210","epList":[1],"endpoints":{"1":{"profId":260,"epId":1,"devId":1026,"inClusterList":[0,57344,3,1,1280,57346,61184],"outClusterList":[10,25],"clusters":{"genBasic":{"attributes":{"modelId":"TS0210","manufacturerName":"_TZ32101000000_5oy7cysk","powerSource":3,"zclVersion":3,"appVersion":68,"stackVersion":1,"hwVersion":1,"dateCode":""}}},"binds":[],"configuredReportings":[],"meta":{}}},"appVersion":68,"stackVersion":1,"hwVersion":1,"dateCode":"","zclVersion":3,"interviewCompleted":true,"interviewState":"SUCCESSFUL","meta":{},"lastSeen":1758041594793}
Zigbee2MQTT version
2.6.1
Comments
The device is a ZG-103Z, but it is identified as a "TS0210" due to a missing fingerprint (thanks to @ShadowFist for the insight)
External definition
import * as m from 'zigbee-herdsman-converters/lib/modernExtend';
export default {
zigbeeModel: ['TS0210'],
model: 'TS0210',
vendor: '_TZ32101000000_5oy7cysk',
description: 'Automatically generated definition',
extend: [m.battery(), m.iasZoneAlarm({"zoneType":"generic","zoneAttributes":["alarm_1","alarm_2","tamper","battery_low"]})],
meta: {},
};
What does/doesn't work with the external definition?
The device has the following Zigbee Manufacturer: _TZ32101000000_5oy7cysk
But it is identified as a "TS0210" instead of a ZG-103Z.
Images
Edit:
- added image, thanks ckocyigit for suggesting it
Isn't this a change in zigbee-herdsman-converters? And if so, is this commit sufficient or even correct?
https://github.com/ckocyigit/zigbee-herdsman-converters/commit/6c4cef1903c7b2485b27ee6ead90c344317cf68d
_TZ32101000000_5oy7cysk is actually a "ZG-103Z", but being detected as "TS0210".
This refers to a "TS0210" device as well, so I think won't be correct.
Isn't this a change in zigbee-herdsman-converters? And if so, is this commit sufficient or even correct?
Oh, that's obviously more sensible. I've done it the wrong way around – it should be: https://github.com/ckocyigit/zigbee-herdsman-converters/commit/1b91a0fcf26428689bb396bed10d2d23bd782ff7 right?
Oh, that's obviously more sensible. I've done it the wrong way around – it should be: ckocyigit/zigbee-herdsman-converters@1b91a0f right?
I got the same device now and noticed the same issue. And yeah, I think this should work.
I tried your edits locally, unfortunately they do not work.
If I understand correctly they're identified by their reported model and their fingerprint. In your change you just have appended the fingerprint (but the model won't match).
I think the correct fingerprint line would be:
fingerprint: [...tuya.fingerprint("TS0601", ["_TZE200_iba1ckek", "_TZE200_hggxgsjj", "_TZE200_yjryxpot", "_TZE200_afycb3cg"]), ...tuya.fingerprint("TS0210", ["_TZ32101000000_5oy7cysk"]),],
I did some experiments using an external converter based on your change, I got some values, but unfortunately the datapoints are also wrong.
Found out the DP-Ids though:
| Name | ID |
|---|---|
| Shake State | 1 |
| Battery Level | 4 |
| X-axle | 101 |
| Sensitivity | 6 |
| Y-axle | 102 |
| Z-axle | 103 |
| State | 104 |
| Sensitivity | 105 |
I don't know the difference between those 2 sensitivities yet
Tuya Dashboard
This is the automatically extracted list
{"1":"Shake State","4":"Battery Level","6":"Sensitivity","101":"X-axle","102":"Y-axle","103":"Z-axle","104":"State","105":"Sensitivity"}
Here's my first external converter - ⚠️ it doesn't fully work, but detects the device and shows some X/Y/Z values
const tuya = require('zigbee-herdsman-converters/lib/tuya');
const exposes = require('zigbee-herdsman-converters/lib/exposes');
const e = exposes.presets;
const ea = exposes.access;
const device = {
zigbeeModel: ["TS0210"],
fingerprint: [{ modelID: 'TS0210', manufacturerName: '_TZ32101000000_5oy7cysk' }],
model: "TS0210",
vendor: "Tuya",
description: "Vibration sensor",
fromZigbee: [tuya.fz.datapoints],
toZigbee: [tuya.tz.datapoints],
configure: tuya.configureMagicPacket,
exposes: [
e.vibration(),
e.tilt(),
e.numeric("x", ea.STATE).withValueMin(0).withValueMax(256).withValueStep(1).withDescription("X coordinate"),
e.numeric("y", ea.STATE).withValueMin(0).withValueMax(256).withValueStep(1).withDescription("Y coordinate"),
e.numeric("z", ea.STATE).withValueMin(0).withValueMax(256).withValueStep(1).withDescription("Z coordinate"),
e.battery(),
e.enum("sensitivity", ea.STATE_SET, ["low", "middle", "high"]).withDescription("Vibration detection sensitivity"),
],
meta: {
tuyaDatapoints: [
[1, 'vibration', tuya.valueConverter.trueFalseEnum1],
[6, 'tilt', tuya.valueConverter.trueFalseEnum1],
[101, 'x', tuya.valueConverter.raw],
[102, 'y', tuya.valueConverter.raw],
[103, 'z', tuya.valueConverter.raw],
[
105,
'sensitivity',
tuya.valueConverterBasic.lookup({
low: tuya.enum(0),
middle: tuya.enum(1),
high: tuya.enum(2),
}),
],
[4, 'battery', tuya.valueConverter.raw],
],
},
};
module.exports = [device];
Logs from z2m
# dp: 101
z2m: Received Zigbee message from '0xa4c138b52c206708', type 'commandActiveStatusReport', cluster 'manuSpecificTuya', data '{"dpValues":[{"data":{"data":[0,0,0,2],"type":"Buffer"},"datatype":2,"dp":101}],"seq":43267}' from endpoint 1 with groupID 0
z2m: Received Zigbee message from '0xa4c138b52c206708', type 'commandActiveStatusReport', cluster 'manuSpecificTuya', data '{"dpValues":[{"data":{"data":[0,0,0,2],"type":"Buffer"},"datatype":2,"dp":101}],"seq":45315}' from endpoint 1 with groupID 0
z2m: Received Zigbee message from '0xa4c138b52c206708', type 'commandActiveStatusReport', cluster 'manuSpecificTuya', data '{"dpValues":[{"data":{"data":[0,0,0,2],"type":"Buffer"},"datatype":2,"dp":101}],"seq":46851}' from endpoint 1 with groupID 0
z2m: Received Zigbee message from '0xa4c138b52c206708', type 'commandActiveStatusReport', cluster 'manuSpecificTuya', data '{"dpValues":[{"data":{"data":[0,0,0,2],"type":"Buffer"},"datatype":2,"dp":101}],"seq":49667}' from endpoint 1 with groupID 0
z2m: Received Zigbee message from '0xa4c138b52c206708', type 'commandActiveStatusReport', cluster 'manuSpecificTuya', data '{"dpValues":[{"data":{"data":[0,0,0,2],"type":"Buffer"},"datatype":2,"dp":101}],"seq":54275}' from endpoint 1 with groupID 0
z2m: Received Zigbee message from '0xa4c138b52c206708', type 'commandActiveStatusReport', cluster 'manuSpecificTuya', data '{"dpValues":[{"data":{"data":[0,0,0,2],"type":"Buffer"},"datatype":2,"dp":101}],"seq":56323}' from endpoint 1 with groupID 0
z2m: Received Zigbee message from '0xa4c138b52c206708', type 'commandActiveStatusReport', cluster 'manuSpecificTuya', data '{"dpValues":[{"data":{"data":[0,0,0,35],"type":"Buffer"},"datatype":2,"dp":101}],"seq":51459}' from endpoint 1 with groupID 0
# dp: 102
z2m: Received Zigbee message from '0xa4c138b52c206708', type 'commandActiveStatusReport', cluster 'manuSpecificTuya', data '{"dpValues":[{"data":{"data":[0,0,0,1],"type":"Buffer"},"datatype":2,"dp":102}],"seq":54531}' from endpoint 1 with groupID 0
z2m: Received Zigbee message from '0xa4c138b52c206708', type 'commandActiveStatusReport', cluster 'manuSpecificTuya', data '{"dpValues":[{"data":{"data":[0,0,0,2],"type":"Buffer"},"datatype":2,"dp":102}],"seq":43523}' from endpoint 1 with groupID 0
z2m: Received Zigbee message from '0xa4c138b52c206708', type 'commandActiveStatusReport', cluster 'manuSpecificTuya', data '{"dpValues":[{"data":{"data":[0,0,0,2],"type":"Buffer"},"datatype":2,"dp":102}],"seq":45571}' from endpoint 1 with groupID 0
z2m: Received Zigbee message from '0xa4c138b52c206708', type 'commandActiveStatusReport', cluster 'manuSpecificTuya', data '{"dpValues":[{"data":{"data":[0,0,0,2],"type":"Buffer"},"datatype":2,"dp":102}],"seq":47107}' from endpoint 1 with groupID 0
z2m: Received Zigbee message from '0xa4c138b52c206708', type 'commandActiveStatusReport', cluster 'manuSpecificTuya', data '{"dpValues":[{"data":{"data":[0,0,0,2],"type":"Buffer"},"datatype":2,"dp":102}],"seq":49923}' from endpoint 1 with groupID 0
z2m: Received Zigbee message from '0xa4c138b52c206708', type 'commandActiveStatusReport', cluster 'manuSpecificTuya', data '{"dpValues":[{"data":{"data":[0,0,0,2],"type":"Buffer"},"datatype":2,"dp":102}],"seq":56579}' from endpoint 1 with groupID 0
z2m: Received Zigbee message from '0xa4c138b52c206708', type 'commandActiveStatusReport', cluster 'manuSpecificTuya', data '{"dpValues":[{"data":{"data":[255,255,255,254],"type":"Buffer"},"datatype":2,"dp":102}],"seq":51715}' from endpoint 1 with groupID 0
z2m: Received Zigbee message from '0xa4c138b52c206708', type 'commandActiveStatusReport', cluster 'manuSpecificTuya', data '{"dpValues":[{"data":{"data":[255,255,255,254],"type":"Buffer"},"datatype":2,"dp":102}],"seq":51715}' from endpoint 1 with groupID 0
# dp: 103
z2m: Received Zigbee message from '0xa4c138b52c206708', type 'commandActiveStatusReport', cluster 'manuSpecificTuya', data '{"dpValues":[{"data":{"data":[0,0,0,54],"type":"Buffer"},"datatype":2,"dp":103}],"seq":51971}' from endpoint 1 with groupID 0
z2m: Received Zigbee message from '0xa4c138b52c206708', type 'commandActiveStatusReport', cluster 'manuSpecificTuya', data '{"dpValues":[{"data":{"data":[0,0,0,68],"type":"Buffer"},"datatype":2,"dp":103}],"seq":43779}' from endpoint 1 with groupID 0
z2m: Received Zigbee message from '0xa4c138b52c206708', type 'commandActiveStatusReport', cluster 'manuSpecificTuya', data '{"dpValues":[{"data":{"data":[0,0,0,68],"type":"Buffer"},"datatype":2,"dp":103}],"seq":54787}' from endpoint 1 with groupID 0
z2m: Received Zigbee message from '0xa4c138b52c206708', type 'commandActiveStatusReport', cluster 'manuSpecificTuya', data '{"dpValues":[{"data":{"data":[0,0,0,69],"type":"Buffer"},"datatype":2,"dp":103}],"seq":47363}' from endpoint 1 with groupID 0
z2m: Received Zigbee message from '0xa4c138b52c206708', type 'commandActiveStatusReport', cluster 'manuSpecificTuya', data '{"dpValues":[{"data":{"data":[0,0,0,69],"type":"Buffer"},"datatype":2,"dp":103}],"seq":56835}' from endpoint 1 with groupID 0
z2m: Received Zigbee message from '0xa4c138b52c206708', type 'commandActiveStatusReport', cluster 'manuSpecificTuya', data '{"dpValues":[{"data":{"data":[0,0,0,70],"type":"Buffer"},"datatype":2,"dp":103}],"seq":45827}' from endpoint 1 with groupID 0
z2m: Received Zigbee message from '0xa4c138b52c206708', type 'commandActiveStatusReport', cluster 'manuSpecificTuya', data '{"dpValues":[{"data":{"data":[0,0,0,70],"type":"Buffer"},"datatype":2,"dp":103}],"seq":50179}' from endpoint 1 with groupID 0
# dp: 104
z2m: Received Zigbee message from '0xa4c138b52c206708', type 'commandActiveStatusReport', cluster 'manuSpecificTuya', data '{"dpValues":[{"data":{"data":[0],"type":"Buffer"},"datatype":4,"dp":104}],"seq":43011}' from endpoint 1 with groupID 0
z2m: Received Zigbee message from '0xa4c138b52c206708', type 'commandActiveStatusReport', cluster 'manuSpecificTuya', data '{"dpValues":[{"data":{"data":[0],"type":"Buffer"},"datatype":4,"dp":104}],"seq":45059}' from endpoint 1 with groupID 0
z2m: Received Zigbee message from '0xa4c138b52c206708', type 'commandActiveStatusReport', cluster 'manuSpecificTuya', data '{"dpValues":[{"data":{"data":[0],"type":"Buffer"},"datatype":4,"dp":104}],"seq":46595}' from endpoint 1 with groupID 0
z2m: Received Zigbee message from '0xa4c138b52c206708', type 'commandActiveStatusReport', cluster 'manuSpecificTuya', data '{"dpValues":[{"data":{"data":[0],"type":"Buffer"},"datatype":4,"dp":104}],"seq":49411}' from endpoint 1 with groupID 0
z2m: Received Zigbee message from '0xa4c138b52c206708', type 'commandActiveStatusReport', cluster 'manuSpecificTuya', data '{"dpValues":[{"data":{"data":[0],"type":"Buffer"},"datatype":4,"dp":104}],"seq":51203}' from endpoint 1 with groupID 0
z2m: Received Zigbee message from '0xa4c138b52c206708', type 'commandActiveStatusReport', cluster 'manuSpecificTuya', data '{"dpValues":[{"data":{"data":[0],"type":"Buffer"},"datatype":4,"dp":104}],"seq":54019}' from endpoint 1 with groupID 0
z2m: Received Zigbee message from '0xa4c138b52c206708', type 'commandActiveStatusReport', cluster 'manuSpecificTuya', data '{"dpValues":[{"data":{"data":[0],"type":"Buffer"},"datatype":4,"dp":104}],"seq":54019}' from endpoint 1 with groupID 0
z2m: Received Zigbee message from '0xa4c138b52c206708', type 'commandActiveStatusReport', cluster 'manuSpecificTuya', data '{"dpValues":[{"data":{"data":[0],"type":"Buffer"},"datatype":4,"dp":104}],"seq":56067}' from endpoint 1 with groupID 0
z2m: Received Zigbee message from '0xa4c138b52c206708', type 'commandActiveStatusReport', cluster 'manuSpecificTuya', data '{"dpValues":[{"data":{"data":[1],"type":"Buffer"},"datatype":4,"dp":104}],"seq":44035}' from endpoint 1 with groupID 0
z2m: Received Zigbee message from '0xa4c138b52c206708', type 'commandActiveStatusReport', cluster 'manuSpecificTuya', data '{"dpValues":[{"data":{"data":[1],"type":"Buffer"},"datatype":4,"dp":104}],"seq":44803}' from endpoint 1 with groupID 0
z2m: Received Zigbee message from '0xa4c138b52c206708', type 'commandActiveStatusReport', cluster 'manuSpecificTuya', data '{"dpValues":[{"data":{"data":[1],"type":"Buffer"},"datatype":4,"dp":104}],"seq":52739}' from endpoint 1 with groupID 0
z2m: Received Zigbee message from '0xa4c138b52c206708', type 'commandActiveStatusReport', cluster 'manuSpecificTuya', data '{"dpValues":[{"data":{"data":[1],"type":"Buffer"},"datatype":4,"dp":104}],"seq":53507}' from endpoint 1 with groupID 0
z2m: Received Zigbee message from '0xa4c138b52c206708', type 'commandActiveStatusReport', cluster 'manuSpecificTuya', data '{"dpValues":[{"data":{"data":[1],"type":"Buffer"},"datatype":4,"dp":104}],"seq":55043}' from endpoint 1 with groupID 0
z2m: Received Zigbee message from '0xa4c138b52c206708', type 'commandActiveStatusReport', cluster 'manuSpecificTuya', data '{"dpValues":[{"data":{"data":[2],"type":"Buffer"},"datatype":4,"dp":104}],"seq":52227}' from endpoint 1 with groupID 0
z2m: Received Zigbee message from '0xa4c138b52c206708', type 'commandActiveStatusReport', cluster 'manuSpecificTuya', data '{"dpValues":[{"data":{"data":[3],"type":"Buffer"},"datatype":4,"dp":104}],"seq":42243}' from endpoint 1 with groupID 0
z2m: Received Zigbee message from '0xa4c138b52c206708', type 'commandActiveStatusReport', cluster 'manuSpecificTuya', data '{"dpValues":[{"data":{"data":[3],"type":"Buffer"},"datatype":4,"dp":104}],"seq":42499}' from endpoint 1 with groupID 0
z2m: Received Zigbee message from '0xa4c138b52c206708', type 'commandActiveStatusReport', cluster 'manuSpecificTuya', data '{"dpValues":[{"data":{"data":[3],"type":"Buffer"},"datatype":4,"dp":104}],"seq":42755}' from endpoint 1 with groupID 0
z2m: Received Zigbee message from '0xa4c138b52c206708', type 'commandActiveStatusReport', cluster 'manuSpecificTuya', data '{"dpValues":[{"data":{"data":[3],"type":"Buffer"},"datatype":4,"dp":104}],"seq":44291}' from endpoint 1 with groupID 0
z2m: Received Zigbee message from '0xa4c138b52c206708', type 'commandActiveStatusReport', cluster 'manuSpecificTuya', data '{"dpValues":[{"data":{"data":[3],"type":"Buffer"},"datatype":4,"dp":104}],"seq":44547}' from endpoint 1 with groupID 0
z2m: Received Zigbee message from '0xa4c138b52c206708', type 'commandActiveStatusReport', cluster 'manuSpecificTuya', data '{"dpValues":[{"data":{"data":[3],"type":"Buffer"},"datatype":4,"dp":104}],"seq":46083}' from endpoint 1 with groupID 0
z2m: Received Zigbee message from '0xa4c138b52c206708', type 'commandActiveStatusReport', cluster 'manuSpecificTuya', data '{"dpValues":[{"data":{"data":[3],"type":"Buffer"},"datatype":4,"dp":104}],"seq":46339}' from endpoint 1 with groupID 0
z2m: Received Zigbee message from '0xa4c138b52c206708', type 'commandActiveStatusReport', cluster 'manuSpecificTuya', data '{"dpValues":[{"data":{"data":[3],"type":"Buffer"},"datatype":4,"dp":104}],"seq":47619}' from endpoint 1 with groupID 0
z2m: Received Zigbee message from '0xa4c138b52c206708', type 'commandActiveStatusReport', cluster 'manuSpecificTuya', data '{"dpValues":[{"data":{"data":[3],"type":"Buffer"},"datatype":4,"dp":104}],"seq":47875}' from endpoint 1 with groupID 0
z2m: Received Zigbee message from '0xa4c138b52c206708', type 'commandActiveStatusReport', cluster 'manuSpecificTuya', data '{"dpValues":[{"data":{"data":[3],"type":"Buffer"},"datatype":4,"dp":104}],"seq":48131}' from endpoint 1 with groupID 0
z2m: Received Zigbee message from '0xa4c138b52c206708', type 'commandActiveStatusReport', cluster 'manuSpecificTuya', data '{"dpValues":[{"data":{"data":[3],"type":"Buffer"},"datatype":4,"dp":104}],"seq":48387}' from endpoint 1 with groupID 0
z2m: Received Zigbee message from '0xa4c138b52c206708', type 'commandActiveStatusReport', cluster 'manuSpecificTuya', data '{"dpValues":[{"data":{"data":[3],"type":"Buffer"},"datatype":4,"dp":104}],"seq":48643}' from endpoint 1 with groupID 0
z2m: Received Zigbee message from '0xa4c138b52c206708', type 'commandActiveStatusReport', cluster 'manuSpecificTuya', data '{"dpValues":[{"data":{"data":[3],"type":"Buffer"},"datatype":4,"dp":104}],"seq":48899}' from endpoint 1 with groupID 0
z2m: Received Zigbee message from '0xa4c138b52c206708', type 'commandActiveStatusReport', cluster 'manuSpecificTuya', data '{"dpValues":[{"data":{"data":[3],"type":"Buffer"},"datatype":4,"dp":104}],"seq":49155}' from endpoint 1 with groupID 0
z2m: Received Zigbee message from '0xa4c138b52c206708', type 'commandActiveStatusReport', cluster 'manuSpecificTuya', data '{"dpValues":[{"data":{"data":[3],"type":"Buffer"},"datatype":4,"dp":104}],"seq":50435}' from endpoint 1 with groupID 0
z2m: Received Zigbee message from '0xa4c138b52c206708', type 'commandActiveStatusReport', cluster 'manuSpecificTuya', data '{"dpValues":[{"data":{"data":[3],"type":"Buffer"},"datatype":4,"dp":104}],"seq":50691}' from endpoint 1 with groupID 0
z2m: Received Zigbee message from '0xa4c138b52c206708', type 'commandActiveStatusReport', cluster 'manuSpecificTuya', data '{"dpValues":[{"data":{"data":[3],"type":"Buffer"},"datatype":4,"dp":104}],"seq":50947}' from endpoint 1 with groupID 0
z2m: Received Zigbee message from '0xa4c138b52c206708', type 'commandActiveStatusReport', cluster 'manuSpecificTuya', data '{"dpValues":[{"data":{"data":[3],"type":"Buffer"},"datatype":4,"dp":104}],"seq":52483}' from endpoint 1 with groupID 0
z2m: Received Zigbee message from '0xa4c138b52c206708', type 'commandActiveStatusReport', cluster 'manuSpecificTuya', data '{"dpValues":[{"data":{"data":[3],"type":"Buffer"},"datatype":4,"dp":104}],"seq":52995}' from endpoint 1 with groupID 0
z2m: Received Zigbee message from '0xa4c138b52c206708', type 'commandActiveStatusReport', cluster 'manuSpecificTuya', data '{"dpValues":[{"data":{"data":[3],"type":"Buffer"},"datatype":4,"dp":104}],"seq":53251}' from endpoint 1 with groupID 0
z2m: Received Zigbee message from '0xa4c138b52c206708', type 'commandActiveStatusReport', cluster 'manuSpecificTuya', data '{"dpValues":[{"data":{"data":[3],"type":"Buffer"},"datatype":4,"dp":104}],"seq":53763}' from endpoint 1 with groupID 0
z2m: Received Zigbee message from '0xa4c138b52c206708', type 'commandActiveStatusReport', cluster 'manuSpecificTuya', data '{"dpValues":[{"data":{"data":[3],"type":"Buffer"},"datatype":4,"dp":104}],"seq":55299}' from endpoint 1 with groupID 0
z2m: Received Zigbee message from '0xa4c138b52c206708', type 'commandActiveStatusReport', cluster 'manuSpecificTuya', data '{"dpValues":[{"data":{"data":[3],"type":"Buffer"},"datatype":4,"dp":104}],"seq":55555}' from endpoint 1 with groupID 0
z2m: Received Zigbee message from '0xa4c138b52c206708', type 'commandActiveStatusReport', cluster 'manuSpecificTuya', data '{"dpValues":[{"data":{"data":[3],"type":"Buffer"},"datatype":4,"dp":104}],"seq":55811}' from endpoint 1 with groupID 0
# Additional
z2m: Received Zigbee message from '0xa4c138b52c206708', type 'raw', cluster '57344', data '{"data":[9,60,208],"type":"Buffer"}' from endpoint 1 with groupID 0
z2m: Received Zigbee message from '0xa4c138b52c206708', type 'raw', cluster '57344', data '{"data":[9,60,208],"type":"Buffer"}' from endpoint 1 with groupID 0
z2m: Received Zigbee message from '0xa4c138b52c206708', type 'raw', cluster '57344', data '{"data":[9,95,208],"type":"Buffer"}' from endpoint 1 with groupID 0
z2m: Received Zigbee message from '0xa4c138b52c206708', type 'raw', cluster '57344', data '{"data":[9,95,208],"type":"Buffer"}' from endpoint 1 with groupID 0
DP 104 (status) seems to have values from 0 to 3
Latest converter
const tuya = require('zigbee-herdsman-converters/lib/tuya');
const exposes = require('zigbee-herdsman-converters/lib/exposes');
const e = exposes.presets;
const ea = exposes.access;
const parseAxis = (v) => Array.isArray(v) ? ((v[v.length-1] > 127) ? v[v.length-1]-256 : v[v.length-1]) : v;
const device = {
zigbeeModel: ["TS0210"],
fingerprint: [{ modelID: 'TS0210', manufacturerName: '_TZ32101000000_5oy7cysk' }],
model: "TS0210",
vendor: "Tuya",
description: "Vibration sensor",
fromZigbee: [tuya.fz.datapoints],
toZigbee: [tuya.tz.datapoints],
configure: tuya.configureMagicPacket,
exposes: [
e.vibration(), // dp 1
e.tilt(), // dp 6
e.numeric("x", ea.STATE).withValueMin(-128).withValueMax(127).withValueStep(1).withDescription("X axis value"),
e.numeric("y", ea.STATE).withValueMin(-128).withValueMax(127).withValueStep(1).withDescription("Y axis value"),
e.numeric("z", ea.STATE).withValueMin(-128).withValueMax(127).withValueStep(1).withDescription("Z axis value"),
e.numeric("battery", ea.STATE).withUnit("%").withValueMin(0).withValueMax(100).withDescription("Battery level"),
e.enum("sensitivity", ea.STATE_SET, ["low", "middle", "high"]).withDescription("Vibration detection sensitivity"),
e.enum("state", ea.STATE, ["none", "vibration", "tilt", "drop"]).withDescription("Vibration state"),
],
meta: {
tuyaDatapoints: [
[1, 'vibration', tuya.valueConverter.trueFalseEnum1],
[4, 'battery', tuya.valueConverterBasic.raw()],
[6, 'tilt', tuya.valueConverter.trueFalseEnum1],
[101, 'x', {from: parseAxis}],
[102, 'y', {from: parseAxis}],
[103, 'z', {from: parseAxis}],
[104, 'state', tuya.valueConverterBasic.lookup({ // mapping may be wrong
none: tuya.enum(0),
vibration: tuya.enum(1),
tilt: tuya.enum(2),
drop: tuya.enum(3),
})],
[105, 'sensitivity', tuya.valueConverterBasic.lookup({
low: tuya.enum(0),
middle: tuya.enum(1),
high: tuya.enum(2),
})],
],
},
};
module.exports = [device];
I also tried to manually edit the tuya.js file in append _TZ32101000000_5oy7cysk under ZG-1013Z but Z2M still detected it as TS0210. Even when I used a converter to set _TZ32101000000_5oy7cysk as ZG-1013Z, Z2M still detected it as TS0210.
Here's the converter that I used.
const fz = require("zigbee-herdsman-converters/converters/fromZigbee");
const tz = require("zigbee-herdsman-converters/converters/toZigbee");
const color = require("zigbee-herdsman-converters/lib/color");
const exposes = require("zigbee-herdsman-converters/lib/exposes");
const reporting = require("zigbee-herdsman-converters/lib/reporting");
const tuya = require("zigbee-herdsman-converters/lib/tuya");
const e = exposes.presets;
const ea = exposes.access;
const legacy = require("zigbee-herdsman-converters/lib/legacy");
const lumi = require("zigbee-herdsman-converters/lib/lumi");
const utils = require("zigbee-herdsman-converters/lib/utils");
const {logger} = require("zigbee-herdsman-converters/lib/logger");
const {develcoModernExtend} = require("zigbee-herdsman-converters/lib/develco");
const m = require("zigbee-herdsman-converters/lib/modernExtend");
const definition = {
zigbeeModel: ["ZG-103Z"],
fingerprint: tuya.fingerprint("TS0601", ["_TZE200_iba1ckek", "_TZE200_hggxgsjj", "_TZE200_yjryxpot", "_TZE200_afycb3cg", "_TZ32101000000_5oy7cysk"]),
model: "ZG-103Z",
vendor: "Tuya",
description: "Vibration sensor CUSTOM",
fromZigbee: [tuya.fz.datapoints],
toZigbee: [tuya.tz.datapoints],
configure: tuya.configureMagicPacket,
exposes: [
e.vibration(),
e.tilt(),
e.numeric("x", ea.STATE).withValueMin(0).withValueMax(256).withValueStep(1).withDescription("X coordinate"),
e.numeric("y", ea.STATE).withValueMin(0).withValueMax(256).withValueStep(1).withDescription("Y coordinate"),
e.numeric("z", ea.STATE).withValueMin(0).withValueMax(256).withValueStep(1).withDescription("Z coordinate"),
e.battery(),
e.enum("sensitivity", ea.STATE_SET, ["low", "middle", "high"]).withDescription("Vibration detection sensitivity"),
],
meta: {
tuyaDatapoints: [
[1, "vibration", tuya.valueConverter.trueFalseEnum1],
[7, "tilt", tuya.valueConverter.trueFalseEnum1],
[101, "x", tuya.valueConverter.raw],
[102, "y", tuya.valueConverter.raw],
[103, "z", tuya.valueConverter.raw],
[
104,
"sensitivity",
tuya.valueConverterBasic.lookup({
low: tuya.enum(0),
middle: tuya.enum(1),
high: tuya.enum(2),
}),
],
[105, "battery", tuya.valueConverter.raw],
],
},
};
module.exports = definition;
I tried manually adding _TZ32101000000_5oy7cysk to node_modules/.pnpm/[email protected]/node_modules/zigbee-herdsman-converters/dist/devices/tuya.js and restarting Z2M, but it's weird that it's still detected as TS0210.
fingerprint: tuya.fingerprint("TS0601", ["_TZE200_iba1ckek", "_TZE200_hggxgsjj", "_TZE200_yjryxpot", "_TZE200_afycb3cg", "_TZ32101000000_5oy7cysk"]),
I am having the same problem, happy to help with debug/testing if needed :)
Hey, I am also experiencing this problem with this particular sensor, hope it gets resolved soon!
I also tried to manually edit the
tuya.jsfile in append_TZ32101000000_5oy7cyskunderZG-1013Zbut Z2M still detected it asTS0210. Even when I used a converter to set_TZ32101000000_5oy7cyskasZG-1013Z, Z2M still detected it asTS0210.Here's the converter that I used.
const definition = { zigbeeModel: ["ZG-103Z"], fingerprint: tuya.fingerprint("TS0601", ["_TZE200_iba1ckek", "_TZE200_hggxgsjj", "_TZE200_yjryxpot", "_TZE200_afycb3cg", "_TZ32101000000_5oy7cysk"]), model: "ZG-103Z",
@zanemendoza123
A fingerprint consists of a Zigbee Model (which is TS0210 in our case) and a list of matching manufacturer identifiers behind (which is _TZ32101000000_5oy7cysk in our case). This is why this approach won't work (see also my post) I'm not sure about the extra zigbeeModel before the fingerprint.
The tuya dashboard also lists the DP's, also listed in my post. They mostly do not match the ones of the ZG-103Z. 105 for example is for sensitivity on our device, ZG-103Z has it as battery 101-103 do match, this is why you'll get X/Y/Z readings ZG-103Z has a DP 7, which ours doesnt have..
So I got the vibration detection working (the most important component for what I need), but not sure how accurate it is.
const tuya = require('zigbee-herdsman-converters/lib/tuya');
const exposes = require('zigbee-herdsman-converters/lib/exposes');
const e = exposes.presets;
const ea = exposes.access;
const definition = {
zigbeeModel: ["TS0210"],
fingerprint: tuya.fingerprint("TS0210", ["_TZ32101000000_5oy7cysk"]),
model: "TS0210",
vendor: "Tuya",
description: "Vibration sensor",
fromZigbee: [tuya.fz.datapoints],
toZigbee: [tuya.tz.datapoints],
configure: tuya.configureMagicPacket,
exposes: [
e.vibration(),
e.numeric("x", ea.STATE).withValueMin(0).withValueMax(256).withValueStep(1).withDescription("X coordinate"),
e.numeric("y", ea.STATE).withValueMin(0).withValueMax(256).withValueStep(1).withDescription("Y coordinate"),
e.numeric("z", ea.STATE).withValueMin(0).withValueMax(256).withValueStep(1).withDescription("Z coordinate"),
e.battery(),
e.enum("sensitivity", ea.STATE_SET, ["low", "middle", "high"]).withDescription("Vibration detection sensitivity"),
],
meta: {
tuyaDatapoints: [
[4, "battery", tuya.valueConverterBasic],
[101, "x", tuya.valueConverter.raw],
[102, "y", tuya.valueConverter.raw],
[103, "z", tuya.valueConverter.raw],
[104, "vibration", tuya.valueConverter.trueFalseEnum1],
[
105,
"sensitivity",
tuya.valueConverterBasic.lookup({
low: tuya.enum(0),
middle: tuya.enum(1),
high: tuya.enum(2),
}),
],
],
},
};
module.exports = definition;
So I got the vibration detection working (the most important component for what I need), but not sure how accurate it is.
const tuya = require('zigbee-herdsman-converters/lib/tuya'); const exposes = require('zigbee-herdsman-converters/lib/exposes'); const e = exposes.presets; const ea = exposes.access;
const definition = { zigbeeModel: ["TS0210"], fingerprint: tuya.fingerprint("TS0210", ["_TZ32101000000_5oy7cysk"]), model: "TS0210", vendor: "Tuya", description: "Vibration sensor", fromZigbee: [tuya.fz.datapoints], toZigbee: [tuya.tz.datapoints], configure: tuya.configureMagicPacket, exposes: [ e.vibration(), e.numeric("x", ea.STATE).withValueMin(0).withValueMax(256).withValueStep(1).withDescription("X coordinate"), e.numeric("y", ea.STATE).withValueMin(0).withValueMax(256).withValueStep(1).withDescription("Y coordinate"), e.numeric("z", ea.STATE).withValueMin(0).withValueMax(256).withValueStep(1).withDescription("Z coordinate"), e.battery(), e.enum("sensitivity", ea.STATE_SET, ["low", "middle", "high"]).withDescription("Vibration detection sensitivity"), ], meta: { tuyaDatapoints: [ [4, "battery", tuya.valueConverterBasic], [101, "x", tuya.valueConverter.raw], [102, "y", tuya.valueConverter.raw], [103, "z", tuya.valueConverter.raw], [104, "vibration", tuya.valueConverter.trueFalseEnum1], [ 105, "sensitivity", tuya.valueConverterBasic.lookup({ low: tuya.enum(0), middle: tuya.enum(1), high: tuya.enum(2), }), ], ], }, };
module.exports = definition;
It seems pretty accurate, is it possible to also specify timeout like in the original version?
How would I add this to Z2m running as an add on in HA?
@jimmyeao You can add that custom external converter foer now by publishing it on mqtt: https://www.zigbee2mqtt.io/advanced/more/external_converters.html#save-converter
How would I add this to Z2m running as an add on in HA?
The latest version of Z2M supports automatic loading of "external converters" in config\zigbee2mqtt\external_converters. Please note: in most cases you will need to use a "Share" addon (like the famous "Samba Share") to actually access the config\... folder in your HA istance.
If you're using v.2.6.2 then you might want to go the "easy route" and use the Dev Console: the External Converter tab will allow to create the file and save it in the same folder without having to mess with the access privileges. I think you have to put also the extension in the "File Name" field to make it work (something like "ZG-103Z-Manual.js" for example)
Aside from the method chosen (which will eventually result in the same action: a custom file will be created in the config\zigbee2mqtt\external_converters folder), you then need to restart Z2M and remove/re-add the sensor to verify if it works. It may also be a good idea to keep an eye on the logs after restarting, to check if it is actually loading the external converter without issues.
Good luck!
EDIT: after the reboot, if the external converter has been loaded, you will notice a little "blue arrow" near the left corner of the device image in the dashboard.
EDIT 2:
I tried the converter, but I could not get any data from the sensor: the dashboard is now reflecting the changes for the entity, so there is at least that.
anyone got it to work?
anyone got it to work?
So far, all my attempts have been unsuccessful with this specific model.
Confirmed working. Vibration, x, y. z report correctly. I am also able to set sensitivity and read battery status.
Confirmed working. Vibration, x, y. z report correctly. I am also able to set sensitivity and read battery status.
Can you share how you got it working?