Koenkk / zigbee2mqtt

Zigbee 🐝 to MQTT bridge 🌉, get rid of your proprietary Zigbee bridges 🔨
https://www.zigbee2mqtt.io
GNU General Public License v3.0
12.05k stars 1.67k forks source link

[New device support]: Blitzwolf SHP-13 - (Zigbee model 'TS011F' and manufacturer name '_TZ3000_amdymr7l') #11703

Closed Nenodema closed 2 years ago

Nenodema commented 2 years ago

Link

https://www.blitzwolf.com/ZigBee-3.0-Smart-Socket-EU-p-518.html

Database entry

{"id":15,"type":"Router","ieeeAddr":"0xa4c138bf6ccf49dd","nwkAddr":35956,"manufId":4417,"manufName":"_TZ3000_amdymr7l","powerSource":"Mains (single phase)","modelId":"TS011F","epList":[1,242],"endpoints":{"1":{"profId":260,"epId":1,"devId":266,"inClusterList":[3,4,5,6,1794,2820,57345,57344,0],"outClusterList":[25,10],"clusters":{"genBasic":{"attributes":{"modelId":"TS011F","manufacturerName":"_TZ3000_amdymr7l","powerSource":1,"zclVersion":3,"appVersion":74,"stackVersion":0,"hwVersion":1,"dateCode":""}}},"binds":[],"configuredReportings":[],"meta":{}},"242":{"profId":41440,"epId":242,"devId":97,"inClusterList":[],"outClusterList":[33],"clusters":{},"binds":[],"configuredReportings":[],"meta":{}}},"appVersion":74,"stackVersion":0,"hwVersion":1,"dateCode":"","zclVersion":3,"interviewCompleted":true,"meta":{},"lastSeen":1646401884765,"defaultSendRequestWhen":"immediate"}

Comments

This is my second (original) Blitzwolf SHP-13, the first is working perfectly but the second one is not working. This model will also support Electricity Monitoring.

image

Zigbee2MQTT:warn  2022-03-04 14:51:33: Received message from unsupported device with Zigbee model 'TS011F' and manufacturer name '_TZ3000_amdymr7l'
Zigbee2MQTT:warn  2022-03-04 14:51:33: Please see: https://www.zigbee2mqtt.io/advanced/support-new-devices/01_support_new_devices.html

Could you please also support this device? Thanks!

Device pictures:

image

image

External converter

No response

Supported color modes

No response

Color temperature range

No response

Koenkk commented 2 years ago

Added!

Changes will be available in the dev branch in a few hours from now. (https://www.zigbee2mqtt.io/advanced/more/switch-to-dev-branch.html)

Nenodema commented 2 years ago

Thanks Koen!!

danigd82 commented 2 years ago

I have the same problem, when for the stable version? Thank you very much!!

bboelaert commented 2 years ago

Same question : I modified the js file in the docker version and it works. When will this change be incorporated in the stable and docker version?

JanHACS commented 2 years ago

I have the same problem with home assistant and zigbee2mqtt, it would be very nice to have support for this device.

han9988 commented 2 years ago

Just received these today with the same problem. Took the opportunity and tried to add the device as in https://www.zigbee2mqtt.io/advanced/support-new-devices/01_support_new_devices.html described. After all, it shows up in the list. From there one functionality at a time. Steep learning curve. ;-) When will this be availble in the stable version, asking for a friend.

JanHACS commented 2 years ago

Finally I have installed the edge version of z2mqtt and now it is working properly, just waiting for the stable version solution.

nohn commented 2 years ago

Could any of those having this plug please check, if they are affected by #11800?

  1. Enable Debug Mode in zigbee2mqtt
  2. Connect a constant load to the plug (like some network gear)
  3. After some hours look for {"activePower":0} in the logs.
pantalooon commented 2 years ago

Same problem for me. Received 2 of the plugs a few days ago. Unfortunately I do not know how to switch the TrueNAS Scale app to the dev train.

Same question : I modified the js file in the docker version and it works. When will this change be incorporated in the stable and docker version?

Can you post what's in the js file?

han9988 commented 2 years ago

No need to edit docker container. No need to change to dev train. I did the following: In the zigbee2mqtt folder -> configuration.yaml change the line "external_converters": [], to this: "external_converters": [ "TS011F.js" ],

In the zigbee2mqtt folder add a new file TS011F.js and paste this:

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 tuya = require('zigbee-herdsman-converters/lib/tuya'); 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 = { zigbeeModel: ['TS011F'], // The model ID from: Device with modelID 'lumi.sens' is not supported. model: 'BW-SHP13', // Vendor model number, look on the device for a model number vendor: 'Blitzwolf', // Vendor of the device (only used for documentation and startup logging) description: 'Blitzwolf Power Plug', // Description of the device, copy from vendor site. (only used for documentation and startup logging) fromZigbee: [fz.on_off, fz.electrical_measurement, fz.metering, fz.ignore_basic_report, fz.tuya_switch_power_outage_memory], toZigbee: [tz.on_off, tz.tuya_switch_power_outage_memory], configure: async (device, coordinatorEndpoint, logger) => { const endpoint = device.getEndpoint(1); await reporting.bind(endpoint, coordinatorEndpoint, ['genOnOff', 'haElectricalMeasurement', 'seMetering']); endpoint.saveClusterAttributeKeyValue('seMetering', {divisor: 100, multiplier: 1}); endpoint.saveClusterAttributeKeyValue('haElectricalMeasurement', { acVoltageMultiplier: 1, acVoltageDivisor: 1, acCurrentMultiplier: 1, acCurrentDivisor: 1000, acPowerMultiplier: 1, acPowerDivisor: 1, }); try { await reporting.currentSummDelivered(endpoint); } catch (error) {/ fails for some https://github.com/Koenkk/zigbee2mqtt/issues/11179 /} }, options: [exposes.options.measurement_poll_interval()], // This device doesn't support reporting correctly. // https://github.com/Koenkk/zigbee-herdsman-converters/pull/1270 exposes: [e.switch(), e.power(), e.current(), e.voltage().withAccess(ea.STATE), e.energy(), exposes.enum('power_outage_memory', ea.STATE_SET, ['on', 'off', 'restore']) .withDescription('Recover state after power outage')], onEvent: tuya.onEventMeasurementPoll, };

module.exports = definition;

Restart Zigbee2mqtt Worked for me, you may do this on your own risk.

edwinzelf commented 2 years ago

Hi, I tried the custom external_converter, and it worked like a charm. After the April 1st update of z2m (1.25.0-1), it seems the plug is now recognized as an Tuya "TS011F_plug_1", and the custom external_converter is not needed.

I have a couple of actual Tuya TS011F_plug_1 (_TZ3000_typdpbpg). The issue I have with them is power measurement drops to 0 every cpl of minutes. And the even sometimes go to "off" for no reason.

Back to the newer Blitzwolf SHP-13 (_TZ3000_amdymr7l). Since I updated to 1.25.0-1, I am seeing the same power drop to 0 every cpl of minutes. This did not occur with the custom external_converter.

What am I missing?

CleanShot 2022-04-05 at 09 56 47@2x CleanShot 2022-04-05 at 09 57 50@2x CleanShot 2022-04-05 at 09 58 20@2x
nohn commented 2 years ago

I have a couple of actual Tuya TS011F_plug_1 (_TZ3000_typdpbpg). The issue I have with them is power measurement drops to 0 every cpl of minutes. And the even sometimes go to "off" for no reason.

Back to the newer Blitzwolf SHP-13 (_TZ3000_amdymr7l). Since I updated to 1.25.0-1, I am seeing the same power drop to 0 every cpl of minutes. This did not occur with the custom external_converter.

Looks like the problem described in #11800.

edwinzelf commented 2 years ago

@nohn looks like it, but it's still strange it worked fine with the external_converter before release 1.25.0-1.

tomasz-s commented 2 years ago

I didn't try the custom_converter but I used the z2m edge version. Drops were there too.

KaportsevIA commented 2 years ago

_TZ3000_amdymr7l.txt Снимок экрана 2022-04-23 170153 Снимок экрана 2022-04-23 170215 It was possible to obtain energy monitoring data on the outlet. Of the minuses - there is no choice of the mode of operation of the LED indicator

barmazu commented 2 years ago

Can confirm. Bought one plug (_TZ3000_amdymr7l) 3 days ago to replace TP-Link HS110 (RIP) for washing machine monitoring. It drops to 0 every now and then, doesn't matter if load is constant or not. What's more it has trouble to report low (<5W) loads, simply defaulting to constant 0W. And - last but not least - I think, but not 100% sure, if input voltage exceeds 250V the plug turns off by itself. Garbage.

niolang commented 2 years ago

Facing the same issue here, and a bit reluctant to switch to edge version just for this one plug ^^ I am new to this, so any classic delay on when this should go to stable? Thanks

nohn commented 2 years ago

AFAIK the changes are already included in "latest" (docker) / "master" (source). What you see broken now is really the plug (or it's firmware) that's broken. Use them for monitoring relatively constant loads, for everything else they're crap.

niolang commented 2 years ago

Oh... my version was dating back to 2021, because i had an old (wrong?) repo address... thanks for the heads up!

stathismes commented 2 years ago

Using KaportsevIA's code above, and some code from Koenkk's tyja.js I created a file "BW-SHP13.js" and put in inside "/config/zigbee2mqtt/", which helped me get the appropriate readings for BW-SHP13 ++ plus "Indicator Mode" (which I confirm works!)

I hope this helps you. Many thanks to @KaportsevIA

BW-SHP13.js

Screenshot 2022-10-13 223132

Screenshot 2022-10-13 223354

Upload the file in HA zigbee2mqtt folder: Screenshot 2022-10-13 223555

Main settings (here put the file name): Screenshot 2022-10-13 223503

manny199 commented 2 years ago

Using KaportsevIA's code above, and some code from Koenkk's tyja.js I created a file "BW-SHP13.js" and put in inside "/config/zigbee2mqtt/", which helped me get the appropriate readings for BW-SHP13 ++ plus "Indicator Mode" (which I confirm works!)

Thank you. I inserted new BW-SHP13.js in zigbee2mqtt folder and add it in external converters but power is always 0 for values under 10 watt. I Have zigbee2mqtt 1.28.0 version

Termi01 commented 2 years ago

@stathismes I tried your solution, but I get errors upon loading. This solution only works in the edge version maybe? I am using the regular Z2M addon.

manny199 commented 2 years ago

@Termi01 Confirm, same problem, error on loading z2m. This solution not work for me that I have 1.28 version

stathismes commented 1 year ago

Hmmm that's weird. Maybe some devices are with a different board?

I'm also using Zigbee2MQTT (full version, not edge) Current version: 1.28.2-1

I had to update to 1.28.2 because one of the previous ones were generating problems to me too.

I'm hoping for a better solution to this... I have no idea where to post my "solution" --> which is a "baked" solution.. I don't have any dev skills, I only tried to bake a file using different "drivers" of this device found on Github.

I'm hoping for a more stable and supported official support from Z2M devs..

GSzabados commented 1 year ago

Back to the newer Blitzwolf SHP-13 (_TZ3000_amdymr7l). Since I updated to 1.25.0-1, I am seeing the same power drop to 0 every cpl of minutes. This did not occur with the custom external_converter.

What am I missing?

The external_converter what you referred to does a polling on the device, every X minutes. Meanwhile the code implemented relies on the device reporting on change. For some reason the device reports a 0 current value randomly, and as it is a change it reports it to the coordinator. But when the polling is used, these changes are just not recognized, because most likely the polling is missing these occasions when current and power goes to 0 for a moment.