Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Zigbee fingerbot plus #5883

Merged
merged 15 commits into from
Jun 19, 2023
43 changes: 42 additions & 1 deletion src/devices/tuya.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1920,7 +1920,6 @@ const definitions: Definition[] = [
extend: tuya.extend.switch(),
whiteLabel: [{vendor: 'CR Smart Home', model: 'TS0001', description: 'Valve control'}, {vendor: 'Lonsonho', model: 'X701'},
{vendor: 'Bandi', model: 'BDS03G1'},
tuya.whitelabel('Adaprox', 'TS0001_1', 'White Zigbee fingbot plus', ['_TZ3210_dse8ogfy']),
],
configure: async (device, coordinatorEndpoint, logger) => {
await tuya.configureMagicPacket(device, coordinatorEndpoint, logger);
Expand Down Expand Up @@ -4903,6 +4902,48 @@ const definitions: Definition[] = [
tuya.whitelabel('Marmitek', 'SM0202_1', 'Motion sensor', ['_TYZB01_yr95mpib']),
],
},
{
fingerprint: tuya.fingerprint('TS0001', ['_TZ3210_dse8ogfy']),
model: 'TS0001_fingerbot',
vendor: 'TuYa',
description: 'Zigbee fingerbot plus',
whiteLabel: [
tuya.whitelabel('Adaprox', 'TS0001_fingerbot_1', 'Zigbee fingerbot plus', ['_TZ3210_dse8ogfy']),
],
fromZigbee: [fz.on_off, tuya.fz.datapoints],
toZigbee: [tz.on_off, tuya.tz.datapoints],
exposes: [
e.switch(), e.battery(),
e.enum('mode', ea.STATE_SET, ['click', 'switch', 'program']).withDescription('Working mode'),
e.numeric('lower', ea.STATE_SET).withValueMin(50).withValueMax(100).withValueStep(1).withUnit('%')
.withDescription('Down movement limit'),
e.numeric('upper', ea.STATE_SET).withValueMin(0).withValueMax(50).withValueStep(1).withUnit('%')
.withDescription('Up movement limit'),
e.numeric('delay', ea.STATE_SET).withValueMin(0).withValueMax(10).withValueStep(1).withUnit('s')
.withDescription('Sustain time'),
e.binary('reverse', ea.STATE_SET, 'ON', 'OFF').withDescription('Reverse'),
e.binary('touch', ea.STATE_SET, 'ON', 'OFF').withDescription('Touch controll'),
],
configure: async (device, coordinatorEndpoint, logger) => {
await tuya.configureMagicPacket(device, coordinatorEndpoint, logger);
await reporting.bind(device.getEndpoint(1), coordinatorEndpoint, ['genOnOff']);
},
meta: {
tuyaSendCommand: 'sendData',
tuyaDatapoints: [
[0x65, 'mode', tuya.valueConverterBasic.lookup({'click': tuya.enum(0), 'switch': tuya.enum(1), 'program': tuya.enum(2)})],
[0x66, 'lower', tuya.valueConverter.raw],
[0x67, 'delay', tuya.valueConverter.raw],
[0x68, 'reverse', tuya.valueConverterBasic.lookup({'ON': tuya.enum(1), 'OFF': tuya.enum(0)})],
[0x69, 'battery', tuya.valueConverter.raw],
[0x6a, 'upper', tuya.valueConverter.raw],
[0x6b, 'touch', tuya.valueConverterBasic.lookup({'ON': true, 'OFF': false})],
// ? [0x6c, '', tuya.valueConverter.onOff],
[0x6d, 'program', tuya.valueConverter.raw],
// ? [0x70, '', tuya.valueConverter.raw],
],
},
},
];

module.exports = definitions;
1 change: 1 addition & 0 deletions src/lib/tuya.ts
Original file line number Diff line number Diff line change
Expand Up @@ -776,6 +776,7 @@ const tuyaTz = {
'min_temperature', 'max_temperature', 'window_detection', 'boost_heating', 'alarm_ringtone', 'alarm_time', 'fan_speed',
'reverse_direction', 'border', 'click_control', 'motor_direction', 'opening_mode', 'factory_reset', 'set_upper_limit', 'set_bottom_limit',
'motor_speed', 'timer', 'reset_frost_lock', 'schedule_periodic', 'schedule_weekday', 'backlight_mode', 'calibration', 'motor_steering',
'mode', 'lower', 'upper', 'delay', 'reverse', 'touch', 'program',
...[1, 2, 3, 4, 5, 6].map((no) => `schedule_slot_${no}`), 'minimum_range', 'maximum_range', 'detection_delay', 'fading_time',
],
convertSet: async (entity, key, value, meta) => {
Expand Down