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

Added to HA Z2M Dir but still "not supported" #3

Closed
Jacksoldano opened this issue Apr 19, 2024 · 4 comments
Closed

Added to HA Z2M Dir but still "not supported" #3

Jacksoldano opened this issue Apr 19, 2024 · 4 comments

Comments

@Jacksoldano
Copy link

Jacksoldano commented Apr 19, 2024

Hello I'm really new to this and this is my first "not supported" device I'm adding to Z2M,

I've added the "_TZE200_libht6ua.js" to the "zigbee2mqtt" dir (Same location as the configuration.yaml)

and added,

external_converters:

  • _TZE200_libht6ua.js

to my configuration.yaml file but when I connect my device it's still saying it's unsupported (I did perform a full HA reboot before trying)

Lines added to configuration.yaml,

external_converters:
  - _TZE200_libht6ua.js

Device pairs fine with,

Zigbee Manufacturer: _TZE200_libht6ua
Zigbee Model: TS0601

Dev console gives me,

const definition = {
    zigbeeModel: ['TS0601'],
    model: 'TS0601',
    vendor: '_TZE200_libht6ua',
    description: 'Automatically generated definition',
    extend: [],
    meta: {},
};

module.exports = definition;

When I press buttons on the blinds I'm getting logs like as follow,

    Zigbee2MQTT:debug 2024-04-19 23:39:15: Received Zigbee message from '0x7cc6b6fffec1cd13', type 'commandDataReport', cluster 'manuSpecificTuya', data '{"dpValues":[{"data":{"data":[0,0,0,44],"type":"Buffer"},"datatype":2,"dp":3}],"seq":62208}' from endpoint 1 with groupID 0
    Zigbee2MQTT:debug 2024-04-19 23:39:15: Skipping message, still interviewing
    Zigbee2MQTT:debug 2024-04-19 23:39:16: Received Zigbee message from '0x7cc6b6fffec1cd13', type 'commandDataReport', cluster 'manuSpecificTuya', data '{"dpValues":[{"data":{"data":[2],"type":"Buffer"},"datatype":4,"dp":1}],"seq":62464}' from endpoint 1 with groupID 0
    Zigbee2MQTT:debug 2024-04-19 23:39:16: Skipping message, still interviewing
    Zigbee2MQTT:debug 2024-04-19 23:39:17: Received Zigbee message from '0x7cc6b6fffec1cd13', type 'commandDataReport', cluster 'manuSpecificTuya', data '{"dpValues":[{"data":{"data":[0,0,0,100],"type":"Buffer"},"datatype":2,"dp":3}],"seq":62720}' from endpoint 1 with groupID 0
    Zigbee2MQTT:debug 2024-04-19 23:39:17: Skipping message, still interviewing
    Zigbee2MQTT:debug 2024-04-19 23:39:17: Received Zigbee message from '0x7cc6b6fffec1cd13', type 'commandDataReport', cluster 'manuSpecificTuya', data '{"dpValues":[{"data":{"data":[0],"type":"Buffer"},"datatype":4,"dp":7}],"seq":62976}' from endpoint 1 with groupID 0
    Zigbee2MQTT:debug 2024-04-19 23:39:17: Skipping message, still interviewing
    Zigbee2MQTT:debug 2024-04-19 23:39:17: Received Zigbee message from '0x7cc6b6fffec1cd13', type 'commandDataReport', cluster 'manuSpecificTuya', data '{"dpValues":[{"data":{"data":[0],"type":"Buffer"},"datatype":5,"dp":12}],"seq":63232}' from endpoint 1 with groupID 0
    Zigbee2MQTT:debug 2024-04-19 23:39:17: Skipping message, still interviewing
    Zigbee2MQTT:debug 2024-04-19 23:39:18: Received Zigbee message from '0x7cc6b6fffec1cd13', type 'commandDataReport', cluster 'manuSpecificTuya', data '{"dpValues":[{"data":{"data":[0,0,0,100],"type":"Buffer"},"datatype":2,"dp":13}],"seq":63488}' from endpoint 1 with groupID 0
    Zigbee2MQTT:debug 2024-04-19 23:39:18: Skipping message, still interviewing
    Zigbee2MQTT:debug 2024-04-19 23:39:18: Received Zigbee message from '0x7cc6b6fffec1cd13', type 'commandDataReport', cluster 'manuSpecificTuya', data '{"dpValues":[{"data":{"data":[0],"type":"Buffer"},"datatype":4,"dp":101}],"seq":63744}' from endpoint 1 with groupID 0
    Zigbee2MQTT:debug 2024-04-19 23:39:18: Skipping message, still interviewing
    Zigbee2MQTT:debug 2024-04-19 23:39:18: Received Zigbee message from '0x7cc6b6fffec1cd13', type 'commandDataReport', cluster 'manuSpecificTuya', data '{"dpValues":[{"data":{"data":[0],"type":"Buffer"},"datatype":4,"dp":102}],"seq":64000}' from endpoint 1 with groupID 0
    Zigbee2MQTT:debug 2024-04-19 23:39:18: Skipping message, still interviewing
    Zigbee2MQTT:debug 2024-04-19 23:39:19: Received Zigbee message from '0x7cc6b6fffec1cd13', type 'commandDataReport', cluster 'manuSpecificTuya', data '{"dpValues":[{"data":{"data":[0,0,0,24],"type":"Buffer"},"datatype":2,"dp":103}],"seq":64256}' from endpoint 1 with groupID 0
    Zigbee2MQTT:debug 2024-04-19 23:39:19: Skipping message, still interviewing

