Koenkk / zigbee2mqtt

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

Schneider Electric PowerTag #7975

Closed OsteHovel closed 1 year ago

OsteHovel commented 3 years ago

Information about the device + link

Schneider Electric PowerTag Monoconnect 63A 1P+N top position

This is energy sensor utilizing Zigbee 3 Green Power

https://www.se.com/ww/en/product/A9MEM1521/energy-sensor%2C-powertag-monoconnect-63a-1p%2Bn-top-position/

data/database.db entry of the device

This gets added during pairing, but it actually does not really pair completely more info below

{
  "id": 3,
  "type": "GreenPower",
  "ieeeAddr": "0x00000000e20765cb",
  "nwkAddr": 26059,
  "manufId": null,
  "modelId": "GreenPower_254",
  "epList": [
    242
  ],
  "endpoints": {
    "242": {
      "epId": 242,
      "inClusterList": [],
      "outClusterList": [],
      "clusters": {},
      "binds": [],
      "configuredReportings": [],
      "meta": {}
    }
  },
  "interviewCompleted": true,
  "meta": {},
  "lastSeen": 1625428765211
}
Info Info
OS Windows
Zigbee2mqtt Latest on master branch
Zigbee-herdsman Latest on master branch
Cordinator CC2531
Channel 15
Network key 0c9f45818f14a953d0993f2304015e10

I have tried with both using a Philips Hue Light strip and using a IKEA E1746 TRADFRI signal repeater

Utilizing the Philips Hue Light strip the light strip does not reply to the channel request sent out by the PowerTag. By utilizing a IKEA signal repeater that actually replies to the channel requests and gets it on the correct channel and sending out a commissioning notification, see Channel request and configuration.pcapng.

I had to do some changes to Zigbee-herdsman to get it actually decode the packet correctly buffaloZcl.ts - Added a check for key present during payload

private readGdpFrame(options: TsType.Options): Gdp | {raw: Buffer} | Record<string, never> {
    // Commisioning
    if (options.payload.commandID === 224) {
        const deviceID = this.readUInt8();
        const options1 = this.readUInt8();
        const extendedOptions = this.readUInt8();

        const gdpKeyPresent = (extendedOptions & 0x20) != 0;
        if (gdpKeyPresent) {
            return {
                deviceID: deviceID,
                options: options1,
                extendedOptions: extendedOptions,
                securityKey: this.readBuffer(16),
                keyMic: this.readUInt32(),
                outgoingCounter: this.readUInt32(),
            };
        } else {
            return {
                deviceID: deviceID,
                options: options1,
                extendedOptions: extendedOptions,
                securityKey: null,
                keyMic: null,
                outgoingCounter: this.readUInt32(),
            };
        }
    } else if (this.position != this.buffer.length) {
        return {raw: this.buffer.slice(this.position)};
    } else {
        return {};
    }
}

greenPower.ts

