## 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
```JSON
{
"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](https://www.zigbee2mqtt.io/devices/9290022890.html) and using a [IKEA E1746 TRADFRI signal repeater](https://www.zigbee2mqtt.io/devices/E1746.html)
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](https://cloud.ostsoft.com/s/MsAyT9MmgBYejBz).
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
```JS
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
```JS
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](https://cloud.ostsoft.com/s/MsAyT9MmgBYejBz) is a captured when the PowerTag is being commissioned by a [Schnieder Electric Acti 9 Smartlink SI B](https://www.se.com/ww/en/product/A9XMZA08/acti9-smartlink-si-b---modbus-tcp-ip-and-wireless-communication-module/)
[Zigbee2mqtt pairing.pcapng](https://cloud.ostsoft.com/s/MsAyT9MmgBYejBz) 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.