Last active
October 27, 2023 00:51
-
-
Save donbobka/513167a4599c7dc1f74fde0de147bee7 to your computer and use it in GitHub Desktop.
Support battery and limits for ZM25RX-08/30
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 definitions = [ | |
{ | |
fingerprint: [ | |
{modelID: 'TS0601', manufacturerName: '_TZE200_7eue9vhc'}, | |
{modelID: 'TS0601', manufacturerName: '_TZE200_bv1jcqqu'}, | |
], | |
whiteLabel: [ | |
tuya.whitelabel('Zemismart', 'ZM25RX-08/30', 'Tubular motor', ['_TZE200_bv1jcqqu', '_TZE200_7eue9vhc']), | |
], | |
model: 'TS0601_cover_8', | |
vendor: 'TuYa', | |
description: 'Cover motor', | |
onEvent: tuya.onEvent(), | |
configure: tuya.configureMagicPacket, | |
fromZigbee: [tuya.fz.datapoints], | |
toZigbee: [tuya.tz.datapoints], | |
options: [exposes.options.invert_cover()], | |
exposes: [ | |
e.text('work_state', ea.STATE), | |
e.cover_position().setAccess('position', ea.STATE_SET), | |
e.battery(), | |
// it's also has `UPPER`/`LOWER` command that can be used to move motor over set limit, but it's not clear why :) | |
e.enum('program', ea.SET, ['SET BOTTOM', 'SET UPPER', 'RESET', /* 'UPPER', 'LOWER', */]).withDescription('Set the upper/bottom limit'), | |
e.enum('motor_direction', ea.STATE_SET, ['NORMAL', 'REVERSED']).withDescription('Motor direction'), | |
], | |
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.coverPosition], | |
[5, 'motor_direction', tuya.valueConverterBasic.lookup({'NORMAL': tuya.enum(0), 'REVERSED': tuya.enum(1)})], | |
[7, 'work_state', tuya.valueConverterBasic.lookup({'standby': tuya.enum(0), 'success': tuya.enum(1), 'learning': tuya.enum(2)})], | |
[13, 'battery', tuya.valueConverter.raw], | |
[101, 'program', tuya.valueConverterBasic.lookup({'SET BOTTOM': tuya.enum(0), 'SET UPPER': tuya.enum(1), 'RESET': tuya.enum(4), 'LOWER': tuya.enum(2), 'UPPER': tuya.enum(3)})], | |
], | |
}, | |
}, | |
] | |
module.exports = definitions; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment