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

Add support for Blitzwolf BW-SHP13...gets recognised as TuYa TS0121...how to proceed? #3812

Closed
SaturnusDJ opened this issue Jun 26, 2020 · 127 comments

Comments

@SaturnusDJ
Copy link

SaturnusDJ commented Jun 26, 2020

Received the new Blitzwolf BW-SHP13 smart plugs today so I was starting up the procedure for adding the support (https://www.zigbee2mqtt.io/how_tos/how_to_support_new_devices.html).

Upon pairing they got recognised as TuYa TS0121. I did not test them further but from https://www.zigbee2mqtt.io/devices/TS0121.html it already becomes clear it does not support electricity monitoring. Please instruct me how to proceed.

Received Zigbee message from 'ac', type 'attributeReport', cluster 'seMetering', data '{"currentSummDelivered":[0,431]}' from endpoint 1 with groupID 0

@sjorge
Copy link
Contributor

sjorge commented Jun 26, 2020

There is a chance it is actually the rebrand of the TuYa device with some more optioned configured in the firmware...

Perhaps a good start would be to append fz.metering_power to the fromZigbee array for the TS0121 and see if you get anything useful.

@SaturnusDJ
Copy link
Author

Thanks. Got that suggestion too on Tweakers forum. Also added fz.ignore_basic_report. No MQTT output for power yet.

In the metering_power code is mentioned:

* When using this converter also add the following to the configure method of the device:
* await readMeteringPowerConverterAttributes(endpoint);

I have not been able to figure this out. Tried a lot of code that is used for other devices, can't get it to work.

It seems to me that the output as shown in the first post is the cumulative power in decawatt. Needs to go times 10 to make sense for the device I am running on the plug.

@sjorge
Copy link
Contributor

sjorge commented Jun 26, 2020

    {
        zigbeeModel: ['TS0121'],
        model: 'TS0121',
        description: '10A UK or 16A EU smart plug',
        supports: 'on/off',
        vendor: 'TuYa',
        fromZigbee: [fz.on_off, fz.metering_power],
        toZigbee: [tz.on_off],
        meta: {configureKey: 1},
        configure: async (device, coordinatorEndpoint) => {
            const endpoint = device.getEndpoint(1);
            await bind(endpoint, coordinatorEndpoint, ['genOnOff', 'seMetering']);
            await configureReporting.onOff(endpoint);
            await readMeteringPowerConverterAttributes(endpoint);
            await configureReporting.instantaneousDemand(endpoint);
        },
    },

Just taking a stab in the dark here, the endpoint might be wrong. But based on the log entry i think EP1 is the good one.

@SaturnusDJ
Copy link
Author

Thanks, this is the error it gives:

zigbee2mqtt:error 2020-06-26 22:53:19: Failed to configure 'ac', attempt 3 (Error: ConfigureReporting 0x..../1 genOnOff([{"attribute":"onOff","minimumReportInterval":0,"maximumReportInterval":3600,"reportableChange":0}], {"timeout":10000,"disableResponse":false,"disableDefaultResponse":true,"direction":0,"srcEndpoint":null,"reservedBits":0,"manufacturerCode":null,"transactionSequenceNumber":null}) failed (Error: Timeout - 7015 - 1 - 6 - 6 - 7 after 10000ms)
    at Endpoint.<anonymous> (/app/node_modules/zigbee-herdsman/dist/controller/model/endpoint.js:341:23)
    at Generator.throw (<anonymous>)
    at rejected (/app/node_modules/zigbee-herdsman/dist/controller/model/endpoint.js:6:65))

@sjorge
Copy link
Contributor

sjorge commented Jun 26, 2020

    {
        zigbeeModel: ['TS0121'],
        model: 'TS0121',
        description: '10A UK or 16A EU smart plug',
        supports: 'on/off',
        vendor: 'TuYa',
        fromZigbee: [fz.on_off, fz.metering_power],
        toZigbee: [tz.on_off],
        meta: {configureKey: 1},
        configure: async (device, coordinatorEndpoint) => {
            const endpoint = device.getEndpoint(1);
            await bind(endpoint, coordinatorEndpoint, ['genOnOff', 'seMetering']);
            await readMeteringPowerConverterAttributes(endpoint);
            await configureReporting.instantaneousDemand(endpoint);
        },
    },

Lets try without reporting for genOnoff.

@SaturnusDJ
Copy link
Author

Thanks. Next error is:

Failed to configure 'ac', attempt 2 (Error: Read 0x..../1 seMetering(["multiplier","divisor"], {"timeout":10000,"disableResponse":false,"disableDefaultResponse":true,"direction":0,"srcEndpoint":null,"reservedBits":0,"manufacturerCode":null,"transactionSequenceNumber":null}) failed (Error: Status 'UNSUPPORTED_ATTRIBUTE')
    at Endpoint.<anonymous> (/app/node_modules/zigbee-herdsman/dist/controller/model/endpoint.js:192:23)
    at Generator.next (<anonymous>)
    at fulfilled (/app/node_modules/zigbee-herdsman/dist/controller/model/endpoint.js:5:58))

@sjorge
Copy link
Contributor

sjorge commented Jun 26, 2020

Interesting, so it doens't support reporting at all probably.

    {
        zigbeeModel: ['TS0121'],
        model: 'TS0121',
        description: '10A UK or 16A EU smart plug',
        supports: 'on/off',
        vendor: 'TuYa',
        fromZigbee: [fz.on_off, fz.metering_power],
        toZigbee: [tz.on_off],
        meta: {configureKey: 1},
        configure: async (device, coordinatorEndpoint) => {
            const endpoint = device.getEndpoint(1);
            await bind(endpoint, coordinatorEndpoint, ['genOnOff', 'seMetering']);
            await readMeteringPowerConverterAttributes(endpoint);
        },
    },

Lets try the absolute minimal then.

@SaturnusDJ
Copy link
Author

The same error comes up.

@sjorge
Copy link
Contributor

sjorge commented Jun 26, 2020

I'm guessing it's not liking the readMeteringPowerConverterAttributes also :(
No idea how to proceed from here. Hopefully Koen will once he's online

@SaturnusDJ
Copy link
Author

Thanks for the time. 👌

@Koenkk
Copy link
Owner

Koenkk commented Jun 27, 2020

When did you receive Received Zigbee message from 'ac', type 'attributeReport', cluster 'seMetering', data '{"currentSummDelivered":[0,431]}' from endpoint 1 with groupID 0 ? When adding fz.metering_power this should already work.

@SaturnusDJ
Copy link
Author

SaturnusDJ commented Jun 27, 2020

That must have been after adding fz.metering_power. So that it looks like:


    {
        zigbeeModel: ['TS0121'],
        model: 'TS0121',
        description: '10A UK or 16A EU smart plug',
        supports: 'on/off',
        vendor: 'TuYa',
        fromZigbee: [fz.on_off, fz.metering_power],
        toZigbee: [tz.on_off],
    },

@Koenkk
Copy link
Owner

Koenkk commented Jun 28, 2020

But you don't get any power messages now?

@SaturnusDJ
Copy link
Author

Reading with MQTT Explorer: Power field stays at "null".

@Koenkk
Copy link
Owner

Koenkk commented Jun 28, 2020

Can you try with:

    {
        zigbeeModel: ['TS0121'],
        model: 'TS0121',
        description: '10A UK or 16A EU smart plug',
        supports: 'on/off',
        vendor: 'TuYa',
        fromZigbee: [fz.on_off, fz.metering_power],
        toZigbee: [tz.on_off],
        meta: {configureKey: 2},
        configure: async (device, coordinatorEndpoint) => {
            const endpoint = device.getEndpoint(1);
            await bind(endpoint, coordinatorEndpoint, ['genOnOff', 'seMetering']);
        },
    },

attach a load to the plug, stop zigbee2mqtt and share your debug log and data/dabase.db?

To enable debug logging set in configuration.yaml:

advanced:
  log_level: debug

@SaturnusDJ
Copy link
Author

SaturnusDJ commented Jun 28, 2020

Ok thanks.

One of the Blitzwolf BW-SHP13 is called ac, the other has no friendly name yet.

Filtered log:

info  2020-06-28 18:25:40: Logging to console and directory: '/app/data/log/2020-06-28.18-25-40' filename: log.txt
debug 2020-06-28 18:25:40: Removing old log directory '/app/data/log/2020-06-26.18-38-47'
debug 2020-06-28 18:25:41: Loaded state from file /app/data/state.json
info  2020-06-28 18:25:41: Starting zigbee2mqtt version 1.14.0 (commit #9009de2)
info  2020-06-28 18:25:41: Starting zigbee-herdsman...
debug 2020-06-28 18:25:41: Using zigbee-herdsman with settings: '{"network":{"panID":6754,"extendedPanID":[221,221,221,221,221,221,221,221],"channelList":[11],"networkKey":"HIDDEN"},"databasePath":"/app/data/database.db","databaseBackupPath":"/app/data/database.db.backup","backupPath":"/app/data/coordinator_backup.json","serialPort":{"baudRate":115200,"rtscts":true,"path":"/dev/ttyACM0"},"adapter":{"concurrent":null}}'
info  2020-06-28 18:25:42: zigbee-herdsman started
info  2020-06-28 18:25:42: Coordinator firmware version: '{"type":"zStack12","meta":{"transportrev":2,"product":0,"majorrel":2,"minorrel":6,"maintrel":3,"revision":20190608}}'
debug 2020-06-28 18:25:42: Zigbee network parameters: {"panID":6754,"extendedPanID":"0xdddddddddddddddd","channel":11}
info  2020-06-28 18:25:42: Currently 14 devices are joined:
info  2020-06-28 18:25:43: ac (0x....1): TS0121 - TuYa 10A UK or 16A EU smart plug (Router)
info  2020-06-28 18:25:43: 0x....2 (0x....2): TS0121 - TuYa 10A UK or 16A EU smart plug (Router)
info  2020-06-28 18:25:43: Configuring 'ac'
info  2020-06-28 18:25:43: Successfully configured 'ac'
info  2020-06-28 18:25:43: Configuring '0x....2'
info  2020-06-28 18:25:43: Connected to MQTT server
info  2020-06-28 18:25:43: MQTT publish: topic 'zigbee2mqtt/ac', payload '{"state":"ON","linkquality":0,"power":null}'
info  2020-06-28 18:25:43: MQTT publish: topic 'zigbee2mqtt/0x....2', payload '{"state":"ON","linkquality":2}'
info  2020-06-28 18:25:43: MQTT publish: topic 'zigbee2mqtt/bridge/config', payload '{"version":"1.14.0","commit":"9009de2","coordinator":{"type":"zStack12","meta":{"transportrev":2,"product":0,"majorrel":2,"minorrel":6,"maintrel":3,"revision":20190608}},"log_level":"debug","permit_join":false}'
info  2020-06-28 18:25:44: Successfully configured '0x....2'
debug 2020-06-28 18:26:11: Received MQTT message on 'zigbee2mqtt/ac/set' with data 'OFF'
debug 2020-06-28 18:26:11: Publishing 'set' 'state' to 'ac'
info  2020-06-28 18:26:11: MQTT publish: topic 'zigbee2mqtt/ac', payload '{"state":"OFF","linkquality":0,"power":null}'
debug 2020-06-28 18:26:11: Received Zigbee message from 'ac', type 'attributeReport', cluster 'genOnOff', data '{"onOff":0}' from endpoint 1 with groupID 0
info  2020-06-28 18:26:11: MQTT publish: topic 'zigbee2mqtt/ac', payload '{"state":"OFF","linkquality":0,"power":null}'
debug 2020-06-28 18:26:14: Received MQTT message on 'zigbee2mqtt/ac/set' with data 'ON'
debug 2020-06-28 18:26:14: Publishing 'set' 'state' to 'ac'
info  2020-06-28 18:26:14: MQTT publish: topic 'zigbee2mqtt/ac', payload '{"state":"ON","linkquality":0,"power":null}'
debug 2020-06-28 18:26:14: Received Zigbee message from 'ac', type 'attributeReport', cluster 'genOnOff', data '{"onOff":1}' from endpoint 1 with groupID 0
info  2020-06-28 18:26:14: MQTT publish: topic 'zigbee2mqtt/ac', payload '{"state":"ON","linkquality":0,"power":null}'
debug 2020-06-28 18:27:16: Received Zigbee message from 'ac', type 'attributeReport', cluster 'genBasic', data '{"65506":30,"appVersion":64}' from endpoint 1 with groupID 0
debug 2020-06-28 18:27:16: No converter available for 'TS0121' with cluster 'genBasic' and type 'attributeReport' and data '{"65506":30,"appVersion":64}'
debug 2020-06-28 18:27:36: Received Zigbee message from '0x....2', type 'attributeReport', cluster 'seMetering', data '{"currentSummDelivered":[0,100]}' from endpoint 1 with groupID 0
debug 2020-06-28 18:28:00: Received Zigbee message from '0x....2', type 'attributeReport', cluster 'genBasic', data '{"65506":30,"appVersion":64}' from endpoint 1 with groupID 0
debug 2020-06-28 18:28:00: No converter available for 'TS0121' with cluster 'genBasic' and type 'attributeReport' and data '{"65506":30,"appVersion":64}'
debug 2020-06-28 18:28:54: Received MQTT message on 'zigbee2mqtt/ac/set' with data 'OFF'
debug 2020-06-28 18:28:54: Publishing 'set' 'state' to 'ac'
debug 2020-06-28 18:28:55: Received Zigbee message from 'ac', type 'attributeReport', cluster 'genOnOff', data '{"onOff":0}' from endpoint 1 with groupID 0
info  2020-06-28 18:28:55: MQTT publish: topic 'zigbee2mqtt/ac', payload '{"state":"OFF","linkquality":0,"power":null}'
info  2020-06-28 18:28:55: MQTT publish: topic 'zigbee2mqtt/ac', payload '{"state":"OFF","linkquality":0,"power":null}'
debug 2020-06-28 18:30:03: Received Zigbee message from 'ac', type 'attributeReport', cluster 'seMetering', data '{"currentSummDelivered":[0,1218]}' from endpoint 1 with groupID 0
debug 2020-06-28 18:30:29: Received Zigbee message from 'ac', type 'attributeReport', cluster 'genBasic', data '{"65506":30,"appVersion":64}' from endpoint 1 with groupID 0
debug 2020-06-28 18:30:29: No converter available for 'TS0121' with cluster 'genBasic' and type 'attributeReport' and data '{"65506":30,"appVersion":64}'
debug 2020-06-28 18:30:41: Saving state to file /app/data/state.json
debug 2020-06-28 18:30:51: Saving state to file /app/data/state.json
info  2020-06-28 18:30:51: MQTT publish: topic 'zigbee2mqtt/bridge/state', payload 'offline'
info  2020-06-28 18:30:51: Disconnecting from MQTT server
info  2020-06-28 18:30:51: zigbee-herdsman stopped

The two db entries of the two plugs:

{"id":14,"type":"Router","ieeeAddr":"0x....1","nwkAddr":7015,"manufId":4098,"manufName":"_TZ3000_3ooaz3ng","powerSource":"Mains (single phase)","modelId":"TS0121","epList":[1],"endpoints":{"1":{"profId":260,"epId":1,"devId":81,"inClusterList":[0,4,5,6,1794,2820],"outClusterList":[25,10],"clusters":{"genBasic":{"attributes":{"65503":"\u0000\u0000\u0000\u0000\u0005","65506":30,"modelId":"TS0121","manufacturerName":"_TZ3000_3ooaz3ng","powerSource":1,"zclVersion":3,"appVersion":64,"stackVersion":0,"hwVersion":1,"dateCode":""}},"genOnOff":{"attributes":{"32769":1,"32770":2,"32771":1,"onOff":0,"onTime":0,"offWaitTime":0}},"seMetering":{"attributes":{"currentSummDelivered":[0,1218]}}},"binds":[{"cluster":6,"type":"endpoint","deviceIeeeAddress":"0x....","endpointID":1},{"cluster":1794,"type":"endpoint","deviceIeeeAddress":"0x....","endpointID":1}]}},"appVersion":64,"stackVersion":0,"hwVersion":1,"dateCode":"","zclVersion":3,"interviewCompleted":true,"meta":{"configured":2},"lastSeen":1593361829500}
{"id":15,"type":"Router","ieeeAddr":"0x....2","nwkAddr":59768,"manufId":4098,"manufName":"_TZ3000_3ooaz3ng","powerSource":"Mains (single phase)","modelId":"TS0121","epList":[1],"endpoints":{"1":{"profId":260,"epId":1,"devId":81,"inClusterList":[0,4,5,6,1794,2820],"outClusterList":[25,10],"clusters":{"genBasic":{"attributes":{"65503":"\u0000\u0000\u0000\u0000\u0005\u0000\u0000\u0000\u0000\u0005","65506":30,"modelId":"TS0121","manufacturerName":"_TZ3000_3ooaz3ng","powerSource":1,"zclVersion":3,"appVersion":64,"stackVersion":0,"hwVersion":1,"dateCode":""}},"seMetering":{"attributes":{"currentSummDelivered":[0,100]}},"genOnOff":{"attributes":{"32769":1,"32770":2,"onOff":1,"onTime":0,"offWaitTime":0}}},"binds":[{"cluster":6,"type":"endpoint","deviceIeeeAddress":"0x....","endpointID":1},{"cluster":1794,"type":"endpoint","deviceIeeeAddress":"0x....","endpointID":1}]}},"appVersion":64,"stackVersion":0,"hwVersion":1,"dateCode":"","zclVersion":3,"interviewCompleted":true,"meta":{"configured":2},"lastSeen":1593361680987}

I see that the plug without friendly name has no 'power' field in MQTT. For the ac one I made an entry in HA (manually) to be able to read the power field. Maybe that caused the field to appear in MQTT Explorer while Zigbee2MQTT itself does not even publish anything to it yet and neither announces the field. Not sure, no MQTT expert.

@Koenkk
Copy link
Owner

Koenkk commented Jun 29, 2020

Can you try with:

{
    zigbeeModel: ['TS0121'],
    model: 'TS0121',
    description: '10A UK or 16A EU smart plug',
    supports: 'on/off',
    vendor: 'TuYa',
    fromZigbee: [fz.on_off, fz.metering_power],
    toZigbee: [tz.on_off],
    meta: {configureKey: 3},
    configure: async (device, coordinatorEndpoint) => {
        const endpoint = device.getEndpoint(1);
        await bind(endpoint, coordinatorEndpoint, ['genOnOff', 'seMetering']);
        await configureReporting.instantaneousDemand(endpoint);
    },
},

attach a load and provide the complete log again? (from the point where you attached the load).

@SaturnusDJ
Copy link
Author

Thanks.

Here it is:

zigbee2mqtt:debug 2020-06-29 16:23:19: Received Zigbee message from 'ac', type 'attributeReport', cluster 'seMetering', data '{"currentSummDelivered":[0,1224]}' from endpoint 1 with groupID 0
zigbee2mqtt:error 2020-06-29 16:23:28: Failed to configure 'ac', attempt 3 (Error: ConfigureReporting 0x..../1 seMetering([{"attribute":"instantaneousDemand","minimumReportInterval":0,"maximumReportInterval":3600,"reportableChange":1}], {"timeout":10000,"disableResponse":false,"disableDefaultResponse":true,"direction":0,"srcEndpoint":null,"reservedBits":0,"manufacturerCode":null,"transactionSequenceNumber":null}) failed (Error: Timeout - 7015 - 1 - 8 - 1794 - 7 after 10000ms)
    at Endpoint.<anonymous> (/app/node_modules/zigbee-herdsman/dist/controller/model/endpoint.js:341:23)
    at Generator.throw (<anonymous>)
    at rejected (/app/node_modules/zigbee-herdsman/dist/controller/model/endpoint.js:6:65))

@Koenkk
Copy link
Owner

Koenkk commented Jun 29, 2020

Can you try with:

{
    zigbeeModel: ['TS0121'],
    model: 'TS0121',
    description: '10A UK or 16A EU smart plug',
    supports: 'on/off',
    vendor: 'TuYa',
    fromZigbee: [fz.on_off, fz.metering_power],
    toZigbee: [tz.on_off],
    meta: {configureKey: 4},
    configure: async (device, coordinatorEndpoint) => {
        const endpoint = device.getEndpoint(1);
        await bind(endpoint, coordinatorEndpoint, ['genOnOff', 'seMetering']);
        endpoint.saveClusterAttributeKeyValue('seMetering', {
            divisor: 100,
            multiplier: 1,
        });
    },
},

with this I expect the energy attribute to change to a meaningful value after some time. This will indicate the total deliver energy in kWh.

@SaturnusDJ
Copy link
Author

SaturnusDJ commented Jun 29, 2020

Yes thanks that is working as you describe. 👌

As I have no experience with other electricity monitoring plugs...what else can it do? Or what can Z2M do with it?
At time of buying I expected that the plug would publish the current watt usage every x seconds but so far the only thing that shows up is a message for each decawatt increase.

@Koenkk
Copy link
Owner

Koenkk commented Jun 29, 2020

At time of buying I expected that the plug would publish the current watt usage every x seconds

We need to check if the plug supports this. When running with the code below, does the device configure successfully?

{
    zigbeeModel: ['TS0121'],
    model: 'TS0121',
    description: '10A UK or 16A EU smart plug',
    supports: 'on/off',
    vendor: 'TuYa',
    fromZigbee: [fz.on_off, fz.metering_power],
    toZigbee: [tz.on_off],
    meta: {configureKey: 4},
    configure: async (device, coordinatorEndpoint) => {
        const endpoint = device.getEndpoint(1);
        await bind(endpoint, coordinatorEndpoint, ['genOnOff', 'seMetering']);
        endpoint.saveClusterAttributeKeyValue('seMetering', {
            divisor: 100,
            multiplier: 1,
        });
       await endpoint.read('seMetering', ['instantaneousDemand']);
    },
},

@piotrekoo
Copy link

Hi,

Actually I got three of them today. Bought hoping they'll work like Innr SP 120, but supporting higher wattage.

The device doesn't configure using this code

Failed to configure '0x...', attempt 1 (Error: Read 0x.../1 seMetering(["instantaneousDemand"], {"timeout":10000,"disableResponse":false,"disableDefaultResponse":true,"direction":0,"srcEndpoint":null,"reservedBits":0,"manufacturerCode":null,"transactionSequenceNumber":null}) failed (Error: Status 'UNSUPPORTED_ATTRIBUTE')

@SaturnusDJ
Copy link
Author

Here the added line of code from #3812 (comment) seems to do nothing. No error and no new features. Or is remove and pair again needed?

@piotrekoo
Copy link

@SaturnusDJ I suppose configuration takes place when pairing. I got the error when repairing the plug.

@piotrekoo
Copy link

deCONZ is somehow able to read the haElectricalMeasurement cluster of this device: dresden-elektronik/deconz-rest-plugin#2988

I'll try some tinkering on my own, but if you have any suggestions or snippets to test, I'll be happy to test them.

@Koenkk
Copy link
Owner

Koenkk commented Jun 29, 2020

It is also possible to force the configure via https://www.zigbee2mqtt.io/information/mqtt_topics_and_message_structure.html#zigbee2mqttbridgeconfigure and watch the logging at this moment.

deCONZ is somehow able to read the haElectricalMeasurement

Try with:

{
    zigbeeModel: ['TS0121'],
    model: 'TS0121',
    description: '10A UK or 16A EU smart plug',
    supports: 'on/off',
    vendor: 'TuYa',
    fromZigbee: [fz.on_off, fz.metering_power, fz.electrical_measurement_power],
    toZigbee: [tz.on_off],
    meta: {configureKey: 4},
    configure: async (device, coordinatorEndpoint) => {
        const endpoint = device.getEndpoint(1);
        await bind(endpoint, coordinatorEndpoint, ['genOnOff', 'seMetering', 'haElectricalMeasurement']);
        // Return UNSUPPORTED_ATTRIBUTE upon reading divisor/multiplier
        endpoint.saveClusterAttributeKeyValue('seMetering', {
            divisor: 100,
            multiplier: 1,
        });

        await readEletricalMeasurementPowerConverterAttributes(endpoint);
        await configureReporting.activePower(endpoint);
    },
},

@SaturnusDJ
Copy link
Author

Gives:

Configuring 'ac'
zigbee2mqtt:debug 2020-06-29 19:49:57: Received Zigbee message from 'ac', type 'readResponse', cluster 'haElectricalMeasurement', data '{}' from endpoint 1 with groupID 0
zigbee2mqtt:error 2020-06-29 19:49:57: Failed to configure 'ac', attempt 1 (Error: Read 0x..../1 haElectricalMeasurement(["acVoltageMultiplier","acVoltageDivisor","acCurrentMultiplier"], {"timeout":10000,"disableResponse":false,"disableDefaultResponse":true,"direction":0,"srcEndpoint":null,"reservedBits":0,"manufacturerCode":null,"transactionSequenceNumber":null}) failed (Error: Status 'UNSUPPORTED_ATTRIBUTE')
    at Endpoint.<anonymous> (/app/node_modules/zigbee-herdsman/dist/controller/model/endpoint.js:192:23)
    at Generator.next (<anonymous>)
    at fulfilled (/app/node_modules/zigbee-herdsman/dist/controller/model/endpoint.js:5:58))

@Koenkk
Copy link
Owner

Koenkk commented Jun 29, 2020

And:

{
    zigbeeModel: ['TS0121'],
    model: 'TS0121',
    description: '10A UK or 16A EU smart plug',
    supports: 'on/off',
    vendor: 'TuYa',
    fromZigbee: [fz.on_off, fz.metering_power, fz.electrical_measurement_power],
    toZigbee: [tz.on_off],
    meta: {configureKey: 4},
    configure: async (device, coordinatorEndpoint) => {
        const endpoint = device.getEndpoint(1);
        await bind(endpoint, coordinatorEndpoint, ['genOnOff', 'seMetering', 'haElectricalMeasurement']);
        // Return UNSUPPORTED_ATTRIBUTE upon reading divisor/multiplier
        endpoint.saveClusterAttributeKeyValue('seMetering', {
            divisor: 100,
            multiplier: 1,
        });

        await configureReporting.activePower(endpoint);
    },
},

@SaturnusDJ
Copy link
Author

Gives:

zigbee2mqtt:info  2020-06-29 19:55:38: Configuring 'ac'
zigbee2mqtt:error 2020-06-29 19:56:02: Failed to configure 'ac', attempt 1 (Error: ConfigureReporting 0x..../1 haElectricalMeasurement([{"attribute":"activePower","minimumReportInterval":5,"maximumReportInterval":300,"reportableChange":1}], {"timeout":10000,"disableResponse":false,"disableDefaultResponse":true,"direction":0,"srcEndpoint":null,"reservedBits":0,"manufacturerCode":null,"transactionSequenceNumber":null}) failed (Error: Timeout - 7015 - 1 - 3 - 2820 - 7 after 10000ms)
    at Endpoint.<anonymous> (/app/node_modules/zigbee-herdsman/dist/controller/model/endpoint.js:341:23)
    at Generator.throw (<anonymous>)
    at rejected (/app/node_modules/zigbee-herdsman/dist/controller/model/endpoint.js:6:65))

@Koenkk
Copy link
Owner

Koenkk commented Jun 29, 2020

do you get any power values when now attaching a load to the plug?

@piotrekoo do you get the same error?

@matteopiccioni
Copy link

The device should be supported in dev and in master branch. I can confirm both working (but cannot help you otherwise with your problem)
Maybe check another device or forget it and pair again?

I have just update from my previous dev branch to the master 1.15.0 version...and my three BW-SHP13 disappear from my Devices.....should I switch to dev branch?

@AngryMandragora
Copy link

I also had connection issues, switching to the dev branch solved my issues.

@matteopiccioni
Copy link

1.15.0-dev? a few days ago I tried with no luck
I'm now at 1.14.4

@Lipown
Copy link

Lipown commented Oct 22, 2020

I am not a programmer and I do not understand your conversation above exactly. So it is possible to get the kWh or Wh etc meassurement attribute from the socket or not? I am using zigbee2mqtt in Home assistant.

@maumi
Copy link

maumi commented Oct 22, 2020

I am not a programmer and I do not understand your conversation above exactly. So it is possible to get the kWh or Wh etc meassurement attribute from the socket or not? I am using zigbee2mqtt in Home assistant.

In short.
Yes :-)

@Lipown
Copy link

Lipown commented Oct 22, 2020

I am not a programmer and I do not understand your conversation above exactly. So it is possible to get the kWh or Wh etc meassurement attribute from the socket or not? I am using zigbee2mqtt in Home assistant.

In short.
Yes :-)

Short question: How :)

@bramvdpol
Copy link

I can confirm power measurement is working for me after updating to zigbee2mqtt 1.16.0! Thanks guys.

@userMak
Copy link

userMak commented Nov 3, 2020

will this work with HA and Deconz Conbee ii? I am interesting to buy 2-3 plugs

@maumi
Copy link

maumi commented Nov 3, 2020

Hey guys,

Is the poll_interval still only at dev branch or also on master?

@Koenkk
Copy link
Owner

Koenkk commented Nov 3, 2020

Also master

@allmoney
Copy link

allmoney commented Nov 4, 2020

I have problem... Why BW-SHP13 as Unsupported?
2020-11-04_17-18-30

@Lipown
Copy link

Lipown commented Nov 6, 2020

Thank you for new support of power metering. Any idea how to reset the meter to zero please?

@Pete118
Copy link

Pete118 commented Nov 9, 2020

Where do I set measurement_poll_interval ?

@maumi
Copy link

maumi commented Nov 9, 2020

@Pete118
Copy link

Pete118 commented Nov 9, 2020

Where do I set measurement_poll_interval ?

https://github.com/Koenkk/zigbee2mqtt.io/blob/develop/docs/devices/TS0121_plug.md#device-type-specific-configuration

Sorry, I am new in Zigbee2mqtt.
I have to write a "line measurement_poll_interval: 60" in the configuration.yaml

@maumi
Copy link

maumi commented Nov 9, 2020

Where do I set measurement_poll_interval ?

https://github.com/Koenkk/zigbee2mqtt.io/blob/develop/docs/devices/TS0121_plug.md#device-type-specific-configuration

Sorry, I am new in Zigbee2mqtt.
I have to write a "line measurement_poll_interval: 60" in the configuration.yaml
Yep.
Device (0x...)
Friendly_name:...
measurement...:60

So you need to set it for every device where needed.

@jthomaschewski
Copy link

I have problem... Why BW-SHP13 as Unsupported?
2020-11-04_17-18-30

I experienced the same issue after plugging in the SHP13 the first time. It was detected by zigbee2mqtt but was listed as unsupported.

Fix: Long press the button of the SHP13 while having pairing activated. Now it should show up correctly.

@allmoney
Copy link

Fix: Long press the button of the SHP13 while having pairing activated. Now it should show up correctly.

Please can you explain step by step? I need to delete and add again? When I need long press? When the device was added as unsupported or when?

@allmoney
Copy link

From logs:
NFO: MQTT publish: topic 'zigbee2mqtt/bridge/log', payload '{"message":"interview_started","meta":{"friendly_name":"0x842e14fffe12697a"},"type":"pairing"}'
ERROR: Failed to interview '0x842e14fffe12697a', device has not successfully been paired

Why it "Failed to interview"? Please, help!

@jthomaschewski
Copy link

Fix: Long press the button of the SHP13 while having pairing activated. Now it should show up correctly.

Please can you explain step by step? I need to delete and add again? When I need long press? When the device was added as unsupported or when?

Steps I've done successfully:

  • Enable z2m pairing
  • plug-in shp13

Device shows up as unsupported

  • long-press button on shp13

Device shows up as TyuYa TS0121_plug, unsupported device disappears from list

  • Disable z2m pairing

@allmoney
Copy link

allmoney commented Dec 1, 2020

I changed the channel from 11 to 25 in Zigbee2mqtt addon configuration and all is working OK now!

@boesing
Copy link

boesing commented Dec 1, 2020

would polling every second have significant downsides?

  • higher power consumption of the device?
  • too much overall zigbee traffic (e.g. when having 4+ devices)?

@maumi
Copy link

maumi commented Dec 2, 2020

would polling every second have significant downsides?

  • higher power consumption of the device?
  • too much overall zigbee traffic (e.g. when having 4+ devices)?

Power consumption should be nearly the same.
Traffic could be a problem.
But: why would you poll so often?

@boesing
Copy link

boesing commented Dec 2, 2020

would polling every second have significant downsides?

  • higher power consumption of the device?
  • too much overall zigbee traffic (e.g. when having 4+ devices)?

Traffic could be a problem.
But: why would you poll so often?

because polling every 10 seconds might lead to inaccurate measurements imho.
I'd like to know the exact starting time and exact ending so I can calculate nearly in realtime the real consumption of a device.
sure, to tell if a washing machine finished washing, 10 seconds is more than enough. but when it comes to calculations regarding consumption, its not accurate enough imho.

@daxy01
Copy link
Contributor

daxy01 commented Dec 2, 2020

would polling every second have significant downsides?

  • higher power consumption of the device?
  • too much overall zigbee traffic (e.g. when having 4+ devices)?

Traffic could be a problem.
But: why would you poll so often?

because polling every 10 seconds might lead to inaccurate measurements imho.
I'd like to know the exact starting time and exact ending so I can calculate nearly in realtime the real consumption of a device.
sure, to tell if a washing machine finished washing, 10 seconds is more than enough. but when it comes to calculations regarding consumption, its not accurate enough imho.

As you can see in the initial comments around the time support has been added, these plugs are not really reliable for accurate power measuring. You will see suggestion to allow for some sort of calibration as the measurements where off quite a bit for these plugs. So, given this information I would bother too much on 1 vs. 10 sec difference and its inaccuracy.

These are not high-grade calibrated plugs and information coming from these should be considered as "nice to know" rather than "guaranteed facts" imho.

@RubenKelevra
Copy link
Contributor

Hey guys, sorry for the hijack: Does these plugs support grid frequency measurement by any chance? :)

@mcflexus
Copy link

mcflexus commented Feb 8, 2021

Hey guys, sorry for the hijack: Does these plugs support grid frequency measurement by any chance? :)

No it doesn't.

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