Koenkk / zigbee2mqtt

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

[New device support]: Ltech TY-150-24-G2Z2 #20066

Closed VyckaLTU closed 9 months ago

VyckaLTU commented 9 months ago

Link

http://www.ltechonline.com/html/en/products/Intelligence/zigbee/TY-150-24-G2Z2.html

Database entry

{"id":7,"type":"Router","ieeeAddr":"0x9035eafffed5520f","nwkAddr":5775,"manufId":4098,"manufName":"_TZE200_na98lvjp","powerSource":"Mains (single phase)","modelId":"TS0601","epList":[1],"endpoints":{"1":{"profId":260,"epId":1,"devId":81,"inClusterList":[0,4,5,61184],"outClusterList":[25,10],"clusters":{"genBasic":{"attributes":{"65503":"\u0000\u0000\u0000\u0000\u0007\u0000\u0000\u0000\u0000\u0007","65506":31,"65508":0,"modelId":"TS0601","manufacturerName":"_TZE200_na98lvjp","stackVersion":0,"dateCode":"","appVersion":72}}},"binds":[],"configuredReportings":[],"meta":{}}},"appVersion":72,"stackVersion":0,"hwVersion":1,"dateCode":"","zclVersion":3,"interviewCompleted":true,"meta":{},"lastSeen":1701846699348,"defaultSendRequestWhen":"immediate"}

Comments

This LTECH TY-150-24-G2Z2 driver is same as LTECH TY-75-24-G2Z2 which is already supported in Z2M. Difference between them is only power. One is 75W other 150W. And sadly 75W drivers integration is not working with 150W driver. It shows as unsupported device.

Here is 75W model - https://www.zigbee2mqtt.io/devices/TY-75-24-G2Z2.html

User @bummzulu in old post said he edited external converter to make it work. But I tried with no luck. In external converter I added his modified external converter.

Thank you.

1111

External converter

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 extend = require('zigbee-herdsman-converters/lib/extend');
const legacy = require('zigbee-herdsman-converters/lib/legacy');
const ota = require('zigbee-herdsman-converters/lib/ota');
const tuya = require('zigbee-herdsman-converters/lib/tuya');
const e = exposes.presets;
const ea = exposes.access;

const definition =     {
    fingerprint: [
        {modelID: 'TS0601', manufacturerName: '**_TZE200_na98lvjp**'}
    ],
    model: 'WZ5_cct',
    vendor: 'Skydance',
    description: 'Zigbee & RF 5 in 1 LED controller (CCT mode)',
    fromZigbee: [legacy.fz.tuya_light_wz5],
    toZigbee: [legacy.tz.tuya_dimmer_state, legacy.tz.tuya_light_wz5],
    exposes: [
        e.light().withBrightness().setAccess('state', ea.STATE_SET).setAccess('brightness', ea.STATE_SET).withColorTemp([250, 454]).setAccess('color_temp', ea.STATE_SET),
    ],
};

module.exports = definition;

Supported color modes

No response

Color temperature range

No response

bummzulu commented 9 months ago

Make sure you strictly follow the instruction on how to add an unsupported device (like change of configuration.yaml and adherence to correct file naming). In my case: WZ5_cct.js

Here my modified external convertert

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 extend = require('zigbee-herdsman-converters/lib/extend');
const legacy = require('zigbee-herdsman-converters/lib/legacy');
const ota = require('zigbee-herdsman-converters/lib/ota');
const tuya = require('zigbee-herdsman-converters/lib/tuya');
const e = exposes.presets;
const ea = exposes.access;

const definition =     {
    fingerprint: [
        {modelID: 'TS0601', manufacturerName: '_TZE200_na98lvjp'}
    ],
    model: 'TY-75-24-G2Z2',
    vendor: 'Ltech',
    description: '150W 24V Zigbee CV tunable white LED driver',
    fromZigbee: [legacy.fz.tuya_light_wz5],
    toZigbee: [legacy.tz.tuya_dimmer_state, legacy.tz.tuya_light_wz5],
    exposes: [
        e.light().withBrightness().setAccess('state', ea.STATE_SET).setAccess('brightness', ea.STATE_SET).withColorTemp([250, 454]).setAccess('color_temp', ea.STATE_SET),
    ],
};

module.exports = definition;

image

VyckaLTU commented 9 months ago

@bummzulu Thank you. I copied your latest external converter and it worked ! Hope so it will be added to Z2M as supported device :)

Koenkk commented 9 months ago

Could you create a pull request to add support for this device?

bummzulu commented 9 months ago

would like to but have honestly no clue on how that works. Any instructions that you could share (didn't find when searching)

Koenkk commented 9 months ago

Added it!

Changes will be available in the dev branch in a few hours from now.