Koenkk / zigbee2mqtt

Zigbee 🐝 to MQTT bridge 🌉, get rid of your proprietary Zigbee bridges 🔨
https://www.zigbee2mqtt.io
GNU General Public License v3.0
12.07k stars 1.67k forks source link

[New device support]: _TZE204_e1hutaaj Fan switch ZN2S-RS1E-SF #24451

Open silvhino opened 1 week ago

silvhino commented 1 week ago

Link

https://fr.aliexpress.com/item/1005007443856555.html?spm=a2g0o.detail.pcDetailBottomMoreOtherSeller.7.4b37zI4NzI4NIZ&gps-id=pcDetailBottomMoreOtherSeller&scm=1007.40050.354490.0&scm_id=1007.40050.354490.0&scm-url=1007.40050.354490.0&pvid=33ceecbb-938a-49ad-b5d0-3e04edad122b&_t=gps-id:pcDetailBottomMoreOtherSeller,scm-url:1007.40050.354490.0,pvid:33ceecbb-938a-49ad-b5d0-3e04edad122b,tpp_buckets:668%232846%238115%232000&pdp_npi=4%40dis%21EUR%2126.44%2119.64%21%21%2127.88%2120.71%21%40211b813b17296742280561353e1c4f%2112000040775485358%21rec%21FR%21%21ABX&utparam-url=scene%3ApcDetailBottomMoreOtherSeller%7Cquery_from%3A

Database entry

{"id":76,"type":"Router","ieeeAddr":"0xa4c138cc7786c831","nwkAddr":7645,"manufId":4417,"manufName":"_TZE204_e1hutaaj","powerSource":"Mains (single phase)","modelId":"TS0601","epList":[1,242],"endpoints":{"1":{"profId":260,"epId":1,"devId":81,"inClusterList":[4,5,61184,0],"outClusterList":[25,10],"clusters":{"genBasic":{"attributes":{"65503":"n5�.i","65506":56,"65508":0,"65534":0,"stackVersion":0,"dateCode":"","manufacturerName":"_TZE204_e1hutaaj","zclVersion":3,"appVersion":74,"modelId":"TS0601","powerSource":1}}},"binds":[],"configuredReportings":[],"meta":{}},"242":{"profId":41440,"epId":242,"devId":97,"inClusterList":[],"outClusterList":[33],"clusters":{},"binds":[],"configuredReportings":[],"meta":{}}},"appVersion":74,"stackVersion":0,"hwVersion":1,"dateCode":"","zclVersion":3,"interviewCompleted":true,"meta":{"configured":217189513},"lastSeen":1729672490202}

Zigbee2MQTT version

1.40.2

Comments

Hey! I have nice Zigbee Fan Switch with speed in % Zemismart Fan Switch

Tuya Datapoint are :

fan switch - Code 1 fan speed - Code 4 On color - Code 101 OFF color - Code 102 Backlight - Code 103 Child Lock - Code 104 Minimum Speed - Code 105 Power-on state Setting - Code 11 Indicator status setting - Code 12 Backlight Switch - Code 13

and all Standart Instruction Set from Device Debugging Mode:

[ { "code": "switch_fan", "value": false }, { "code": "fan_speed", "value": 1 }, { "code": "relay_status" }, { "code": "light_mode" }, { "code": "backlight_switch", "value": false } ]

I made converter for this:

External definition

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 reporting = require('zigbee-herdsman-converters/lib/reporting');
const {} = require('zigbee-herdsman-converters/lib/modernExtend');
const e = exposes.presets;
const ea = exposes.access;
const tuya = require('zigbee-herdsman-converters/lib/tuya');

const definition = {
fingerprint: [
{
modelID: 'TS0601',
manufacturerName: '_TZE204_e1hutaaj',
},
],
model: 'TS0601_new',
vendor: 'Zemismart',
description: 'Fan speed switch',
fromZigbee: [tuya.fz.datapoints],
toZigbee: [tuya.tz.datapoints],
configure: tuya.configureMagicPacket,
exposes: [
tuya.exposes.switch(),
exposes.numeric('fan_speed', ea.STATE_SET).withValueMin(0).withValueMax(100).withValueStep(1).withUnit('%').withDescription('Speed of the fan %'),
e.power_on_behavior(['off', 'on', 'previous']).withAccess(ea.STATE_SET),
e.enum('indicator', ea.ALL, ['off', 'off/on', 'on']).withDescription('LED indicator mode').withAccess(ea.STATE_SET),
exposes.binary('child_lock', ea.STATE_SET, 'ON', 'OFF').withDescription('Child Lock'),
exposes.numeric('minimum_speed', ea.STATE_SET).withValueMin(0).withValueMax(100).withValueStep(1).withUnit('%').withDescription('Vitesse minimale du ventilateur'),
],
meta: {
tuyaDatapoints: [
[1, 'state', tuya.valueConverter.onOff],
[4, 'fan_speed', tuya.valueConverter.raw],
[11, 'power_on_behavior', tuya.valueConverterBasic.lookup({'off': tuya.enum(0), 'on': tuya.enum(1), 'previous': tuya.enum(2)})],
[12, 'indicator', tuya.valueConverterBasic.lookup({'off': tuya.enum(0), 'off/on': tuya.enum(1), 'on': tuya.enum(2)})],
[13, 'backlight', tuya.valueConverter.onOff],
[104, 'child_lock', tuya.valueConverter.onOff],
[105, 'minimum_speed', tuya.valueConverter.raw],
],
},
};

module.exports = definition;

What does/doesn't work with the external definition?

Unfortunately changing color of the switch don't work Need your help. Thank you!

Lotambena commented 4 days ago

I have a similar switch but a fan light switch. It doesn't respond to your code.. still unsupported. I opened issue #24142