Skip to content

[External Converter]: Tuya TS0601 _TZE200_rgeapp2c 2 switches + 2 covers Semicom touch panel. External converter problem #32438

Description

@Simchon

Link

https://www.semicom.co.il/sz-4gev2t2n-w

Database entry

{"id":3,"type":"Router","ieeeAddr":"0xa4c138cfb65f95d9","nwkAddr":57685,"manufId":4417,"manufName":"_TZE200_rgeapp2c","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":"-��1i.��1i.��1i","65506":53,"65508":0,"65534":0,"stackVersion":0,"dateCode":"","manufacturerName":"_TZE200_rgeapp2c","zclVersion":3,"appVersion":65,"modelId":"TS0601","powerSource":1,"hwVersion":1}}},"binds":[],"configuredReportings":[],"meta":{}},"242":{"profId":41440,"epId":242,"devId":97,"inClusterList":[],"outClusterList":[33],"clusters":{},"binds":[],"configuredReportings":[],"meta":{}}},"appVersion":65,"stackVersion":0,"hwVersion":1,"dateCode":"","zclVersion":3,"interviewCompleted":true,"interviewState":"SUCCESSFUL","meta":{"configured":"0.0.0"},"lastSeen":1782834139568}

Zigbee2MQTT version

2.12.0-1

External converter

const tuya = require('zigbee-herdsman-converters/lib/tuya');
const exposes = require('zigbee-herdsman-converters/lib/exposes');

const e = exposes.presets;
const ea = exposes.access;

const definition = {
    fingerprint: [
        {
            modelID: 'TS0601',
            manufacturerName: '_TZE200_rgeapp2c',
        },
    ],
    model: 'TS0601_TZE200_rgeapp2c',
    vendor: 'Tuya',
    description: 'Semicom touch panel: 2 lights + 2 shutters)',
    fromZigbee: [tuya.fz.datapoints],
    toZigbee: [tuya.tz.datapoints],
    onEvent: tuya.onEventSetTime,
    configure: tuya.configureMagicPacket,
    //options: [exposes.options.invert_cover()],
    exposes: [
        // Expose Switches to Home Assistant
        e.switch().withEndpoint('s1'),
        e.switch().withEndpoint('s2'),
        // Expose Shutters/Covers to Home Assistant
        e.cover_position().withEndpoint('c1').setAccess('position', ea.STATE_SET),
        e.cover_position().withEndpoint('c2').setAccess('position', ea.STATE_SET),
    ],
    endpoint: (device) => {
        return {'s1': 1, 's2': 1, 'c1': 1, 'c2': 1};
    },
    meta: {
        multiEndpoint: true,
        tuyaDatapoints: [
            // --- LIGHTS / SWITCHES ---
            [101, 'state_s1', tuya.valueConverter.onOff],
            [102, 'state_s2', tuya.valueConverter.onOff],
            
            // --- SHUTTERS / COVERS ---
            // Cover 1 (DP 1 for state/control, DP 2 for position)
            [1, 'state_c1', tuya.valueConverterBasic.lookup({'OPEN': tuya.enum(0), 'STOP': tuya.enum(1), 'CLOSE': tuya.enum(2)})],
            //[1, 'state_c1', tuya.valueConverter.coverState],
            [2, 'position_c1', tuya.valueConverter.coverPosition],
            
            // Cover 2 (DP 4 for state/control, DP 5 for position)
            [4, 'state_c2', tuya.valueConverterBasic.lookup({'OPEN': tuya.enum(0), 'STOP': tuya.enum(1), 'CLOSE': tuya.enum(2)})],
            //[4, 'state_c2', tuya.valueConverter.coverState],
            [5, 'position_c2', tuya.valueConverter.coverPosition],
            
        ],
    },
};

module.exports = definition;

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

Since this device came up as unsupported, I wrote an external converter for it.
This converter works very well at the Z2M device level (both controlling and getting the correct status from the panel).
But at the HASS level, status from the covers is wrong:
button pressed => reported activity (comment):
Down (close) => was closed (correct)
Down again (stop) => was opened (should be "was stopped")
Up (open) => No activity (should be "was opened").

I also tried a simple one-cover converter to try to isolate the problem, and it behaves the same: perfect at the Z2M level, but bad state at the HASS/MQTT device. The one-cover converter I used:

const tuya = require('zigbee-herdsman-converters/lib/tuya');
const exposes = require('zigbee-herdsman-converters/lib/exposes');

const e = exposes.presets;
const ea = exposes.access;

const definition = {
fingerprint: [
{
modelID: 'TS0601',
manufacturerName: '_TZE200_rgeapp2c',
},
],
model: 'TS0601_TZE200_rgeapp2c',
vendor: 'Tuya',
description: 'Semicom 1 cover test for 2 lights + 2 covers panel',
fromZigbee: [tuya.fz.datapoints],
toZigbee: [tuya.tz.datapoints],
onEvent: tuya.onEventSetTime,
configure: tuya.configureMagicPacket,
//options: [exposes.options.invert_cover()],
exposes: [
e.cover_position().setAccess('position', ea.STATE_SET),
],
meta: {
tuyaDatapoints: [
[1, 'state', tuya.valueConverterBasic.lookup({
OPEN: tuya.enum(0),
STOP: tuya.enum(1),
CLOSE: tuya.enum(2),
})],
[2, 'position', tuya.valueConverter.coverPosition],
],
},
};

module.exports = definition;

Notes

I would greatly appreciate your help with this.
Thank you

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions