zigbee2mqtt icon indicating copy to clipboard operation
zigbee2mqtt copied to clipboard

TS011F_plug_1 behaves like a TS011F_plug_3

Open ilmisu opened this issue 3 years ago • 35 comments

What happened?

Hi all, I've got this model of smart plug, that should advertise Voltage, current, power and energy beyond the on-off switch. the problem is that it's not advertising any value, exposing properly only switch and setup variables, as you suggested in the issue related to TS011F_plug_3.

What did you expect to happen?

I'd like to see power consumption values.

How to reproduce it (minimal and precise)

No response

Zigbee2MQTT version

1.29.1

Adapter firmware version

20200327

Adapter

zStack30x

Debug log

No response

ilmisu avatar Jan 12 '23 09:01 ilmisu

Can you provide the data/database.db entry of this device?

Koenkk avatar Jan 12 '23 16:01 Koenkk

Can you help me in how to provide it?

Thanks.

Il Gio 12 Gen 2023, 17:22 Koen Kanters @.***> ha scritto:

Can you provide the data/database.db entry of this device?

— Reply to this email directly, view it on GitHub https://github.com/Koenkk/zigbee2mqtt/issues/16112#issuecomment-1380668437, or unsubscribe https://github.com/notifications/unsubscribe-auth/AMBVO2L5LZJUAUQ4FDYTFETWSAVUJANCNFSM6AAAAAATY76BXI . You are receiving this because you authored the thread.Message ID: @.***>

ilmisu avatar Jan 12 '23 16:01 ilmisu

You will find it next to the zigbee2mqtt configuration.yaml.

Koenkk avatar Jan 12 '23 16:01 Koenkk

Alright in a few minutes I'll send it out.

Il Gio 12 Gen 2023, 17:40 Koen Kanters @.***> ha scritto:

You will find it next to the zigbee2mqtt configuration.yaml.

— Reply to this email directly, view it on GitHub https://github.com/Koenkk/zigbee2mqtt/issues/16112#issuecomment-1380699204, or unsubscribe https://github.com/notifications/unsubscribe-auth/AMBVO2OBLV6QGZPJ4KMMDRLWSAXYZANCNFSM6AAAAAATY76BXI . You are receiving this because you authored the thread.Message ID: @.***>

ilmisu avatar Jan 12 '23 16:01 ilmisu

"id":22,"type":"Router","ieeeAddr":"0x70b3d52b6001bc7d","nwkAddr":12772,"manufId":4660,"manufName":"_TZ3000_okaz9tjs","powerSource":"Mains (single phase)","modelId":"TS011F","epList":[1],"endpoints":{"1":{"profId":260,"epId":1,"devId":81,"inClusterList":[0,6,3,4,5,57345,2820,1794],"outClusterList":[],"clusters":{"genBasic":{"attributes":{"modelId":"TS011F","manufacturerName":"_TZ3000_okaz9tjs","powerSource":1,"zclVersion":2,"appVersion":100,"stackVersion":1,"hwVersion":3,"dateCode":"20210625","swBuildId":"20B+TZSKT11BS108"}},"genOnOff":{"attributes":{"32768":0,"onOff":1,"moesStartUpOnOff":2,"tuyaBacklightMode":1}},"manuSpecificTuya_3":{"attributes":{"powerOnBehavior":2}},"seMetering":{"attributes":{"currentSummDelivered":[0,128]}}},"binds":[{"cluster":2820,"type":"endpoint","deviceIeeeAddress":"0x00124b0006104dc3","endpointID":1}],"configuredReportings":[],"meta":{}}},"appVersion":100,"stackVersion":1,"hwVersion":3,"dateCode":"20210625","swBuildId":"20B+TZSKT11BS108","zclVersion":2,"interviewCompleted":true,"meta":{},"lastSeen":1673546608801,"defaultSendRequestWhen":"immediate"}

here we go.

in the GUI, this is what I see:

image

thanks in advance for your kind support.

ilmisu avatar Jan 12 '23 18:01 ilmisu

Thanks, the issue is already fixed by https://github.com/Koenkk/zigbee-herdsman-converters/pull/5287 which will be included in the 1 February release and is already available in the dev branch. (https://www.zigbee2mqtt.io/advanced/more/switch-to-dev-branch.html)

