Koenkk / zigbee-herdsman

A Node.js Zigbee library
MIT License
456 stars 277 forks source link

Schneider PowerTag support #518

Closed filips closed 2 years ago

filips commented 2 years ago

This commit introduces minimal Schneider PowerTag support (https://github.com/Koenkk/zigbee2mqtt/issues/7975).

Known limitations:

Koenkk commented 2 years ago

I will check if this doesn't break anything with existing green power device like enocean/hue tap, could you fix the test coverage in the mean time? You can run it locally by executing npm run test-with-coverage, results can be found in coverage/lcov-report/index.html

filips commented 2 years ago

Sure, sounds good. I'll get the test coverage fixed.

filips commented 2 years ago

Test coverage fixed. I have in a couple of places used istanbul ignore - please let me know if you think any of those are not ok to skip.

Koenkk commented 2 years ago

Tested & works, thanks!

Inrego commented 2 years ago

Looking forward to trying it! Unfortunately, I can't update until https://github.com/Koenkk/zigbee2mqtt/issues/12031 has been closed.

smulle48 commented 2 years ago

Working great 👍

Don't know if you already knew it, but I can see it's reporting the active power for each phase :-)

I've hooked it up to my PEV charger.

Before charging:

Apr 13 21:01:29 homeassistant ea04f43b2a5b[535]: Zigbee2MQTT:debug 2022-04-13 21:01:29: Received Zigbee message from 'Clever lader', type 'commandNotification', cluster 'greenPower', data '{"commandFrame":{"attributes":{"acFrequency":500,"acFrequencyDivisor":10,"activePower":0,"activePowerPhB":0,"activePowerPhC":0,"powerDivisor":1000,"totalActivePower":0,"totalApparentPower":0},"clusterID":2820,"manufacturerCode":4190},"commandID":161,"frameCounter":84,"gppGddLink":255,"gppNwkAddr":4662,"options":20496,"payloadSize":50,"srcID":3791834163}' from endpoint 242 with groupID 52275

Activated charger:

Apr 13 21:07:58 homeassistant ea04f43b2a5b[535]: Zigbee2MQTT:debug 2022-04-13 21:07:58: Received Zigbee message from 'Clever lader', type 'commandNotification', cluster 'greenPower', data '{"commandFrame":{"attributes":{"acFrequency":500,"acFrequencyDivisor":10,"activePower":3348,"activePowerPhB":3360,"activePowerPhC":3324,"powerDivisor":1000,"totalActivePower":10032,"totalApparentPower":10611},"clusterID":2820,"manufacturerCode":4190},"commandID":161,"frameCounter":64,"gppGddLink":255,"gppNwkAddr":34557,"options":20496,"payloadSize":50,"srcID":3791834163}' from endpoint 242 with groupID 52275

So at least I can see it in the debug log :-D

filips commented 2 years ago

Working great 👍

Don't know if you already knew it, but I can see it's reporting the active power for each phase :-)

I've hooked it up to my PEV charger.

Before charging:

Apr 13 21:01:29 homeassistant ea04f43b2a5b[535]: Zigbee2MQTT:debug 2022-04-13 21:01:29: Received Zigbee message from 'Clever lader', type 'commandNotification', cluster 'greenPower', data '{"commandFrame":{"attributes":{"acFrequency":500,"acFrequencyDivisor":10,"activePower":0,"activePowerPhB":0,"activePowerPhC":0,"powerDivisor":1000,"totalActivePower":0,"totalApparentPower":0},"clusterID":2820,"manufacturerCode":4190},"commandID":161,"frameCounter":84,"gppGddLink":255,"gppNwkAddr":4662,"options":20496,"payloadSize":50,"srcID":3791834163}' from endpoint 242 with groupID 52275

Activated charger:

Apr 13 21:07:58 homeassistant ea04f43b2a5b[535]: Zigbee2MQTT:debug 2022-04-13 21:07:58: Received Zigbee message from 'Clever lader', type 'commandNotification', cluster 'greenPower', data '{"commandFrame":{"attributes":{"acFrequency":500,"acFrequencyDivisor":10,"activePower":3348,"activePowerPhB":3360,"activePowerPhC":3324,"powerDivisor":1000,"totalActivePower":10032,"totalApparentPower":10611},"clusterID":2820,"manufacturerCode":4190},"commandID":161,"frameCounter":64,"gppGddLink":255,"gppNwkAddr":34557,"options":20496,"payloadSize":50,"srcID":3791834163}' from endpoint 242 with groupID 52275

So at least I can see it in the debug log :-D

Good to hear! Yeah it is being read out - all the additional fields such as individual phase power, voltage, power factor etc. just need to be added in the converter.

smulle48 commented 2 years ago

Working great 👍 Don't know if you already knew it, but I can see it's reporting the active power for each phase :-) I've hooked it up to my PEV charger. Before charging:

Apr 13 21:01:29 homeassistant ea04f43b2a5b[535]: Zigbee2MQTT:debug 2022-04-13 21:01:29: Received Zigbee message from 'Clever lader', type 'commandNotification', cluster 'greenPower', data '{"commandFrame":{"attributes":{"acFrequency":500,"acFrequencyDivisor":10,"activePower":0,"activePowerPhB":0,"activePowerPhC":0,"powerDivisor":1000,"totalActivePower":0,"totalApparentPower":0},"clusterID":2820,"manufacturerCode":4190},"commandID":161,"frameCounter":84,"gppGddLink":255,"gppNwkAddr":4662,"options":20496,"payloadSize":50,"srcID":3791834163}' from endpoint 242 with groupID 52275

Activated charger:

Apr 13 21:07:58 homeassistant ea04f43b2a5b[535]: Zigbee2MQTT:debug 2022-04-13 21:07:58: Received Zigbee message from 'Clever lader', type 'commandNotification', cluster 'greenPower', data '{"commandFrame":{"attributes":{"acFrequency":500,"acFrequencyDivisor":10,"activePower":3348,"activePowerPhB":3360,"activePowerPhC":3324,"powerDivisor":1000,"totalActivePower":10032,"totalApparentPower":10611},"clusterID":2820,"manufacturerCode":4190},"commandID":161,"frameCounter":64,"gppGddLink":255,"gppNwkAddr":34557,"options":20496,"payloadSize":50,"srcID":3791834163}' from endpoint 242 with groupID 52275

So at least I can see it in the debug log :-D

Good to hear! Yeah it is being read out - all the additional fields such as individual phase power, voltage, power factor etc. just need to be added in the converter.

That's a bit above my skills :-D

filips commented 2 years ago

Working great +1 Don't know if you already knew it, but I can see it's reporting the active power for each phase :-) I've hooked it up to my PEV charger. Before charging:

Apr 13 21:01:29 homeassistant ea04f43b2a5b[535]: Zigbee2MQTT:debug 2022-04-13 21:01:29: Received Zigbee message from 'Clever lader', type 'commandNotification', cluster 'greenPower', data '{"commandFrame":{"attributes":{"acFrequency":500,"acFrequencyDivisor":10,"activePower":0,"activePowerPhB":0,"activePowerPhC":0,"powerDivisor":1000,"totalActivePower":0,"totalApparentPower":0},"clusterID":2820,"manufacturerCode":4190},"commandID":161,"frameCounter":84,"gppGddLink":255,"gppNwkAddr":4662,"options":20496,"payloadSize":50,"srcID":3791834163}' from endpoint 242 with groupID 52275

Activated charger:

Apr 13 21:07:58 homeassistant ea04f43b2a5b[535]: Zigbee2MQTT:debug 2022-04-13 21:07:58: Received Zigbee message from 'Clever lader', type 'commandNotification', cluster 'greenPower', data '{"commandFrame":{"attributes":{"acFrequency":500,"acFrequencyDivisor":10,"activePower":3348,"activePowerPhB":3360,"activePowerPhC":3324,"powerDivisor":1000,"totalActivePower":10032,"totalApparentPower":10611},"clusterID":2820,"manufacturerCode":4190},"commandID":161,"frameCounter":64,"gppGddLink":255,"gppNwkAddr":34557,"options":20496,"payloadSize":50,"srcID":3791834163}' from endpoint 242 with groupID 52275

So at least I can see it in the debug log :-D

Good to hear! Yeah it is being read out - all the additional fields such as individual phase power, voltage, power factor etc. just need to be added in the converter.

That's a bit above my skills :-D

I actually did it earlier today (https://github.com/Koenkk/zigbee-herdsman-converters/pull/4134), should be available on the dev branch now.

smulle48 commented 2 years ago

Working great +1 Don't know if you already knew it, but I can see it's reporting the active power for each phase :-) I've hooked it up to my PEV charger. Before charging:

Apr 13 21:01:29 homeassistant ea04f43b2a5b[535]: Zigbee2MQTT:debug 2022-04-13 21:01:29: Received Zigbee message from 'Clever lader', type 'commandNotification', cluster 'greenPower', data '{"commandFrame":{"attributes":{"acFrequency":500,"acFrequencyDivisor":10,"activePower":0,"activePowerPhB":0,"activePowerPhC":0,"powerDivisor":1000,"totalActivePower":0,"totalApparentPower":0},"clusterID":2820,"manufacturerCode":4190},"commandID":161,"frameCounter":84,"gppGddLink":255,"gppNwkAddr":4662,"options":20496,"payloadSize":50,"srcID":3791834163}' from endpoint 242 with groupID 52275

Activated charger:

Apr 13 21:07:58 homeassistant ea04f43b2a5b[535]: Zigbee2MQTT:debug 2022-04-13 21:07:58: Received Zigbee message from 'Clever lader', type 'commandNotification', cluster 'greenPower', data '{"commandFrame":{"attributes":{"acFrequency":500,"acFrequencyDivisor":10,"activePower":3348,"activePowerPhB":3360,"activePowerPhC":3324,"powerDivisor":1000,"totalActivePower":10032,"totalApparentPower":10611},"clusterID":2820,"manufacturerCode":4190},"commandID":161,"frameCounter":64,"gppGddLink":255,"gppNwkAddr":34557,"options":20496,"payloadSize":50,"srcID":3791834163}' from endpoint 242 with groupID 52275

So at least I can see it in the debug log :-D

Good to hear! Yeah it is being read out - all the additional fields such as individual phase power, voltage, power factor etc. just need to be added in the converter.

That's a bit above my skills :-D

I actually did it earlier today (Koenkk/zigbee-herdsman-converters#4134), should be available on the dev branch now.

Wow....sweet :-)

Thank you very much. :-D

I was on the right track, I can see, but it's a pain in the a**, as I'm using the z2m home assistant plugin.

Have to move it to my test setup every time I want to test something :-/

Inrego commented 2 years ago

Not quite sure of the reason, but my Z2M keeps crashing when pairing one of these devices. It does pair to Z2M, but does not set up any reporting (so no values). And my zigbee network just mostly doesn't work, and Z2M crashes very frequently.

smulle48 commented 2 years ago

Not quite sure of the reason, but my Z2M keeps crashing when pairing one of these devices. It does pair to Z2M, but does not set up any reporting (so no values). And my zigbee network just mostly doesn't work, and Z2M crashes very frequently.

How does your debug log look like when adding the device?

filips commented 2 years ago

What type of zigbee coordinator do you use? Currently investigating some issues with the Conbee II and green power..

Inrego commented 2 years ago

Conbee II :D

Inrego commented 2 years ago

What type of zigbee coordinator do you use? Currently investigating some issues with the Conbee II and green power..

Which coordinator have you had success with?

smulle48 commented 2 years ago

What type of zigbee coordinator do you use? Currently investigating some issues with the Conbee II and green power..

Which coordinator have you had success with?

I've been using conbee II myself before. Even with deCONZ it was rubbish 😀

Now I'm using the slae.sh adapter and it's working great 👍

https://slae.sh/projects/cc2652/

filips commented 2 years ago

I'm also using the slae.sh adapter which is working great for me. I would expect any CC2652 based adapter to work similarly.

Inrego commented 2 years ago

So the Sonoff 3.0 dongle for example? Seems half the price, plus it's sold in my country so faster/cheaper shipping

filips commented 2 years ago

So the Sonoff 3.0 dongle for example? Seems half the price, plus it's sold in my country so faster/cheaper shipping

Yeah it should work, although i have not tried it.