public async onZclGreenPowerData(dataPayload: AdapterEvents.ZclDataPayload): Promise<void> {
    if (dataPayload.frame.Payload.commandID === 224 && typeof dataPayload.address === 'number') {

        const keyPresent = (dataPayload.frame.Payload.extendedOptions & 0x20) != 0;
        if (keyPresent) {
            const key = this.encryptSecurityKey(
                dataPayload.frame.Payload.srcID, dataPayload.frame.Payload.commandFrame.securityKey
            );

            const payload = {
                options: 0b1_1_100_10_1_0_10_0_1_000,
                srcID: dataPayload.frame.Payload.srcID,
                sinkGroupID: this.adapter.greenPowerGroup,
                deviceID: dataPayload.frame.Payload.commandFrame.deviceID,
                frameCounter: dataPayload.frame.Payload.commandFrame.outgoingCounter,
                gpdKey: [...key],
            };

            const frame = Zcl.ZclFrame.create(
                Zcl.FrameType.SPECIFIC, Zcl.Direction.SERVER_TO_CLIENT, true,
                null, ZclTransactionSequenceNumber.next(), 'pairing', 33, payload
            );

            await this.adapter.sendZclFrameToAll(242, frame, 242);
        } else {
            // Key not present security
            const key = Buffer.from([0xc9, 0x79, 0xd5, 0x22, 0x9c, 0xb9, 0xe9,
                0xd2, 0x8d, 0x5d, 0xa6, 0x99, 0xf8, 0xca, 0x02, 0x97]);

            const options = 0b1_1_010_11_1_1_10_0_1_000;
            const payload = {
                options: options,
                srcID: dataPayload.frame.Payload.srcID,
                sinkGroupID: this.adapter.greenPowerGroup,
                deviceID: dataPayload.frame.Payload.commandFrame.deviceID,
                frameCounter: dataPayload.frame.Payload.commandFrame.outgoingCounter,
                gpdKey: [...key],
            };

            const frame = Zcl.ZclFrame.create(
                Zcl.FrameType.SPECIFIC, Zcl.Direction.SERVER_TO_CLIENT, true,
                null, ZclTransactionSequenceNumber.next(), 'pairing', 33, payload
            );

            await this.adapter.sendZclFrameToAll(242, frame, 242);
        }

        const eventData: GreenPowerDeviceJoinedPayload = {
            sourceID: dataPayload.frame.Payload.srcID,
            deviceID: dataPayload.frame.Payload.commandFrame.deviceID,
            networkAddress: dataPayload.address,
        };

        this.emit(GreenPowerEvents.deviceJoined, eventData);
    }
}

I have flipped around with the options to try to get any response.

PowerTag Commissioning.pcapng is a captured when the PowerTag is being commissioned by a Schnieder Electric Acti 9 Smartlink SI B

Zigbee2mqtt pairing.pcapng is a capture of what happening when I am trying to pair with zigbee2mqtt I am thinking it is because the IKEA Signal Repeater (and for that matter the Philips Hue) is repeating the Green Power using protocol version 2 instead of 3, or I am just formatting the packets wrong.

jlama commented 1 year ago

If you don't care about dedicating a Sonoff Dongle-E to handle only PowerTags, I have a solution which involves flashing a new firmware and using custom software. I'll try to publish it in a few days when I have some time...

CR77777 commented 1 year ago

Hi highly appreciated if you can share your software. I am really frustrated with these wiser software and gateway. The idea of the powertag is great and very useful, but they closed all doors, only via the online api you can download your own data :/ in the app of the wiser hub you don’t see information about voltage or so on … or I am to stupid for that. So during waiting if there is a way to get a direct connection to the powertag via zigbee, are there ideas to get the data direct out of the wiser hub ?

jlama commented 1 year ago

I don't have time at the moment to polish it, so here it is as is: https://github.com/jlama/powertagd Just open an issue if you have any question.

rbswift commented 1 year ago

I'm also getting negative power measurements and power factor using a A9MEM1520 single pole powertag. This device is intended to be used in either up or down directions. Would it be possible to add a device specific setting to invert the measurements?

affer commented 1 year ago

Hi all.

running zigbee2mqtt in HA on proxmox installation with sonoff zigbee E usb. i get some of my powertags into mqtt by a Hue smart plug

unfortunately i do not get any data from the two powertag i found... and i can not recognize the others.

i suspect it is because the sonoff usb i am using is only experimental in zigbee2mqtt, can any one confirm?

Screenshot 2022-12-25 at 20 26 11 Screenshot 2022-12-25 at 20 26 29
filips commented 1 year ago

One thing I notice there is that your devices show up as "GreenPower_XXX". This number is hardcoded here for the powertag device: https://github.com/Koenkk/zigbee-herdsman-converters/blame/master/devices/schneider_electric.js#L935 .

This number comes from here: https://github.com/Koenkk/zigbee-herdsman/blob/15e9af9f28284d8596a5af277167ed5d2d4e071d/src/controller/controller.ts#L485 , where it is taken as the deviceID. Normally it is always 254, so I'm not quite sure what's different in your setup. Perhaps there could be some differences with the firmware your dongle is running, but I can't say for sure since I haven't used this particular dongle. Could you confirm which firmware version you're running on the dongle?

affer commented 1 year ago

from z2m: Zigbee2MQTT version 1.28.4 commit: unknown Coordinator type EZSP v8 Coordinator revision 6.10.3.0 build 297 Coordinator IEEE Address 0x84b4dbfffec7afbe Frontend version 0.6.119

from Elelabs_EzspFwUtility.py probe 2022/12/25 16:56:52 Elelabs_EzspFwUtility: Generic Zigbee EZSP adapter detected: 2022/12/25 16:56:52 Elelabs_EzspFwUtility: Firmware: 6.10.3-41 2022/12/25 16:56:52 Elelabs_EzspFwUtility: EZSP v8

i can see the two powertag i found is with _254 id tag to it.

i will try to reboot some of the powertags today and see if i can get them into z2m. not even sure how i got the two first into the system :-)

affer commented 1 year ago

follow up. the two powertag i got into the system is identified as greenpower_254, but no data except the link quality. the rest is still identifying as in above picture. I tried with an IKEA Repeater with same result.

All powertags is blinking red, also the two mentioned above.

affer commented 1 year ago

Update:

i got a new sonoff dongle, now the p model. firmware updated, and all powertags is reconfigured to use the new sonoff.

some succes.. i have two R9MEMxxxx which is fine reporting data, yay succes. but my A9MEMxxxx models is found as greenpower_254 now, but no data except link quality,

Does anyone know if i need to do something differen for my older A9MEMxxx powertag models ?

Screenshot 2023-01-02 at 20 34 56
affer commented 1 year ago

No one that can confirm they have A9MEMxxx model working? and did you do some kind of woodoo? R9 works fine here.. cant figure out what to do to get the A models working..

NicolaiPetri commented 1 year ago

I have the A models and absolutely no luck. I can partially pair them, but I never get data. I was not aware the seemingly big difference to R models but I do consider to buy instead if they will work with Z2M. —-NicolaiSent from my iPhoneOn 7 Jan 2023, at 20.50, affer @.***> wrote: No one that can confirm they have A9MEMxxx model working? and did you do some kind of woodoo? R9 works fine here.. cant figure out what to do to get the A models working..

—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you commented.Message ID: @.***>

affer commented 1 year ago

I have the A models and absolutely no luck. I can partially pair them, but I never get data. I was not aware the seemingly big difference to R models but I do consider to buy instead if they will work with Z2M. —-NicolaiSent from my iPhone>

I wonder why they call it the A9MEM integration if A9 models is not working! but go for the R models.. here is my 3 phase and 1 phase... screenshot from zigbee2mqtt dashboard

Screenshot 2023-01-07 at 21 03 46
octera commented 1 year ago

I have 2 A9MEM1522, and work like a charm thanks to @jlama powertag deamon and firmware. What is the color and blink of the led on your powertag ?

rbswift commented 1 year ago

I have A9MEM1520 working fine with Sonof usb3 controller

affer commented 1 year ago

I have 2 A9MEM1522, and work like a charm thanks to @jlama powertag deamon and firmware. What is the color and blink of the led on your powertag ?

thanks, that may be my next step if i cant get any data from zigbee2mqtt.. the devices after they are paired are blinking rapidly red.

octera commented 1 year ago

Based on the documentation (https://damrexelprod.blob.core.windows.net/medias/ae0315c5-b6ec-4e12-a5c8-36d15b4e67b3) the blinking red is when the powertag loss the communication. It's occurs when not receiving the expected acknolgdement from the network. Jlama's firmware is managing it

avsantos76 commented 1 year ago

hello,

Hoe did you pair the powertag with the sonoff?

thank you


From: affer @.> Sent: Sunday, January 8, 2023 07:49 To: Koenkk/zigbee2mqtt @.> Cc: avsantos76 @.>; Comment @.> Subject: Re: [Koenkk/zigbee2mqtt] Schneider Electric PowerTag (#7975)

I have 2 A9MEM1522, and work like a charm thanks to @jlamahttps://github.com/jlama powertag deamon and firmware. What is the color and blink of the led on your powertag ?

thanks, that may be my next step if i cant get any data from zigbee2mqtt.. the devices after they are paired are blinking rapidly red.

— Reply to this email directly, view it on GitHubhttps://github.com/Koenkk/zigbee2mqtt/issues/7975#issuecomment-1374745823, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AJI5WAPT2JQPHPZJZDIZUOTWRJWQPANCNFSM4757JQ2Q. You are receiving this because you commented.Message ID: @.***>

affer commented 1 year ago

I have A9MEM1520 working fine with Sonof usb3 controller

which device do you use as router?

rbswift commented 1 year ago

I have A9MEM1520 working fine with Sonof usb3 controller

which device do you use as router?

IKEA LED2002G5

tkarlsson commented 1 year ago

@verydrunk I have a hue plug 30-50 cm within the R9 i pair through. but it said no converter for the powertag. How to translate the modelid: 17242 ?

I have it showing up in my Z2M but as unsupported & no data and model is just "Powertag power sensor" it dosent recognize modelid

Do my converter look correct?

Did you figure out how to translate the modelID? I have two different PowerTags: modelID: 17240 == R9 M63 1P+W modelID: 17243 == R9 M63 3P

They're both getting identified as PowerTag power sensor (A9MEM1570) and also in Home Assistant I see information about three phases on the 1 phase meter.

affer commented 1 year ago

tried with new nabu casa's skyconnect.. finds A models.. but still no data.. R models it does not find., :-/

CR77777 commented 1 year ago

Hi, thanks @jlama for the software. Today I had some free time :) The Flashing of the sonoff was easy and worked. Now I see the data in the terminal window if ./powertagd is running. I am not so deep in zigbee, but how can I integrate these 3rd part software in a zigbee2mqtt? I have already a running zigbee network with a other sonoff dongle. Can I run 2 sonoff dongle in 1 software? Should there 2 different channels? Or is it possible to run everthing on the same channel? @affer maybe you can share your information with the integration in zigbee2mqtt? thanks

octera commented 1 year ago

Hi, thanks @jlama for the software. Today I had some free time :) The Flashing of the sonoff was easy and worked. Now I see the data in the terminal window if ./powertagd is running. I am not so deep in zigbee, but how can I integrate these 3rd part software in a zigbee2mqtt? I have already a running zigbee network with a other sonoff dongle. Can I run 2 sonoff dongle in 1 software? Should there 2 different channels? Or is it possible to run everthing on the same channel? @affer maybe you can share your information with the integration in zigbee2mqtt? thanks

I don't think it can be run in zigbee2mqtt. But I have done a little go app that take the output of powertagd and send it to mqtt. You can find the code here : And have to be launched with : https://github.com/octera/energy-center/blob/main/powertag/powertag2mqtt.go /powertag/powertagd -d /dev/ttyUSB-powertag | /powertag/powertag2mqtt

CR77777 commented 1 year ago

Hi, as you can see some lines above @affer take some screenshots with the powertags in the zigbee2mqtt user interface... Thank you I will try out your code. Cheers

affer commented 1 year ago

Hi, as you can see some lines above @affer take some screenshots with the powertags in the zigbee2mqtt user interface... Thank you I will try out your code. Cheers

i dont have any more information than allready provided... no succes yet with the powertags i have.

CR77777 commented 1 year ago

@octera Hi thank you for providing your code. I am not sure how to use your code correct, do I need to compile it in the powertagd software? Thanks for help.

CR77777 commented 1 year ago

@octera Hi forget it I got it. Thanks

github-actions[bot] commented 1 year ago

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

deimoslt commented 1 year ago

Up, problem exists.

eekamouze commented 1 year ago

Hi, I'm trying to pair a Schneider powertag R9M60 (Resi9 F63A 1P+N) to my z2m with no success. The only logs I see (debug) that seem related to it and when the device is in pairing mode (fast blinking orange) are:

Received Zigbee message from 'Coordinator', type 'commandNotification', cluster 'greenPower', data '{"commandID":227,"frameCounter":136,"srcID":0}' from endpoint 242 with groupID null, ignoring since it is from coordinator

Any idea why I can't even pair it?

Sonoff dongle rev. 6.10.3.0 build 297 z2m ver. 1.30.4

Thanks

Cicrocoft commented 1 year ago

Hi,

I'm trying to pair a Schneider powertag R9M60 (Resi9 F63A 1P+N) to my z2m with no success. The only logs I see (debug) that seem related to it and when the device is in pairing mode (fast blinking orange) are:

Received Zigbee message from 'Coordinator', type 'commandNotification', cluster 'greenPower', data '{"commandID":227,"frameCounter":136,"srcID":0}' from endpoint 242 with groupID null, ignoring since it is from coordinator

Any idea why I can't even pair it?

Sonoff dongle rev. 6.10.3.0 build 297

z2m ver. 1.30.4

Thanks

I gave up getting it to work with z2m, and instead flashed a Sonoff dongle E with jlama's code, and then set up a server to communicate with the powertags via this server as per jlama's instructions. Then I took Octeras mqtt script and made HA friendly, and now I have my powertags 100% stable in my HA energy dashboard :-) Next step is to buy more powertags ;-)

ghogberg commented 1 year ago

Hi, I'm trying to pair a Schneider powertag R9M60 (Resi9 F63A 1P+N) to my z2m with no success. The only logs I see (debug) that seem related to it and when the device is in pairing mode (fast blinking orange) are: Received Zigbee message from 'Coordinator', type 'commandNotification', cluster 'greenPower', data '{"commandID":227,"frameCounter":136,"srcID":0}' from endpoint 242 with groupID null, ignoring since it is from coordinator Any idea why I can't even pair it? Sonoff dongle rev. 6.10.3.0 build 297 z2m ver. 1.30.4 Thanks

I gave up getting it to work with z2m, and instead flashed a Sonoff dongle E with jlama's code, and then set up a server to communicate with the powertags via this server as per jlama's instructions. Then I took Octeras mqtt script and made HA friendly, and now I have my powertags 100% stable in my HA energy dashboard :-) Next step is to buy more powertags ;-)

@Cicrocoft : may I ask what modifications you did to the GO script to make it work with HA? I run the regular Mosquitto broker for HA right now with a mqtt user/pass for authentication.

mikimause9 commented 1 year ago

Hi, I bought the A9MEM1570 module only because I found it on the compatible devices list on the zigbee2mqtt (https://www.zigbee2mqtt.io/devices/A9MEM1570.html). I've been trying to connect it to my network with no luck. Why is this device listed on the Z2M site? Should I be able to pair it?

filips commented 1 year ago

Hi, I bought the A9MEM1570 module only because I found it on the compatible devices list on the zigbee2mqtt (https://www.zigbee2mqtt.io/devices/A9MEM1570.html). I've been trying to connect it to my network with no luck. Why is this device listed on the Z2M site? Should I be able to pair it?

It works under some specific circumstances. The complication arises from the fact that these modules use Zigbee Green Power, which is different from the plain Zigbee that most devices supported by Z2M use. In order for this to work, you need a device in your network to act as a "green power proxy". Most zigbee routers (generally all devices plugged in to mains) will have this capability to some extent. Having said that, I have only had lasting success with Philips devices. I currently use a Philip Hue Smart plug as the bridge to the powertag. Back when I was experimenting with it, the IKEA devices worked for a while, and then suddenly stopped. What I have now has been running without any hiccups for more than a year.

In addition to this, only some of the zigbee coordinators will work. Most notably Conbee does not work. I personally use a Slae.sh dongle, but I believe others have been successful with the Sonoff dongle.

Having said that, it can still be somewhat finicky to get to work. Some people in here have resorted to a solution with a custom firmware for a cc2652 dongle, which cuts out the middle man. I haven't tried this myself, but it sounds like people are having good results with that solution.

mikimause9 commented 1 year ago

Is there any list of routers that should work with this sensor? I spent quite a lot of money on it, and I wouldn't like to buy every single ZigBee router to find out which of them works. Why is there no info on the zigbee2mqtt site about that?

filips commented 1 year ago

I have personally only used the Slae.sh dongle, but I don't see any reason why the other CC2652 based routers (https://www.zigbee2mqtt.io/guide/adapters/#recommended) wouldn't work, since they can all run the same firmware.

I agree that this should be documented better, I just haven't had the time to get it done.

rbswift commented 1 year ago

It would certainly be a mistake to buy every single ZigBee router to find out which of them works. Much better to buy one or two cheap ones at a time and see what works out well with your environment. I'd recommend starting with a cheap ikea lightbulb or similar. Do make an edit/PR to the documentation if there's something you think could be improved. I'm sure it would be appreciated by people in a similar situation in future. It's a bit hard for anyone here to answer why specific info isn't on the site other than the obvious reason being that nobody added it yet. This is free software so kind people work hard at sharing but without obligation.

ghogberg commented 1 year ago

The Sonoff Dongle-E at least works with the "powertagd" daemon that @jlama wrote, I'm just fiddling around with the powertag2mqtt golang script from @octera to make it properly with the MQTT Broker in Home Assistant with Auto Discovery right now... but not so strong at either Golang or JSON formatting for MQTT 😄 but I'm learning! (any hints @Cicrocoft is appreciated 😉 )

filips commented 1 year ago

I have personally only used the Slae.sh dongle, but I don't see any reason why the other CC2652 based routers (https://www.zigbee2mqtt.io/guide/adapters/#recommended) wouldn't work, since they can all run the same firmware.

I agree that this should be documented better, I just haven't had the time to get it done.

Sorry, I read it as coordinator. For routers I just mentioned anecdotally that I never got it to work long term with IKEA repeaters, and the Philips Hue Smart plug worked for me. While it worked initially, the IKEA repeaters stopped forwarding green power messages to the power tags after approximately a week. Back when I did the main implementation for this device I just attributed it to a firmware issue in some IKEA devices. AFAIK IKEA does not sell any green power devices, which could explain that an issue with such a specific use case had gone unnoticed. Philips on the other hand has some switches that use green power.

mikimause9 commented 1 year ago

Having said that, I have only had lasting success with Philips devices. I currently use a Philip Hue Smart plug as the bridge to the powertag. Back when I was experimenting with it, the IKEA devices worked for a while, and then suddenly stopped. What I have now has been running without any hiccups for more than a year.

Should it also work with a Philips hue bulb?

filips commented 1 year ago

Yes should work, as long as the bulb is powered. It can be soft-off of course.

avsantos76 commented 1 year ago

Hello,

But it's possible to use the philips hue, has a coordinator? Can you explain the pairing process?

thank you,

besr regards, Alberto


From: Filip Sandborg @.> Sent: Saturday, June 3, 2023 22:18 To: Koenkk/zigbee2mqtt @.> Cc: avsantos76 @.>; Comment @.> Subject: Re: [Koenkk/zigbee2mqtt] Schneider Electric PowerTag (#7975)

Hi, I bought the A9MEM1570 module only because I found it on the compatible devices list on the zigbee2mqtt (https://www.zigbee2mqtt.io/devices/A9MEM1570.html). I've been trying to connect it to my network with no luck. Why is this device listed on the Z2M site? Should I be able to pair it?

It works under some specific circumstances. The complication arises from the fact that these modules use Zigbee Green Power, which is different from the plain Zigbee that most devices supported by Z2M use. In order for this to work, you need a device in your network to act as a "green power proxy". Most zigbee routers (generally all devices plugged in to mains) will have this capability to some extent. Having said that, I have only had lasting success with Philips devices. I currently use a Philip Hue Smart plug as the bridge to the powertag. Back when I was experimenting with it, the IKEA devices worked for a while, and then suddenly stopped. What I have now has been running without any hiccups for more than a year.

In addition to this, only some of the zigbee coordinators will work. Most notably Conbee does not work. I personally use a Slae.sh dongle, but I believe others have been successful with the Sonoff dongle.

Having said that, it can still be somewhat finicky to get to work. Some people in here have resorted to a solution with a custom firmware for a cc2652 dongle, which cuts out the middle man. I haven't tried this myself, but it sounds like people are having good results with that solution.

— Reply to this email directly, view it on GitHubhttps://github.com/Koenkk/zigbee2mqtt/issues/7975#issuecomment-1575198761, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AJI5WAMLANYWJNF5DKO23PDXJOS2TANCNFSM4757JQ2Q. You are receiving this because you commented.Message ID: @.***>

filips commented 1 year ago

In Zigbee terminology, the coordinator is the hub or usb adapter that is at the center of your zigbee network. A zigbee network will have one, and only one coordinator. On the other hand, a router is capable of extending the network. A zigbee network can have many routers. Commonly any mains connected bulb or smart plug will act as a router. Likewise some manufacturers sell dedicated repeaters, which will also act as a router.

In Zigbee Green Power terminology, the router will act as a Green Power Proxy (GPP), which can forward commands between the Green Power Sink (GPS) and Green Power Device (GPD).

In order to pair the power tag, it needs to be in pairing mode. If you go back in this thread there is a lot of information on this subject, and I don't recall it in detail. As I remember it, you wait until the LED on the power tag is blinking rapidly (approximately 5 minutes), and then you power cycle it. Then it will be in pairing mode. By then enabling pairing in Zigbee2MQTT on the Philips Hue router you want to use, it should pair to your network.

avsantos76 commented 1 year ago

Thank you for you reply. I understand the difference between a coordinator and a router. In my network I had, at some point, 3 coordinators: Xiaomi, Ikea and philips. Then I find that I could use philips hue with Ikea lamps, so I remove the Ikea gateway. Then I flash the Xiaomi gateway and now I use Zigbee2mqtt. At my company we have a powertag from a client, I try to put on my network without sucess. I was hable to see some debug information, but unable to pair.

Thank you.

best regards

Alberto Santos


From: Filip Sandborg @.> Sent: Tuesday, June 6, 2023 09:15 To: Koenkk/zigbee2mqtt @.> Cc: avsantos76 @.>; Comment @.> Subject: Re: [Koenkk/zigbee2mqtt] Schneider Electric PowerTag (#7975)

In Zigbee terminology, the coordinator is the hub or usb adapter that is at the center of your zigbee network. A zigbee network will have one, and only one coordinator. On the other hand, a router is capable of extending the network. A zigbee network can have many routers. Commonly any mains connected bulb or smart plug will act as a router. Likewise some manufacturers sell dedicated repeaters, which will also act as a router.

In Zigbee Green Power terminology, the router will act as a Green Power Proxy (GPP), which can forward commands between the Green Power Sink (GPS) and Green Power Device (GPD).

In order to pair the power tag, it needs to be in pairing mode. If you go back in this thread there is a lot of information on this subject, and I don't recall it in detail. As I remember it, you wait until the LED on the power tag is blinking rapidly (approximately 5 minutes), and then you power cycle it. Then it will be in pairing mode. By then enabling pairing in Zigbee2MQTT on the Philips Hue router you want to use, it should pair to your network.

— Reply to this email directly, view it on GitHubhttps://github.com/Koenkk/zigbee2mqtt/issues/7975#issuecomment-1578153050, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AJI5WAPWSXQ6ZN4HCKXZRKDXJ3RIVANCNFSM4757JQ2Q. You are receiving this because you commented.Message ID: @.***>

tomasaberg commented 1 year ago

Sorry for commenting on a closed issue but this have been quite a headache for me.
I have now found a combination of devices that works and I don't need a seperate Zigbee network for other devices or a Hue bulp that is always on.

For coordinator I'm using the Sonoff ZBDongle-P version, out of the box, no custom firmware. To pair with the Schnider PowerTag (R9M70) I use a Aotec WG001.

The PowerTags paired instantly without issues. The reported values looks like they are correct as well.

I'm happy to provide any information

image image

Cicrocoft commented 1 year ago

Hi,

I'm trying to pair a Schneider powertag R9M60 (Resi9 F63A 1P+N) to my z2m with no success. The only logs I see (debug) that seem related to it and when the device is in pairing mode (fast blinking orange) are:

Received Zigbee message from 'Coordinator', type 'commandNotification', cluster 'greenPower', data '{"commandID":227,"frameCounter":136,"srcID":0}' from endpoint 242 with groupID null, ignoring since it is from coordinator

Any idea why I can't even pair it?

Sonoff dongle rev. 6.10.3.0 build 297

z2m ver. 1.30.4

Thanks

I gave up getting it to work with z2m, and instead flashed a Sonoff dongle E with jlama's code, and then set up a server to communicate with the powertags via this server as per jlama's instructions. Then I took Octeras mqtt script and made HA friendly, and now I have my powertags 100% stable in my HA energy dashboard :-) Next step is to buy more powertags ;-)

@Cicrocoft : may I ask what modifications you did to the GO script to make it work with HA? I run the regular Mosquitto broker for HA right now with a mqtt user/pass for authentication.

Shoot, have first seen your message here now. In jlama's GitHub under "issues", and then under the mqtt issue, I left an url with a zip with all the files I changed.

Edit: https://github.com/jlama/powertagd/issues/1

WinFinn commented 1 year ago

Any suggestions on how to send a command message on the power direction from zigbee2mqtt? I tried with an external converter but I'm only getting an timeout error on "No network route"

'Error: Write 0x00000000e20282b0/242 65300({"1792":{"value":0,"type":24}}, {"sendWhen":"immediate","timeout":10000,"disableResponse":false,"disableRecovery":false,"disableDefaultResponse":true,"direction":0,"srcEndpoint":null,"reservedBits":0,"manufacturerCode":4190,"transactionSequenceNumber":null,"writeUndiv":false}) failed (Data request failed with error: 'No network route' (205))'

--- snip ---
const tzLocal = {
  powertag_direction: {
        key: ['powertag_direction'],
        convertSet: async (entity, key, value, meta) => {
            const lookup = {'Downstream': 0x00, 'Upstream': 0x01};
            utils.validateValue(value, Object.keys(lookup));
            const mode = lookup[value];
            await entity.write(0xff14, {0x0700: {value: mode, type: 0x18}}, {manufacturerCode: 0x105e});
            return {state: {powertag_direction: value}};
        },
    },
};
--- snip ---
module.exports = [
    {
        fingerprint: [{modelID: 'GreenPower_254', ieeeAddr: /^0x00000000e.......$/}],
        model: 'A9MEM1570',
        vendor: 'Schneider Electric',
        description: 'PowerTag power sensor',
        fromZigbee: [fzLocal.schneider_powertag],
        toZigbee: [tzLocal.powertag_direction],
        exposes: [
            exposes.enum('powertag_direction', ea.ALL, ['Downstream', 'Upstream'])
                .withDescription('PowerTag mounted Downstream (after) or Upstream (before) of the Circuit Breaker'),
--- snip ---

        ],
    },
];

@somlioy Did you get this any further? I see from your fork that you implemented the code in buffaloZcl.ts. Did it work? I've got a Elko smart tag flex 1P+N, and it identifies it self as Schneider Electric (0x105e) Model ID 0x438d. Have 7 of these running fine in Z2m, but all are showing negative power. From the commissioning, GDP CommandID list, it lists both the write attribute (0xf1) and the read attribute (0xf2) image I was thinking that if you had the Write Attribute Command working it would be easy to also implement the Read Attribute command, to read the same Attribute ID state, before actually changing it. I'm using Sonoff ZBDongle-P as coordinator and Hue Smart Plug as GPP, also have a sniffer running (Conbee II), so can easilly help in testing if needed. Can also help in defining the frames needed for read attribute command in case needed, but I'm lacking the skill of js and z2m to complete the tasks. (Could maybe open a separate ticket, men the issue has already been discussed in this thread)

Kiki3872 commented 8 months ago

Comment faire pour avoir les Powertag sous zigbee2mqtt ?