Koenkk avatar Jan 13 '23 15:01 Koenkk

I'm sorry but my instance is already switched on dev branch, but it is still non working. Could you please tell me how to check if I properly set up the dev branch? And could you link me a guide in how to update the instance once the new version will be released? Thank you.

Il Ven 13 Gen 2023, 16:52 Koen Kanters @.***> ha scritto:

Thanks, the issue is already fixed by Koenkk/zigbee-herdsman-converters#5287 https://github.com/Koenkk/zigbee-herdsman-converters/pull/5287 which will be included in the 1 February release and is already available in the dev branch. ( https://www.zigbee2mqtt.io/advanced/more/switch-to-dev-branch.html)

— Reply to this email directly, view it on GitHub https://github.com/Koenkk/zigbee2mqtt/issues/16112#issuecomment-1382044981, or unsubscribe https://github.com/notifications/unsubscribe-auth/AMBVO2I3PO2DSMYJQZVSQUDWSF24HANCNFSM6AAAAAATY76BXI . You are receiving this because you authored the thread.Message ID: @.***>

ilmisu avatar Jan 13 '23 15:01 ilmisu

@ilmisu how are you running z2m?

Koenkk avatar Jan 14 '23 07:01 Koenkk

I tun it into a raspberry pi 3b running stock OS.

Il Sab 14 Gen 2023, 08:55 Koen Kanters @.***> ha scritto:

@ilmisu https://github.com/ilmisu how are you running z2m?

— Reply to this email directly, view it on GitHub https://github.com/Koenkk/zigbee2mqtt/issues/16112#issuecomment-1382685910, or unsubscribe https://github.com/notifications/unsubscribe-auth/AMBVO2LHQEHX563EYFM5AVDWSJLYXANCNFSM6AAAAAATY76BXI . You are receiving this because you were mentioned.Message ID: @.***>

ilmisu avatar Jan 14 '23 08:01 ilmisu

In that case, once switched to the dev branch, you can follow this guide

Koenkk avatar Jan 14 '23 09:01 Koenkk

Thanks for the hint, but is the one I already followed. I got an error at the "npm ci" instruction... But the rest has been completed.

Il Sab 14 Gen 2023, 10:39 Koen Kanters @.***> ha scritto:

In that case, once switched to the dev branch https://www.zigbee2mqtt.io/advanced/more/switch-to-dev-branch.html, you can follow this guide https://www.zigbee2mqtt.io/guide/installation/01_linux.html#for-later-update-zigbee2mqtt-to-the-latest-version

— Reply to this email directly, view it on GitHub https://github.com/Koenkk/zigbee2mqtt/issues/16112#issuecomment-1382701496, or unsubscribe https://github.com/notifications/unsubscribe-auth/AMBVO2J3EVSNCBSQZJXU5M3WSJX6PANCNFSM6AAAAAATY76BXI . You are receiving this because you were mentioned.Message ID: @.***>

ilmisu avatar Jan 14 '23 09:01 ilmisu

npm ci required, what is the error?

Koenkk avatar Jan 14 '23 09:01 Koenkk

Command not found. Which package must I install then?

Il Sab 14 Gen 2023, 10:49 Koen Kanters @.***> ha scritto:

npm ci required, what is the error?

— Reply to this email directly, view it on GitHub https://github.com/Koenkk/zigbee2mqtt/issues/16112#issuecomment-1382702962, or unsubscribe https://github.com/notifications/unsubscribe-auth/AMBVO2PFFSRIF2FW2BLFUBTWSJZELANCNFSM6AAAAAATY76BXI . You are receiving this because you were mentioned.Message ID: @.***>

ilmisu avatar Jan 14 '23 09:01 ilmisu

NodeJs must be installed, see https://www.zigbee2mqtt.io/guide/installation/01_linux.html#installing

Koenkk avatar Jan 14 '23 10:01 Koenkk

Now it works like a charm. Thanks a lot koen. And keep going, you're awesome! 👌😉

Il Sab 14 Gen 2023, 11:01 Koen Kanters @.***> ha scritto:

NodeJs must be installed, see https://www.zigbee2mqtt.io/guide/installation/01_linux.html#installing

— Reply to this email directly, view it on GitHub https://github.com/Koenkk/zigbee2mqtt/issues/16112#issuecomment-1382704685, or unsubscribe https://github.com/notifications/unsubscribe-auth/AMBVO2KTDWJJJZFFJGBMN3DWSJ2PVANCNFSM6AAAAAATY76BXI . You are receiving this because you were mentioned.Message ID: @.***>

ilmisu avatar Jan 14 '23 13:01 ilmisu

Great!

Koenkk avatar Jan 15 '23 09:01 Koenkk

I've exact same problem with 2 new ZB plug which are recognized as "[TS011F_plug_1]" but no report of W and A (only V) and I'm not able to activate polling mode :(

here is it how they are setup in database.db, can you help?

{"id":3,"type":"Router","ieeeAddr":"0xa4c138bc5e412a00","nwkAddr":15129,"manufId":4417,"manufName":"_TZ3000_gvn91tmx","powerSource":"Mains (single phase)","modelId":"TS011F","epList":[1,242],"endpoints":{"1":{"profId":260,"epId":1,"devId":266,"inClusterList":[3,4,5,6,1794,2820,57344,57345,0],"outClusterList":[25,10],"clusters":{"genBasic":{"attributes":{"65503":"\u0012/�+\u0017","65506":54,"65508":0,"65534":0,"modelId":"TS011F","manufacturerName":"_TZ3000_gvn91tmx","powerSource":1,"zclVersion":3,"appVersion":192,"stackVersion":0,"hwVersion":1,"dateCode":""}},"haElectricalMeasurement":{"attributes":{"acCurrentDivisor":1000,"acCurrentMultiplier":1,"rmsVoltage":218,"rmsCurrent":0,"activePower":0}},"seMetering":{"attributes":{"divisor":100,"multiplier":1,"currentSummDelivered":[0,72]}},"genOnOff":{"attributes":{"32768":0,"onOff":1,"onTime":0,"offWaitTime":0,"tuyaBacklightMode":1,"moesStartUpOnOff":1,"tuyaBacklightSwitch":1}},"manuSpecificTuya_3":{"attributes":{"53248":1,"53249":0,"53250":2643544,"53251":125,"53252":11554,"53253":1361,"powerOnBehavior":1,"switchType":0}}},"binds":[{"cluster":6,"type":"endpoint","deviceIeeeAddress":"0xe0798dfffe3bd3cb","endpointID":1},{"cluster":2820,"type":"endpoint","deviceIeeeAddress":"0xe0798dfffe3bd3cb","endpointID":1},{"cluster":1794,"type":"endpoint","deviceIeeeAddress":"0xe0798dfffe3bd3cb","endpointID":1}],"configuredReportings":[{"cluster":2820,"attrId":1285,"minRepIntval":5,"maxRepIntval":3600,"repChange":5},{"cluster":2820,"attrId":1288,"minRepIntval":5,"maxRepIntval":3600,"repChange":50},{"cluster":2820,"attrId":1291,"minRepIntval":5,"maxRepIntval":3600,"repChange":10},{"cluster":1794,"attrId":0,"minRepIntval":5,"maxRepIntval":3600,"repChange":[1,1]}],"meta":{}},"242":{"profId":41440,"epId":242,"devId":97,"inClusterList":[],"outClusterList":[33],"clusters":{},"binds":[],"configuredReportings":[],"meta":{}}},"appVersion":192,"stackVersion":0,"hwVersion":1,"dateCode":"","zclVersion":3,"interviewCompleted":true,"meta":{"configured":-892627439},"lastSeen":1677612962092,"defaultSendRequestWhen":"immediate"}

papperone avatar Feb 28 '23 20:02 papperone

Could you check if the issue is fixed with the following 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 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: [192, 160, 100, 69, 68, 65, 64, 66].map((applicationVersion) => {
        return {modelID: 'TS011F', applicationVersion, priority: -1};
    }),
    model: 'TS011F_plug_3',
    description: 'Smart plug (with power monitoring by polling)',
    vendor: 'TuYa',
    whiteLabel: [{vendor: 'VIKEFON', model: 'TS011F'}, {vendor: 'BlitzWolf', model: 'BW-SHP15'},
        {vendor: 'Avatto', model: 'MIUCOT10Z'}, {vendor: 'Neo', model: 'NAS-WR01B'}, {vendor: 'Neo', model: 'PLUG-001SPB2'}],
    ota: ota.zigbeeOTA,
    extend: tuya.extend.switch({electricalMeasurements: true, powerOutageMemory: true, indicatorMode: true, childLock: true}),
    configure: async (device, coordinatorEndpoint, logger) => {
        await tuya.configureMagicPacket(device, coordinatorEndpoint, logger);
        const endpoint = device.getEndpoint(1);
        endpoint.saveClusterAttributeKeyValue('haElectricalMeasurement', {acCurrentDivisor: 1000, acCurrentMultiplier: 1});
        endpoint.saveClusterAttributeKeyValue('seMetering', {divisor: 100, multiplier: 1});
        device.save();
    },
    options: [exposes.options.measurement_poll_interval()],
    onEvent: (type, data, device, options) =>
        tuya.onEventMeasurementPoll(type, data, device, options,
            device.applicationVersion !== 66, // polling for voltage, current and power
            [66, 100, 160].includes(device.applicationVersion), // polling for energy
        ),
};

module.exports = definition;

  • save this as file next to configuration.yaml as ext_converter.js
  • add it to configuration.yaml:
external_converters:
  - ext_converter.js
  • start z2m, check if issue is fixed

Koenkk avatar Mar 01 '23 15:03 Koenkk

Could you check if the issue is fixed with the following 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 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: [192, 160, 100, 69, 68, 65, 64, 66].map((applicationVersion) => {
        return {modelID: 'TS011F', applicationVersion, priority: -1};
    }),
    model: 'TS011F_plug_3',
    description: 'Smart plug (with power monitoring by polling)',
    vendor: 'TuYa',
    whiteLabel: [{vendor: 'VIKEFON', model: 'TS011F'}, {vendor: 'BlitzWolf', model: 'BW-SHP15'},
        {vendor: 'Avatto', model: 'MIUCOT10Z'}, {vendor: 'Neo', model: 'NAS-WR01B'}, {vendor: 'Neo', model: 'PLUG-001SPB2'}],
    ota: ota.zigbeeOTA,
    extend: tuya.extend.switch({electricalMeasurements: true, powerOutageMemory: true, indicatorMode: true, childLock: true}),
    configure: async (device, coordinatorEndpoint, logger) => {
        await tuya.configureMagicPacket(device, coordinatorEndpoint, logger);
        const endpoint = device.getEndpoint(1);
        endpoint.saveClusterAttributeKeyValue('haElectricalMeasurement', {acCurrentDivisor: 1000, acCurrentMultiplier: 1});
        endpoint.saveClusterAttributeKeyValue('seMetering', {divisor: 100, multiplier: 1});
        device.save();
    },
    options: [exposes.options.measurement_poll_interval()],
    onEvent: (type, data, device, options) =>
        tuya.onEventMeasurementPoll(type, data, device, options,
            device.applicationVersion !== 66, // polling for voltage, current and power
            [66, 100, 160].includes(device.applicationVersion), // polling for energy
        ),
};

module.exports = definition;
* save this as file next to `configuration.yaml` as `ext_converter.js`

* add it to `configuration.yaml`:
external_converters:
  - ext_converter.js
* start z2m, check if issue is fixed

hi Koen, Sorry for the delay in answering; at the moment I'm still waiting as all of a sudden one of the 2 plugs started to report values for W and A as well, without me taking any actions. I'll try to diagnose what can have happened and eventually try the external converter you provided; I will keep you posted, THANKS!

papperone avatar Mar 04 '23 11:03 papperone

I have a similar problem with _TZ3000_gvn91tmx. It seems to get stuck on values and doesn't update. Seems like TS011F_plug_3 behaviour to me. Can I force polling?

Flashlab2 avatar May 03 '23 09:05 Flashlab2