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

[New device support]: Device - model 'TS011F' and manufacturer name '_TZ3000_3zofvcaa' #11483

Closed
Gera1974 opened this issue Feb 18, 2022 · 9 comments
Labels
new device support New device support request stale Stale issues

Comments

@Gera1974
Copy link

Gera1974 commented Feb 18, 2022

Link

https://pt.aliexpress.com/item/1005003822349807.html?gatewayAdapt=glo2bra&spm=a2g0o.order_list.0.0.21efcaa4zLrmXD

Database entry

{"id":22,"type":"Router","ieeeAddr":"0xa4c138255c04d0df","nwkAddr":4238,"manufId":4417,"manufName":"_TZ3000_3zofvcaa","powerSource":"Mains (single phase)","modelId":"TS011F","epList":[1,2,242,3,4],"endpoints":{"1":{"profId":260,"epId":1,"devId":266,"inClusterList":[3,4,5,6,57344,57345,0],"outClusterList":[25,10],"clusters":{"genBasic":{"attributes":{"stackVersion":0,"dateCode":""}},"genOnOff":{"attributes":{"20480":1,"32768":0,"onOff":1,"onTime":0,"offWaitTime":0,"tuyaBacklightMode":1,"moesStartUpOnOff":1}},"manuSpecificTuya_3":{"attributes":{"53264":1,"switchType":0}}},"binds":[],"configuredReportings":[],"meta":{}},"2":{"profId":260,"epId":2,"devId":266,"inClusterList":[4,5,6,57345],"outClusterList":[],"clusters":{"genOnOff":{"attributes":{"onOff":1,"onTime":0,"offWaitTime":0}},"manuSpecificTuya_3":{"attributes":{"53264":1}}},"binds":[],"configuredReportings":[],"meta":{}},"3":{"profId":260,"epId":3,"devId":266,"inClusterList":[4,5,6,57345],"outClusterList":[],"clusters":{"genOnOff":{"attributes":{"onOff":1,"onTime":0,"offWaitTime":0}},"manuSpecificTuya_3":{"attributes":{"53264":1}}},"binds":[],"configuredReportings":[],"meta":{}},"4":{"profId":260,"epId":4,"devId":266,"inClusterList":[4,5,6,57345],"outClusterList":[],"clusters":{"genOnOff":{"attributes":{"onOff":1,"onTime":0,"offWaitTime":0}},"manuSpecificTuya_3":{"attributes":{"53264":1}}},"binds":[],"configuredReportings":[],"meta":{}},"242":{"profId":41440,"epId":242,"devId":97,"inClusterList":[],"outClusterList":[33],"clusters":{},"binds":[],"configuredReportings":[],"meta":{}}},"appVersion":67,"stackVersion":0,"hwVersion":1,"dateCode":"","zclVersion":3,"interviewCompleted":true,"meta":{},"lastSeen":1645221345670,"defaultSendRequestWhen":"immediate"}

Comments

Hello,

I've got a TS011F _TZ3000_3zofvcaa zemismat wall outlet TB242-ZB that is not supported. According the description, it is possible to control the 2 power plugs and the 2 usb plugs but there is no energy measuring feature.

I coded a converter based on the instructions 'how to support new devices' but Iit doesn´t work perfectly. By using the converter Zigbee2mqtt identifies all the 4 channels but if you select a channel and send a turn or a turn off command all the 4 channels are affected. Question: is it possible to fix this ?

Is it also possible to add it officially to zigbee2mqtt ?
Thank you.

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 e = exposes.presets;
const ea = exposes.access;

const definition = {
fingerprint: [
{
modelID: 'TS011F',
manufacturerName: '_TZ3000_3zofvcaa'
}
],
model: 'TS011F_2_gang_2_usb_wall',
vendor: 'TuYa',
description: '2 gang 2 usb wall outlet',
toZigbee: extend.switch().toZigbee.concat([tz.moes_power_on_behavior, tz.tuya_backlight_mode]),
fromZigbee: extend.switch().fromZigbee.concat([fz.moes_power_on_behavior, fz.tuya_backlight_mode]),
exposes: [
e.switch().withEndpoint('l1'),
e.switch().withEndpoint('l2'),
e.switch().withEndpoint('l3'),
e.switch().withEndpoint('l4'),
exposes.enum('power_on_behavior', ea.ALL, ['on', 'off', 'previous']),
exposes.enum('backlight_mode', ea.ALL, ['LOW', 'MEDIUM', 'HIGH']),
],
endpoint: () => {
return {'l1': 1, 'l2': 2, 'l3': 3, 'l4': 4};
},
meta: {multiEndpoint: true},
configure: async (device, coordinatorEndpoint) => {
const firstEndpoint = device.getEndpoint(1);
await reporting.bind(firstEndpoint, coordinatorEndpoint, ['genOnOff']);
await reporting.onOff(firstEndpoint);

    const secondEndpoint = device.getEndpoint(2);
    await reporting.bind(secondEndpoint, coordinatorEndpoint, ['genOnOff']);
    await reporting.onOff(secondEndpoint);

    const thirdEndpoint = device.getEndpoint(3);
    await reporting.bind(thirdEndpoint, coordinatorEndpoint, ['genOnOff']);
    await reporting.onOff(thirdEndpoint);

    const fourthEndpoint = device.getEndpoint(4);
    await reporting.bind(fourthEndpoint, coordinatorEndpoint, ['genOnOff']);
    await reporting.onOff(fourthEndpoint);
}

};