Really sorry for the likely stupid question, but any advice on what I'm doing wrong / suggestions on a resource I can go to that can help me understand how to set this up?
https://www.zigbee2mqtt.io/advanced/support-new-devices/01_support_new_devices.html is not making this clear to me...

I'm using this device "https://es.aliexpress.com/item/1005006588337565.html?spm=a2g0o.order_list.order_list_main.5.7a43194dXjUNah&gatewayAdapt=glo2es

@ericsboro
Copy link
Contributor

ericsboro commented Apr 20, 2024 via email

@Jacksoldano
Copy link
Author

Thanks for the comment ericsboro,

I've resolved the issue of getting Z2M to detect this device, I was reading through this post Koenkk/zigbee2mqtt#22083 and the solution MrEcosse proposed with removing the "const extend = require('zigbee-herdsman-converters/lib/extend');" line and adding "const {} = require('zigbee-herdsman-converters/lib/modernExtend" allowed the device to be detected properly
!

So to conclude I changed the "_TZE200_libht6ua.js" as shown below the "_TZE200_libht6ua.js" is in my homeassistant/zigbee2mqtt/ dir (Same level as configuration.yaml)


const {} = require('zigbee-herdsman-converters/lib/modernExtend');
// Add the lines below
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 utils = require('zigbee-herdsman-converters/lib/utils');
const globalStore = require('zigbee-herdsman-converters/lib/store');
const e = exposes.presets;
const ea = exposes.access;
const tuya = require('zigbee-herdsman-converters/lib/tuya');

const definition = {
    // Since a lot of TuYa devices use the same modelID, but use different datapoints
    // it's necessary to provide a fingerprint instead of a zigbeeModel
    fingerprint: [
        {
            // The model ID from: Device with modelID 'TS0601' is not supported
            // You may need to add \u0000 at the end of the name in some cases
            modelID: 'TS0601',
            // The manufacturer name from: Device with modelID 'TS0601' is not supported.
            manufacturerName: '_TZE200_libht6ua',
        },
    ],
    model: 'TS0601_cover',
    vendor: 'TuYa',
    description: 'Cover motor',
    fromZigbee: [tuya.fz.datapoints],
    toZigbee: [tuya.tz.datapoints],
    onEvent: tuya.onEventSetTime, // Add this if you are getting no converter for 'commandMcuSyncTime'
    configure: tuya.configureMagicPacket,
    exposes: [
        e.cover_position().setAccess('position', ea.STATE_SET),e.battery(),e.binary('motor_fault', ea.STATE, true, false),
        e.enum('motor_direction', ea.STATE_SET, ['left', 'right']).withDescription('Motor side'),
        e.enum('set_upper_limit', ea.STATE_SET, ['start', 'stop']).withDescription('Learning')
    ],
        // Here you should put all functionality that your device exposes
    
    meta: {
        // All datapoints go in here
        tuyaDatapoints: [
            [1, 'state', tuya.valueConverterBasic.lookup({'OPEN': tuya.enum(2), 'STOP': tuya.enum(1), 'CLOSE': tuya.enum(0)})],
            [2, 'position', tuya.valueConverter.coverPosition],
            [3, 'position', tuya.valueConverter.raw],
            [12, 'motor_fault', tuya.valueConverter.trueFalse1],
            [13, 'battery', tuya.valueConverter.raw],
            [101, 'motor_direction', tuya.valueConverterBasic.lookup({ 'left': tuya.enum(0), 'right': tuya.enum(1) })],
            [102, 'set_upper_limit', tuya.valueConverterBasic.lookup({ 'start': tuya.enum(0), 'stop': tuya.enum(1) })],
                                
                                    
             //The datapoints below expose values but I can't detect why, I don't find them useful.
            [104], //when opening or closing and charging or not, expose value: 10
            [105], //when opening or closing and charging or not, expose value: 50 
            [7], //when opening or closing and charging or not, expose value: 2,
            [103], //maybe temperature, expose value: 22, 23, 28, 30, 50.. 
            [106], //when opening or closing and charging or not, expose value: 100,
            [108], //when opening or closing and charging or not, not expose value: "nothing",
        ],
    },
};

module.exports = definition;

@timknowlden
Copy link

Thanks for the comment ericsboro,

I've resolved the issue of getting Z2M to detect this device, I was reading through this post Koenkk/zigbee2mqtt#22083 and the solution MrEcosse proposed with removing the "const extend = require('zigbee-herdsman-converters/lib/extend');" line and adding "const {} = require('zigbee-herdsman-converters/lib/modernExtend" allowed the device to be detected properly !

So to conclude I changed the "_TZE200_libht6ua.js" as shown below the "_TZE200_libht6ua.js" is in my homeassistant/zigbee2mqtt/ dir (Same level as configuration.yaml)


const {} = require('zigbee-herdsman-converters/lib/modernExtend');
// Add the lines below
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 utils = require('zigbee-herdsman-converters/lib/utils');
const globalStore = require('zigbee-herdsman-converters/lib/store');
const e = exposes.presets;
const ea = exposes.access;
const tuya = require('zigbee-herdsman-converters/lib/tuya');

const definition = {
    // Since a lot of TuYa devices use the same modelID, but use different datapoints
    // it's necessary to provide a fingerprint instead of a zigbeeModel
    fingerprint: [
        {
            // The model ID from: Device with modelID 'TS0601' is not supported
            // You may need to add \u0000 at the end of the name in some cases
            modelID: 'TS0601',
            // The manufacturer name from: Device with modelID 'TS0601' is not supported.
            manufacturerName: '_TZE200_libht6ua',
        },
    ],
    model: 'TS0601_cover',
    vendor: 'TuYa',
    description: 'Cover motor',
    fromZigbee: [tuya.fz.datapoints],
    toZigbee: [tuya.tz.datapoints],
    onEvent: tuya.onEventSetTime, // Add this if you are getting no converter for 'commandMcuSyncTime'
    configure: tuya.configureMagicPacket,
    exposes: [
        e.cover_position().setAccess('position', ea.STATE_SET),e.battery(),e.binary('motor_fault', ea.STATE, true, false),
        e.enum('motor_direction', ea.STATE_SET, ['left', 'right']).withDescription('Motor side'),
        e.enum('set_upper_limit', ea.STATE_SET, ['start', 'stop']).withDescription('Learning')
    ],
        // Here you should put all functionality that your device exposes
    
    meta: {
        // All datapoints go in here
        tuyaDatapoints: [
            [1, 'state', tuya.valueConverterBasic.lookup({'OPEN': tuya.enum(2), 'STOP': tuya.enum(1), 'CLOSE': tuya.enum(0)})],
            [2, 'position', tuya.valueConverter.coverPosition],
            [3, 'position', tuya.valueConverter.raw],
            [12, 'motor_fault', tuya.valueConverter.trueFalse1],
            [13, 'battery', tuya.valueConverter.raw],
            [101, 'motor_direction', tuya.valueConverterBasic.lookup({ 'left': tuya.enum(0), 'right': tuya.enum(1) })],
            [102, 'set_upper_limit', tuya.valueConverterBasic.lookup({ 'start': tuya.enum(0), 'stop': tuya.enum(1) })],
                                
                                    
             //The datapoints below expose values but I can't detect why, I don't find them useful.
            [104], //when opening or closing and charging or not, expose value: 10
            [105], //when opening or closing and charging or not, expose value: 50 
            [7], //when opening or closing and charging or not, expose value: 2,
            [103], //maybe temperature, expose value: 22, 23, 28, 30, 50.. 
            [106], //when opening or closing and charging or not, expose value: 100,
            [108], //when opening or closing and charging or not, not expose value: "nothing",
        ],
    },
};

module.exports = definition;

Have copied your definition and having same issue you had originally of not supported. Same model from Ali express

@timknowlden
Copy link

Ignore that, working now, had external converters referenced twice in config.

All working and reporting state correctly, physical buttons operate in the wrong direction though

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants