updated z2m config for v2.0

This commit is contained in:
nikzori
2025-09-22 14:11:10 +03:00
parent 866c84a16e
commit 0441bb8913

View File

@@ -7,10 +7,6 @@ const e = exposes.presets;
const ea = exposes.access; const ea = exposes.access;
const tuya = require('zigbee-herdsman-converters/lib/tuya'); const tuya = require('zigbee-herdsman-converters/lib/tuya');
const tzDatapoints = {
...tuya.tz.datapoints,
key: ['switch', 'fault', 'alarm', 'battery', 'cleaning']
}
const definition = { const definition = {
fingerprint: [ fingerprint: [
{ {
@@ -18,12 +14,12 @@ const definition = {
manufacturerName: '_TZE200_yltivvzb', manufacturerName: '_TZE200_yltivvzb',
}, },
], ],
model: 'Gidrolock Winner', model: 'Winner Zigbee',
vendor: 'Gidrolock', vendor: 'Gidrolock',
description: 'Gidrolock smart water valve', description: 'Gidrolock smart water valve controller',
fromZigbee: [tuya.fz.datapoints], fromZigbee: [tuya.fz.datapoints],
toZigbee: [tzDatapoints], toZigbee: [tuya.tz.datapoints],
onEvent: tuya.onEventSetTime, configure: tuya.configureMagicPacket,
exposes: [ exposes: [
exposes.presets.enum('fault', ea.STATE, ['low_battery', 'fault', 'lack_water', 'sensor_fault', 'motor_fault', 'low_temp']).withCategory('diagnostic'), exposes.presets.enum('fault', ea.STATE, ['low_battery', 'fault', 'lack_water', 'sensor_fault', 'motor_fault', 'low_temp']).withCategory('diagnostic'),
exposes.presets.binary('switch', ea.STATE_SET, true, false ).withLabel('Valve status:'), exposes.presets.binary('switch', ea.STATE_SET, true, false ).withLabel('Valve status:'),
@@ -38,12 +34,12 @@ const definition = {
[101, 'alarm', tuya.valueConverter.raw], [101, 'alarm', tuya.valueConverter.raw],
[102, 'battery', tuya.valueConverterBasic.lookup({'10': tuya.enum(0), '20': tuya.enum(1), '30': tuya.enum(2), '40': tuya.enum(3), '50': tuya.enum(4), '60': tuya.enum(5), '70': tuya.enum(6), '80': tuya.enum(7), '90': tuya.enum(8), '100': tuya.enum(9), '101': tuya.enum(10)})], [102, 'battery', tuya.valueConverterBasic.lookup({'10': tuya.enum(0), '20': tuya.enum(1), '30': tuya.enum(2), '40': tuya.enum(3), '50': tuya.enum(4), '60': tuya.enum(5), '70': tuya.enum(6), '80': tuya.enum(7), '90': tuya.enum(8), '100': tuya.enum(9), '101': tuya.enum(10)})],
[104, 'cleaning', tuya.valueConverter.raw] [104, 'cleaning', tuya.valueConverter.raw]
], ]
}, },
extend: [ extend: [
tuya.modernExtend.tuyaMagicPacket(), tuya.modernExtend.tuyaMagicPacket(),
], ],
}; };
module.exports = definition; module.exports = definition;