умный_дом
Конвертер zigbee2mqtt для привода штор sibling
- curtain.js
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 tuya = require('zigbee-herdsman-converters/lib/tuya'); const e = exposes.presets; const ea = exposes.access; const definition = { zigbeeModel: ['TS0601'], model: 'TS0601_curtain', vendor: 'Tuya', description: 'Zigbee curtain switch', fromZigbee: [tuya.fz.datapoints], toZigbee: [tuya.tz.datapoints], onEvent: tuya.onEventSetTime, configure: tuya.configureMagicPacket, exposes: [ e.cover_position().setAccess('position', ea.STATE_SET), e.enum('motor_status', ea.STATE, ['0', '1', '2']).withDescription('Motor status'), ], meta: { tuyaDatapoints: [ [1, 'state', tuya.valueConverterBasic.lookup({'OPEN': tuya.enum(0), 'STOP': tuya.enum(1), 'CLOSE': tuya.enum(2)})], [2, 'position', tuya.valueConverter.coverPosition], [3, 'position', tuya.valueConverter.raw], [7, 'motor_status',tuya.valueConverter.raw], ], }, }; module.exports = definition;
умный_дом.txt · Последнее изменение: — augin