module.exports = definition;

Supported color modes

No response

Color temperature range

No response

@Gera1974 Gera1974 added the new device support New device support request label Feb 18, 2022
@github-actions
Copy link
Contributor

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 7 days

@github-actions github-actions bot added the stale Stale issues label Mar 25, 2022
@Gera1974
Copy link
Author

Any chance to have this device officially supported on next version of Zigbee2mqtt ?

@Gera1974 Gera1974 changed the title [New device support]: Device - model 'TS011F' and manufacturer name '_TZ3000_3zofvcaa' [New device support]: Device - model 'TS011F' and manufacturer name '_TZ3000_3zofvcaa' Mar 25, 2022
@Koenkk
Copy link
Owner

Koenkk commented Mar 26, 2022

Could you check if the controlling of endpoints is fixed by changing the configure() like this?

Change

const firstEndpoint = device.getEndpoint(1);
await reporting.bind(firstEndpoint, coordinatorEndpoint, ['genOnOff']);

to

const firstEndpoint = device.getEndpoint(1);
await firstEndpoint.read('genBasic', ['manufacturerName', 'zclVersion', 'appVersion', 'modelId', 'powerSource', 0xfffe]);
await reporting.bind(firstEndpoint, coordinatorEndpoint, ['genOnOff']);

@Gera1974
Copy link
Author

Gera1974 commented Mar 26, 2022 via email

Koenkk added a commit to Koenkk/zigbee-herdsman-converters that referenced this issue Mar 26, 2022
@Koenkk
Copy link
Owner

Koenkk commented Mar 26, 2022

Added it (so it will be supported in the next z2m release)

One question: In the original application there is an additional switch
that turns on and turns off all the four plugs simultaneously. Is it
possible to also add this feature ? Do you know how to do it ?

For this you would have to sniff the command when doing this via the TuYa bridge (https://www.zigbee2mqtt.io/advanced/zigbee/04_sniff_zigbee_traffic.html#with-cc2531). Alternatively you could put all the endpoints in 1 group and control the group.

@github-actions github-actions bot closed this as completed Apr 3, 2022
@w35l3y
Copy link

w35l3y commented Jun 7, 2022

await firstEndpoint.read('genBasic', ['manufacturerName', 'zclVersion', 'appVersion', 'modelId', 'powerSource', 0xfffe]);

Just for future reference, this is being called as tuya magic spell
https://github.com/zigpy/zha-device-handlers/blob/b6556169bf641e8f2eb882e8ace4a5a1ab4552d5/zhaquirks/tuya/mcu/__init__.py#L585

@rodrigogbs
Copy link

rodrigogbs commented Jun 23, 2023

@Koenkk, there is a missing configuration on this device: childLock

I tried with this external_converter and it works like a charm:

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 ota = require('zigbee-herdsman-converters/lib/ota');
const tuya = require('zigbee-herdsman-converters/lib/tuya');
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 definition = {
    fingerprint: [{modelID: 'TS011F', manufacturerName: '_TZ3000_3zofvcaa'}],
    model: 'TS011F_2_gang_2_usb_wall',
    vendor: 'TuYa',
    description: '2 gang 2 usb wall outlet',
    extend: tuya.extend.switch({power_on_behavior: true, backlightModeLowMediumHigh: true, childLock: true, endpoints: ['l1', 'l2', 'l3', 'l4']}),
    whiteLabel: [{vendor: 'Zemismart', model: 'ZTB242'}],
    endpoint: (device) => {
        return {'l1': 1, 'l2': 2, 'l3': 3, 'l4': 4};
    },
    meta: {multiEndpoint: true},
    configure: tuya.configureMagicPacket,
};

module.exports = definition;

Captura de Tela 2023-06-23 às 12 59 36

Captura de Tela 2023-06-23 às 12 59 22

Can you please add this to the branch?

Thanks!

@Koenkk
Copy link
Owner

Koenkk commented Jun 23, 2023

@rodrigogbs done!

Koenkk added a commit to Koenkk/zigbee-herdsman-converters that referenced this issue Jun 23, 2023
@rodrigogbs
Copy link

You're amazing @Koenkk , thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
new device support New device support request stale Stale issues
Projects
None yet
Development

No branches or pull requests

4 participants