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

Ubisys S1-R (Series 2) #8627

Merged
merged 8 commits into from
Jan 27, 2025
Merged

Ubisys S1-R (Series 2) #8627

merged 8 commits into from
Jan 27, 2025

Conversation

sjorge
Copy link
Contributor

@sjorge sjorge commented Jan 17, 2025

Ubisys support contacted me since customers seem to have problems with this device on the latest z2m.

Based on information from them the only big change is that the metering is now done on endpoint 1 not 4. We can differentiate between the S1-R and S1-R Series 2 by checking genBasic.hwVersion.

I don't have a S1-R and S1-R Series 2 myself and there is also no easy way to install both to make this easier, however ubisys support has a test setup using z2m on HA and they can test this before it gets merged.

So far this PR does the following:

  • drop the attempt to support the series 2 using fingerprinting, this does not to be working at all (based on comments from ubisys support, and these devices are (nearly) identical and share the same zigbeeModel as such)
  • switch all use of ubisysOnEventReadCurrentSummDelivered over to ubisysPollCurrentSummDelivered
  • pull in some of the modernExtend changes from fingerprint variant
  • update endpoints and configure functions to key of device.hardwareVersion
  • add missing endpoint 3 for S1-R as per technical manual

But I got stuck on the following:

  • telling the electricityMeter modernExtend to use a different endpoint based on device.hardwareVersion
  • S1-R seems to support powerOnBehavior based on the existing code, but it was disabled on the series 2 one.
image

Technical manual says this is supported.

@Koenkk can you help me with the electricityMeter metering one? Also I though there was a guide somewhere on how to test changes like this on z2m when using HA, but I can't find it anymore. What would be the easiest way for Ubisys support to pull in these changes to test?

Meanwhile I will reach out to support and point them to this draft PR, they should be able to answer my other open issue.

@Koenkk
Copy link
Owner

Koenkk commented Jan 17, 2025

The electricityMeter extend automatically finds which cluster supports metering, assuming only ep 4 supports it and not ep 1, it should work out of the box.

@sjorge
Copy link
Contributor Author

sjorge commented Jan 17, 2025

The electricityMeter extend automatically finds which cluster supports metering, assuming only ep 4 supports it and not ep 1, it should work out of the box.

Weird, I was testing with a normal S1 (meter is on ep3 for that one) with a similar switch to modernExtend as the S1-R in this PR.

It is always trying to read from ep1 which times out.

IMG_2923
IMG_2922

As you key see seMetering is only on ep3 for this device.

Once I’m back at my desk I’ll also add the modified definition I have for the regular S1, essentially if I fix it for the S1 it should work for S1-R/S1-R Series 2 also.

@Koenkk
Copy link
Owner

Koenkk commented Jan 17, 2025

The logic to determine the endpoint can be found here: https://github.com/Koenkk/zigbee-herdsman-converters/blob/master/src/lib/modernExtend.ts#L51

@sjorge
Copy link
Contributor Author

sjorge commented Jan 17, 2025

I pushed the update s1 definition too ... this is what I get

[2025-01-17 21:27:40] debug: 	z2m:mqtt: Received MQTT message on 'zigbee2mqtt/0x001fee0000006e19/get' with data '{"power":""}'
[2025-01-17 21:27:40] debug: 	z2m: Publishing get 'get' 'power' to '0x001fee0000006e19'
[2025-01-17 21:27:40] debug: 	zh:controller:endpoint: ZCL command 0x001fee0000006e19/1 seMetering.read(["instantaneousDemand"], {"timeout":10000,"disableResponse":false,"disableRecovery":false,"disableDefaultResponse":true,"direction":0,"reservedBits":0,"writeUndiv":false})
[2025-01-17 21:27:40] debug: 	zh:zstack: sendZclFrameToEndpointInternal 0x001fee0000006e19:7227/1 (0,0,1)
[2025-01-17 21:27:40] debug: 	zh:zstack:znp: --> SREQ: AF - dataRequest - {"dstaddr":7227,"destendpoint":1,"srcendpoint":1,"clusterid":1794,"transid":3,"options":0,"radius":30,"len":5,"data":{"type":"Buffer","data":[16,3,0,0,4]}}
[2025-01-17 21:27:40] debug: 	zh:zstack:unpi:writer: --> frame [254,15,36,1,59,28,1,1,2,7,3,0,30,5,16,3,0,0,4,7]
[2025-01-17 21:27:40] debug: 	zh:zstack:unpi:parser: <-- [254,1,100,1,0,100]
[2025-01-17 21:27:40] debug: 	zh:zstack:unpi:parser: --- parseNext [254,1,100,1,0,100]
[2025-01-17 21:27:40] debug: 	zh:zstack:unpi:parser: --> parsed 1 - 3 - 4 - 1 - [0] - 100
[2025-01-17 21:27:40] debug: 	zh:zstack:znp: <-- SRSP: AF - dataRequest - {"status":0}
[2025-01-17 21:27:40] debug: 	zh:zstack:unpi:parser: --- parseNext []
[2025-01-17 21:27:40] debug: 	zh:zstack:unpi:parser: <-- [254,3,68,128,0,1,3,197]
[2025-01-17 21:27:40] debug: 	zh:zstack:unpi:parser: --- parseNext [254,3,68,128,0,1,3,197]
[2025-01-17 21:27:40] debug: 	zh:zstack:unpi:parser: --> parsed 3 - 2 - 4 - 128 - [0,1,3] - 197
[2025-01-17 21:27:40] debug: 	zh:zstack:znp: <-- AREQ: AF - dataConfirm - {"status":0,"endpoint":1,"transid":3}
[2025-01-17 21:27:40] debug: 	zh:zstack:unpi:parser: --- parseNext []
[2025-01-17 21:27:40] debug: 	zh:zstack:unpi:parser: <-- [254,25,68,129,0,0,2,7,59,28,1,1,0,109,0,99,71,151,0,0,5,24,3,11,0,195,59,28,29,204]
[2025-01-17 21:27:40] debug: 	zh:zstack:unpi:parser: --- parseNext [254,25,68,129,0,0,2,7,59,28,1,1,0,109,0,99,71,151,0,0,5,24,3,11,0,195,59,28,29,204]
[2025-01-17 21:27:40] debug: 	zh:zstack:unpi:parser: --> parsed 25 - 2 - 4 - 129 - [0,0,2,7,59,28,1,1,0,109,0,99,71,151,0,0,5,24,3,11,0,195,59,28,29] - 204
[2025-01-17 21:27:40] debug: 	zh:zstack:znp: <-- AREQ: AF - incomingMsg - {"groupid":0,"clusterid":1794,"srcaddr":7227,"srcendpoint":1,"dstendpoint":1,"wasbroadcast":0,"linkquality":109,"securityuse":0,"timestamp":9914211,"transseqnumber":0,"len":5,"data":{"type":"Buffer","data":[24,3,11,0,195]}}
[2025-01-17 21:27:40] debug: 	zh:controller: Received payload: clusterID=1794, address=7227, groupID=0, endpoint=1, destinationEndpoint=1, wasBroadcast=false, linkQuality=109, frame={"header":{"frameControl":{"frameType":0,"manufacturerSpecific":false,"direction":1,"disableDefaultResponse":true,"reservedBits":0},"transactionSequenceNumber":3,"commandIdentifier":11},"payload":{"cmdId":0,"statusCode":195},"command":{"ID":11,"name":"defaultRsp","parameters":[{"name":"cmdId","type":32},{"name":"statusCode","type":32}]}}
[2025-01-17 21:27:40] debug: 	zh:zstack:unpi:parser: --- parseNext []
[2025-01-17 21:27:46] debug: 	zh:controller:endpoint: ZCL command 0x001fee0000006e19/3 seMetering.read(["currentSummDelivered"], {"timeout":10000,"disableResponse":false,"disableRecovery":false,"disableDefaultResponse":true,"direction":0,"reservedBits":0,"writeUndiv":false})
[2025-01-17 21:27:50] debug: 	zh:zstack: Response timeout (0x001fee0000006e19:7227,0)
[2025-01-17 21:27:50] debug: 	zh:zstack:znp: --> SREQ: UTIL - assocGetWithAddress - {"extaddr":"0x001fee0000006e19","nwkaddr":7227}
[2025-01-17 21:27:50] debug: 	zh:zstack:unpi:writer: --> frame [254,10,39,74,25,110,0,0,0,238,31,0,59,28,198]
[2025-01-17 21:27:50] debug: 	zh:zstack:unpi:parser: <-- [254,36,103,74,254,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]
[2025-01-17 21:27:50] debug: 	zh:zstack:unpi:parser: --- parseNext [254,36,103,74,254,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]
[2025-01-17 21:27:50] debug: 	zh:zstack:unpi:parser: <-- [0,0,0,0,0,0,0,0,8]
[2025-01-17 21:27:50] debug: 	zh:zstack:unpi:parser: --- parseNext [254,36,103,74,254,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,8]
[2025-01-17 21:27:50] debug: 	zh:zstack:unpi:parser: --> parsed 36 - 3 - 7 - 74 - [254,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0] - 8
[2025-01-17 21:27:50] debug: 	zh:zstack:znp: <-- SRSP: UTIL - assocGetWithAddress - {"nwkaddr":65534,"addridx":0,"noderelation":0}
[2025-01-17 21:27:50] debug: 	zh:zstack:unpi:parser: --- parseNext []
[2025-01-17 21:27:50] debug: 	zh:zstack: Response timeout recovery: Node relation 0 (0x001fee0000006e19 / 65534)
[2025-01-17 21:27:50] debug: 	zh:zstack: Discovering route to 7227
[2025-01-17 21:27:50] debug: 	zh:zstack:znp: --> SREQ: ZDO - extRouteDisc - {"dstAddr":7227,"options":0,"radius":30}
[2025-01-17 21:27:50] debug: 	zh:zstack:unpi:writer: --> frame [254,4,37,69,59,28,0,30,93]
[2025-01-17 21:27:50] debug: 	zh:zstack:unpi:parser: <-- [254,1,101,69,0,33]
[2025-01-17 21:27:50] debug: 	zh:zstack:unpi:parser: --- parseNext [254,1,101,69,0,33]
[2025-01-17 21:27:50] debug: 	zh:zstack:unpi:parser: --> parsed 1 - 3 - 5 - 69 - [0] - 33
[2025-01-17 21:27:50] debug: 	zh:zstack:znp: <-- SRSP: ZDO - extRouteDisc
[2025-01-17 21:27:50] debug: 	zh:zstack:unpi:parser: --- parseNext []
[2025-01-17 21:27:53] debug: 	zh:zstack: sendZclFrameToEndpointInternal 0x001fee0000006e19:7227/1 (1,0,2)
[2025-01-17 21:27:53] debug: 	zh:zstack:znp: --> SREQ: AF - dataRequest - {"dstaddr":7227,"destendpoint":1,"srcendpoint":1,"clusterid":1794,"transid":4,"options":0,"radius":30,"len":5,"data":{"type":"Buffer","data":[16,3,0,0,4]}}
[2025-01-17 21:27:53] debug: 	zh:zstack:unpi:writer: --> frame [254,15,36,1,59,28,1,1,2,7,4,0,30,5,16,3,0,0,4,0]
[2025-01-17 21:27:53] debug: 	zh:zstack:unpi:parser: <-- [254,1,100,1,0,100]
[2025-01-17 21:27:53] debug: 	zh:zstack:unpi:parser: --- parseNext [254,1,100,1,0,100]
[2025-01-17 21:27:53] debug: 	zh:zstack:unpi:parser: --> parsed 1 - 3 - 4 - 1 - [0] - 100
[2025-01-17 21:27:53] debug: 	zh:zstack:znp: <-- SRSP: AF - dataRequest - {"status":0}
[2025-01-17 21:27:53] debug: 	zh:zstack:unpi:parser: --- parseNext []
[2025-01-17 21:27:53] debug: 	zh:zstack:unpi:parser: <-- [254,3,68,128,0,1,4,194]
[2025-01-17 21:27:53] debug: 	zh:zstack:unpi:parser: --- parseNext [254,3,68,128,0,1,4,194]
[2025-01-17 21:27:53] debug: 	zh:zstack:unpi:parser: --> parsed 3 - 2 - 4 - 128 - [0,1,4] - 194
[2025-01-17 21:27:53] debug: 	zh:zstack:znp: <-- AREQ: AF - dataConfirm - {"status":0,"endpoint":1,"transid":4}
[2025-01-17 21:27:53] debug: 	zh:zstack:unpi:parser: --- parseNext []
[2025-01-17 21:27:53] debug: 	zh:zstack:unpi:parser: <-- [254,25,68,129,0,0,2,7,59,28,1,1,0,105,0,4,185,163,0,0,5,24,3,11,0,195,59,28,29,101]
[2025-01-17 21:27:53] debug: 	zh:zstack:unpi:parser: --- parseNext [254,25,68,129,0,0,2,7,59,28,1,1,0,105,0,4,185,163,0,0,5,24,3,11,0,195,59,28,29,101]
[2025-01-17 21:27:53] debug: 	zh:zstack:unpi:parser: --> parsed 25 - 2 - 4 - 129 - [0,0,2,7,59,28,1,1,0,105,0,4,185,163,0,0,5,24,3,11,0,195,59,28,29] - 101
[2025-01-17 21:27:53] debug: 	zh:zstack:znp: <-- AREQ: AF - incomingMsg - {"groupid":0,"clusterid":1794,"srcaddr":7227,"srcendpoint":1,"dstendpoint":1,"wasbroadcast":0,"linkquality":105,"securityuse":0,"timestamp":10729732,"transseqnumber":0,"len":5,"data":{"type":"Buffer","data":[24,3,11,0,195]}}
[2025-01-17 21:27:53] debug: 	zh:controller: Received payload: clusterID=1794, address=7227, groupID=0, endpoint=1, destinationEndpoint=1, wasBroadcast=false, linkQuality=105, frame={"header":{"frameControl":{"frameType":0,"manufacturerSpecific":false,"direction":1,"disableDefaultResponse":true,"reservedBits":0},"transactionSequenceNumber":3,"commandIdentifier":11},"payload":{"cmdId":0,"statusCode":195},"command":{"ID":11,"name":"defaultRsp","parameters":[{"name":"cmdId","type":32},{"name":"statusCode","type":32}]}}
[2025-01-17 21:27:53] debug: 	zh:zstack:unpi:parser: --- parseNext []
[2025-01-17 21:28:03] debug: 	zh:zstack: Response timeout (0x001fee0000006e19:7227,1)
[2025-01-17 21:28:03] debug: 	zh:zstack: sendZclFrameToEndpointInternal 0x001fee0000006e19:7227/3 (0,0,1)
[2025-01-17 21:28:03] debug: 	zh:zstack:znp: --> SREQ: AF - dataRequest - {"dstaddr":7227,"destendpoint":3,"srcendpoint":1,"clusterid":1794,"transid":5,"options":0,"radius":30,"len":5,"data":{"type":"Buffer","data":[16,4,0,0,0]}}
[2025-01-17 21:28:03] debug: 	zh:zstack:unpi:writer: --> frame [254,15,36,1,59,28,3,1,2,7,5,0,30,5,16,4,0,0,0,0]
[2025-01-17 21:28:03] debug: 	zh:controller:endpoint: Error: ZCL command 0x001fee0000006e19/1 seMetering.read(["instantaneousDemand"], {"timeout":10000,"disableResponse":false,"disableRecovery":false,"disableDefaultResponse":true,"direction":0,"reservedBits":0,"writeUndiv":false}) failed (Timeout - 7227 - 1 - 3 - 1794 - 1 after 10000ms)
    at Object.start (/Users/sjorge/Documents/repos/zigbee2mqtt/node_modules/.pnpm/zigbee-herdsman@3.2.2/node_modules/zigbee-herdsman/src/utils/waitress.ts:59:23)
    at ZStackAdapter.sendZclFrameToEndpointInternal (/Users/sjorge/Documents/repos/zigbee2mqtt/node_modules/.pnpm/zigbee-herdsman@3.2.2/node_modules/zigbee-herdsman/src/adapter/z-stack/adapter/zStackAdapter.ts:663:47)
    at ZStackAdapter.sendZclFrameToEndpointInternal (/Users/sjorge/Documents/repos/zigbee2mqtt/node_modules/.pnpm/zigbee-herdsman@3.2.2/node_modules/zigbee-herdsman/src/adapter/z-stack/adapter/zStackAdapter.ts:695:28)
    at /Users/sjorge/Documents/repos/zigbee2mqtt/node_modules/.pnpm/zigbee-herdsman@3.2.2/node_modules/zigbee-herdsman/src/adapter/z-stack/adapter/zStackAdapter.ts:443:20
    at Queue.execute (/Users/sjorge/Documents/repos/zigbee2mqtt/node_modules/.pnpm/zigbee-herdsman@3.2.2/node_modules/zigbee-herdsman/src/utils/queue.ts:36:20)
    at ZStackAdapter.sendZclFrameToEndpoint (/Users/sjorge/Documents/repos/zigbee2mqtt/node_modules/.pnpm/zigbee-herdsman@3.2.2/node_modules/zigbee-herdsman/src/adapter/z-stack/adapter/zStackAdapter.ts:441:16)
    at Request.send (/Users/sjorge/Documents/repos/zigbee2mqtt/node_modules/.pnpm/zigbee-herdsman@3.2.2/node_modules/zigbee-herdsman/src/controller/helpers/request.ts:82:20)
    at Endpoint.sendRequest (/Users/sjorge/Documents/repos/zigbee2mqtt/node_modules/.pnpm/zigbee-herdsman@3.2.2/node_modules/zigbee-herdsman/src/controller/model/endpoint.ts:324:20)
    at Endpoint.zclCommand (/Users/sjorge/Documents/repos/zigbee2mqtt/node_modules/.pnpm/zigbee-herdsman@3.2.2/node_modules/zigbee-herdsman/src/controller/model/endpoint.ts:949:28)
    at Endpoint.read (/Users/sjorge/Documents/repos/zigbee2mqtt/node_modules/.pnpm/zigbee-herdsman@3.2.2/node_modules/zigbee-herdsman/src/controller/model/endpoint.ts:445:29)
[2025-01-17 21:28:03] error: 	z2m: Publish 'get' 'power' to '0x001fee0000006e19' failed: 'Error: ZCL command 0x001fee0000006e19/1 seMetering.read(["instantaneousDemand"], {"timeout":10000,"disableResponse":false,"disableRecovery":false,"disableDefaultResponse":true,"direction":0,"reservedBits":0,"writeUndiv":false}) failed (Timeout - 7227 - 1 - 3 - 1794 - 1 after 10000ms)'
[2025-01-17 21:28:03] debug: 	z2m: Error: ZCL command 0x001fee0000006e19/1 seMetering.read(["instantaneousDemand"], {"timeout":10000,"disableResponse":false,"disableRecovery":false,"disableDefaultResponse":true,"direction":0,"reservedBits":0,"writeUndiv":false}) failed (Timeout - 7227 - 1 - 3 - 1794 - 1 after 10000ms)
    at Object.start (/Users/sjorge/Documents/repos/zigbee2mqtt/node_modules/.pnpm/zigbee-herdsman@3.2.2/node_modules/zigbee-herdsman/src/utils/waitress.ts:59:23)
    at ZStackAdapter.sendZclFrameToEndpointInternal (/Users/sjorge/Documents/repos/zigbee2mqtt/node_modules/.pnpm/zigbee-herdsman@3.2.2/node_modules/zigbee-herdsman/src/adapter/z-stack/adapter/zStackAdapter.ts:663:47)
    at ZStackAdapter.sendZclFrameToEndpointInternal (/Users/sjorge/Documents/repos/zigbee2mqtt/node_modules/.pnpm/zigbee-herdsman@3.2.2/node_modules/zigbee-herdsman/src/adapter/z-stack/adapter/zStackAdapter.ts:695:28)
    at /Users/sjorge/Documents/repos/zigbee2mqtt/node_modules/.pnpm/zigbee-herdsman@3.2.2/node_modules/zigbee-herdsman/src/adapter/z-stack/adapter/zStackAdapter.ts:443:20
    at Queue.execute (/Users/sjorge/Documents/repos/zigbee2mqtt/node_modules/.pnpm/zigbee-herdsman@3.2.2/node_modules/zigbee-herdsman/src/utils/queue.ts:36:20)
    at ZStackAdapter.sendZclFrameToEndpoint (/Users/sjorge/Documents/repos/zigbee2mqtt/node_modules/.pnpm/zigbee-herdsman@3.2.2/node_modules/zigbee-herdsman/src/adapter/z-stack/adapter/zStackAdapter.ts:441:16)
    at Request.send (/Users/sjorge/Documents/repos/zigbee2mqtt/node_modules/.pnpm/zigbee-herdsman@3.2.2/node_modules/zigbee-herdsman/src/controller/helpers/request.ts:82:20)
    at Endpoint.sendRequest (/Users/sjorge/Documents/repos/zigbee2mqtt/node_modules/.pnpm/zigbee-herdsman@3.2.2/node_modules/zigbee-herdsman/src/controller/model/endpoint.ts:324:20)
    at Endpoint.zclCommand (/Users/sjorge/Documents/repos/zigbee2mqtt/node_modules/.pnpm/zigbee-herdsman@3.2.2/node_modules/zigbee-herdsman/src/controller/model/endpoint.ts:949:28)
    at Endpoint.read (/Users/sjorge/Documents/repos/zigbee2mqtt/node_modules/.pnpm/zigbee-herdsman@3.2.2/node_modules/zigbee-herdsman/src/controller/model/endpoint.ts:445:29)

As you can see the read goes to ep1 not ep3. I'll add some debug code to the function you linked earlier and see what turns up.

@Koenkk
Copy link
Owner

Koenkk commented Jan 17, 2025

Could you paste the data/database.db entry of this device?

@sjorge
Copy link
Contributor Author

sjorge commented Jan 17, 2025

Could you paste the data/database.db entry of this device?

{"id":1,"type":"Coordinator","ieeeAddr":"0x00124b001e17ef39","nwkAddr":0,"manufId":0,"epList":[1,2,3,4,5,6,8,10,11,12,13,47,110,242],"endpoints":{"1":{"profId":260,"epId":1,"devId":5,"inClusterList":[],"outClusterList":[],"clusters":{},"binds":[],"configuredReportings":[],"meta":{}},"2":{"profId":257,"epId":2,"devId":5,"inClusterList":[],"outClusterList":[],"clusters":{},"binds":[],"configuredReportings":[],"meta":{}},"3":{"profId":260,"epId":3,"devId":5,"inClusterList":[],"outClusterList":[],"clusters":{},"binds":[],"configuredReportings":[],"meta":{}},"4":{"profId":263,"epId":4,"devId":5,"inClusterList":[],"outClusterList":[],"clusters":{},"binds":[],"configuredReportings":[],"meta":{}},"5":{"profId":264,"epId":5,"devId":5,"inClusterList":[],"outClusterList":[],"clusters":{},"binds":[],"configuredReportings":[],"meta":{}},"6":{"profId":265,"epId":6,"devId":5,"inClusterList":[],"outClusterList":[],"clusters":{},"binds":[],"configuredReportings":[],"meta":{}},"8":{"profId":260,"epId":8,"devId":5,"inClusterList":[],"outClusterList":[],"clusters":{},"binds":[],"configuredReportings":[],"meta":{}},"10":{"profId":260,"epId":10,"devId":5,"inClusterList":[],"outClusterList":[],"clusters":{},"binds":[],"configuredReportings":[],"meta":{}},"11":{"profId":260,"epId":11,"devId":1024,"inClusterList":[1281,10],"outClusterList":[1280,1282],"clusters":{},"binds":[],"configuredReportings":[],"meta":{}},"12":{"profId":49246,"epId":12,"devId":5,"inClusterList":[],"outClusterList":[],"clusters":{},"binds":[],"configuredReportings":[],"meta":{}},"13":{"profId":260,"epId":13,"devId":5,"inClusterList":[25],"outClusterList":[],"clusters":{},"binds":[],"configuredReportings":[],"meta":{}},"47":{"profId":260,"epId":47,"devId":5,"inClusterList":[],"outClusterList":[],"clusters":{},"binds":[],"configuredReportings":[],"meta":{}},"110":{"profId":260,"epId":110,"devId":5,"inClusterList":[],"outClusterList":[],"clusters":{},"binds":[],"configuredReportings":[],"meta":{}},"242":{"profId":41440,"epId":242,"devId":5,"inClusterList":[],"outClusterList":[],"clusters":{},"binds":[],"configuredReportings":[],"meta":{}}},"interviewCompleted":true,"meta":{}}
{"id":3,"type":"Router","ieeeAddr":"0x001fee0000006e19","nwkAddr":7227,"manufId":4338,"manufName":"ubisys","powerSource":"Mains (single phase)","modelId":"S1 (5501)","epList":[1,2,3,232,242],"endpoints":{"1":{"profId":260,"epId":1,"devId":266,"inClusterList":[0,3,4,5,6],"outClusterList":[],"clusters":{"genBasic":{"attributes":{"modelId":"S1 (5501)","manufacturerName":"ubisys","powerSource":1,"zclVersion":8,"appVersion":1,"stackVersion":1,"hwVersion":6,"dateCode":"20200527-DE-FB1","swBuildId":"2.4.0"}},"genOnOff":{"attributes":{"onOff":0,"startUpOnOff":255}}},"binds":[],"configuredReportings":[],"meta":{}},"2":{"profId":260,"epId":2,"devId":260,"inClusterList":[0,3],"outClusterList":[3,5,6,8,768,64514],"clusters":{},"binds":[],"configuredReportings":[],"meta":{}},"3":{"profId":260,"epId":3,"devId":1281,"inClusterList":[0,1794,2820],"outClusterList":[],"clusters":{"seMetering":{"attributes":{"multiplier":1,"divisor":1000,"instantaneousDemand":0,"currentSummDelivered":0}}},"binds":[],"configuredReportings":[],"meta":{}},"232":{"profId":260,"epId":232,"devId":1287,"inClusterList":[0,64512],"outClusterList":[3,25],"clusters":{},"binds":[],"configuredReportings":[],"meta":{}},"242":{"profId":41440,"epId":242,"devId":102,"inClusterList":[33],"outClusterList":[33],"clusters":{},"binds":[],"configuredReportings":[],"meta":{}}},"appVersion":1,"stackVersion":1,"hwVersion":6,"dateCode":"20200527-DE-FB1","swBuildId":"2.4.0","zclVersion":8,"interviewCompleted":true,"meta":{"configured":332242049},"lastSeen":1737145803334}

The entire database, this is my dev network so only 1 device at the moment.

Edit: I also tried with the endpoint function commented as it doesn't seem needed/useful for modernExtend and the result is the same. I though maybe it was causing some issues somewhere but guess not.

Edit: I'm not sure the function on L51 is called?

diff --git a/src/lib/modernExtend.ts b/src/lib/modernExtend.ts
index 17dc0dc5..979e103d 100644
--- a/src/lib/modernExtend.ts
+++ b/src/lib/modernExtend.ts
@@ -49,6 +49,7 @@ import {
 } from './utils';

 function getEndpointsWithCluster(device: Zh.Device, cluster: string | number, type: 'input' | 'output') {
+    console.log(`XXX: entered getEndpointsWithCluster (cluster=${cluster} type=${type})`);
     if (!device.endpoints) {
         throw new Error(device.ieeeAddr + ' ' + device.endpoints);
     }
@@ -59,6 +60,7 @@ function getEndpointsWithCluster(device: Zh.Device, cluster: string | number, ty
     if (endpoints.length === 0) {
         throw new Error(`Device ${device.ieeeAddr} has no ${type} cluster ${cluster}`);
     }
+    console.log(`XXX: returning getEndpointsWithCluster (endpoints=${JSON.stringify(endpoints)})`);
     return endpoints;
 }

Nothing is printed.

Edit2:
Have to be up early tomorrow, will head to bed now but I should have some time tomorrow evening/afternoon to poke this some more.

@sjorge sjorge force-pushed the ubisyss1rs2 branch 3 times, most recently from 3fbd134 to 629cbee Compare January 17, 2025 21:06
@sjorge
Copy link
Contributor Author

sjorge commented Jan 19, 2025

@Koenkk so it seems the modernExtend.electricityMeter uses the older fromZigbee and toZigbee converters and that is why getEndpointsWithCluster is not being called.

I'm not sure what the proper fix here is, I don't think updating them to call getEndpointsWithCluster is going to work. Adding new ones inside electricityMeter seems like a lot of work, also there is a lot of adding/removing going on in there for the returned from/toZigbee property. I'm having a hard time wrapping my head around it.

@Koenkk
Copy link
Owner

Koenkk commented Jan 20, 2025

I'm not sure what the proper fix here is, I don't think updating them to call getEndpointsWithCluster is going to work

Why wouldn't this work? It is only the toZigbee converter so not much risk

@sjorge
Copy link
Contributor Author

sjorge commented Jan 20, 2025

I'm not sure what the proper fix here is, I don't think updating them to call getEndpointsWithCluster is going to work

Why wouldn't this work? It is only the toZigbee converter so not much risk

OK, I’ll give that a go next time I have time.

Ubisys support contacted me that some of their customers had issues using this device with z2m, and passed along some info on what changed.
It seems an attempt was already made to get the series 2 supported but ubisys support verified that on the latest z2m version on HA this was still broken.

Based on the info available we can use hwVersion to differenciate between both models.

Let's start by cleaning up the non working fingerprint copy.
Switch to ubisysPollCurrentSummDelivered for all Ubisys devices and pick correct endpoint for S1-R Series 2.
…oint

Yes we drop the wrapping for enforceEndpoint() but only ubisys was using this, to work around this very problem where the metering stuff was on a different endpoint.
@sjorge sjorge marked this pull request as ready for review January 26, 2025 17:51
@sjorge
Copy link
Contributor Author

sjorge commented Jan 26, 2025

Took me longer than I wanted but I managed to update toZigbee calls used by the modernExtend.

Initially I was making it too complex and just ended up calling determineEndpoint then doing the read on the returned endpoint. Due to calling determineEndpoint I ended up removing the call to utils.enforceEndpoint, this was added to a selection of those toZigbee calls specifically for ubisys devices that have there metering on a different endpoint, I also removed accompanying configuration from the device meta's.

This seemed to work fine for my S1, S2 and J1 I have In use. I did not update the S2 and J1 to use modernExtends as I am sadly pretty busy these days, hopefully I can revisit those later when I am less busy.

From my dev network reading from a S1:

[2025-01-26 18:41:40] info: 	z2m: Zigbee2MQTT started!
[2025-01-26 18:41:47] debug: 	z2m:mqtt: Received MQTT message on 'zigbee2mqtt/0x001fee0000006e19/get' with data '{"power_on_behavior":""}'
[2025-01-26 18:41:47] debug: 	z2m: Publishing get 'get' 'power_on_behavior' to '0x001fee0000006e19'
[2025-01-26 18:41:47] debug: 	zh:controller:endpoint: ZCL command 0x001fee0000006e19/1 genOnOff.read(["startUpOnOff"], {"timeout":10000,"disableResponse":false,"disableRecovery":false,"disableDefaultResponse":true,"direction":0,"reservedBits":0,"writeUndiv":false})
[2025-01-26 18:41:47] debug: 	zh:zstack: sendZclFrameToEndpointInternal 0x001fee0000006e19:7227/1 (0,0,1)
[2025-01-26 18:41:47] debug: 	zh:zstack:znp: --> SREQ: AF - dataRequest - {"dstaddr":7227,"destendpoint":1,"srcendpoint":1,"clusterid":6,"transid":1,"options":0,"radius":30,"len":5,"data":{"type":"Buffer","data":[16,2,0,3,64]}}
[2025-01-26 18:41:47] debug: 	zh:zstack:unpi:writer: --> frame [254,15,36,1,59,28,1,1,6,0,1,0,30,5,16,2,0,3,64,64]
[2025-01-26 18:41:47] debug: 	zh:zstack:unpi:parser: <-- [254,1,100,1,0,100]
[2025-01-26 18:41:47] debug: 	zh:zstack:unpi:parser: --- parseNext [254,1,100,1,0,100]
[2025-01-26 18:41:47] debug: 	zh:zstack:unpi:parser: --> parsed 1 - 3 - 4 - 1 - [0] - 100
[2025-01-26 18:41:47] debug: 	zh:zstack:znp: <-- SRSP: AF - dataRequest - {"status":0}
[2025-01-26 18:41:47] debug: 	zh:zstack:unpi:parser: --- parseNext []
[2025-01-26 18:41:47] debug: 	zh:zstack:unpi:parser: <-- [254,3,68,128,0,1,1,199]
[2025-01-26 18:41:47] debug: 	zh:zstack:unpi:parser: --- parseNext [254,3,68,128,0,1,1,199]
[2025-01-26 18:41:47] debug: 	zh:zstack:unpi:parser: --> parsed 3 - 2 - 4 - 128 - [0,1,1] - 199
[2025-01-26 18:41:47] debug: 	zh:zstack:znp: <-- AREQ: AF - dataConfirm - {"status":0,"endpoint":1,"transid":1}
[2025-01-26 18:41:47] debug: 	zh:zstack:unpi:parser: --- parseNext []
[2025-01-26 18:41:47] debug: 	zh:zstack:unpi:parser: <-- [254,3,69,196,59,28,0,165,254,28,68,129,0,0,6,0,59,28,1,1,0,112,0,52,244,233,0,0,8,24,2,1]
[2025-01-26 18:41:47] debug: 	zh:zstack:unpi:parser: --- parseNext [254,3,69,196,59,28,0,165,254,28,68,129,0,0,6,0,59,28,1,1,0,112,0,52,244,233,0,0,8,24,2,1]
[2025-01-26 18:41:47] debug: 	zh:zstack:unpi:parser: --> parsed 3 - 2 - 5 - 196 - [59,28,0] - 165
[2025-01-26 18:41:47] debug: 	zh:zstack:znp: <-- AREQ: ZDO - srcRtgInd
[2025-01-26 18:41:47] debug: 	zh:zstack:unpi:parser: --- parseNext [254,28,68,129,0,0,6,0,59,28,1,1,0,112,0,52,244,233,0,0,8,24,2,1]
[2025-01-26 18:41:47] debug: 	zh:zstack:unpi:parser: <-- [3,64,0,48,0,59,28,29,251]
[2025-01-26 18:41:47] debug: 	zh:zstack:unpi:parser: --- parseNext [254,28,68,129,0,0,6,0,59,28,1,1,0,112,0,52,244,233,0,0,8,24,2,1,3,64,0,48,0,59,28,29,251]
[2025-01-26 18:41:47] debug: 	zh:zstack:unpi:parser: --> parsed 28 - 2 - 4 - 129 - [0,0,6,0,59,28,1,1,0,112,0,52,244,233,0,0,8,24,2,1,3,64,0,48,0,59,28,29] - 251
[2025-01-26 18:41:47] debug: 	zh:zstack:znp: <-- AREQ: AF - incomingMsg - {"groupid":0,"clusterid":6,"srcaddr":7227,"srcendpoint":1,"dstendpoint":1,"wasbroadcast":0,"linkquality":112,"securityuse":0,"timestamp":15332404,"transseqnumber":0,"len":8,"data":{"type":"Buffer","data":[24,2,1,3,64,0,48,0]}}
[2025-01-26 18:41:47] debug: 	zh:controller: Received payload: clusterID=6, address=7227, groupID=0, endpoint=1, destinationEndpoint=1, wasBroadcast=false, linkQuality=112, frame={"header":{"frameControl":{"frameType":0,"manufacturerSpecific":false,"direction":1,"disableDefaultResponse":true,"reservedBits":0},"transactionSequenceNumber":2,"commandIdentifier":1},"payload":[{"attrId":16387,"status":0,"dataType":48,"attrData":0}],"command":{"ID":1,"name":"readRsp","parameters":[{"name":"attrId","type":33},{"name":"status","type":32},{"name":"dataType","type":32,"conditions":[{"type":"statusEquals","value":0}]},{"name":"attrData","type":1000,"conditions":[{"type":"statusEquals","value":0}]}]}}
[2025-01-26 18:41:47] debug: 	zh:zstack:unpi:parser: --- parseNext []
[2025-01-26 18:41:47] debug: 	z2m: Received Zigbee message from '0x001fee0000006e19', type 'readResponse', cluster 'genOnOff', data '{"startUpOnOff":0}' from endpoint 1 with groupID 0
[2025-01-26 18:41:47] info: 	z2m:mqtt: MQTT publish: topic 'zigbee2mqtt/0x001fee0000006e19', payload '{"energy":0,"linkquality":112,"power":0,"power_on_behavior":"off","power_on_behavior_l1":"off","state":"OFF","update":{"installed_version":37749810,"latest_version":37749810,"state":"idle"}}'
[2025-01-26 18:41:49] debug: 	z2m:mqtt: Received MQTT message on 'zigbee2mqtt/0x001fee0000006e19/get' with data '{"power":""}'
[2025-01-26 18:41:49] debug: 	z2m: Publishing get 'get' 'power' to '0x001fee0000006e19'
[2025-01-26 18:41:49] debug: 	zh:controller:endpoint: ZCL command 0x001fee0000006e19/3 seMetering.read(["instantaneousDemand"], {"timeout":10000,"disableResponse":false,"disableRecovery":false,"disableDefaultResponse":true,"direction":0,"reservedBits":0,"writeUndiv":false})
[2025-01-26 18:41:49] debug: 	zh:zstack: sendZclFrameToEndpointInternal 0x001fee0000006e19:7227/3 (0,0,1)
[2025-01-26 18:41:49] debug: 	zh:zstack:znp: --> SREQ: AF - dataRequest - {"dstaddr":7227,"destendpoint":3,"srcendpoint":1,"clusterid":1794,"transid":2,"options":0,"radius":30,"len":5,"data":{"type":"Buffer","data":[16,3,0,0,4]}}
[2025-01-26 18:41:49] debug: 	zh:zstack:unpi:writer: --> frame [254,15,36,1,59,28,3,1,2,7,2,0,30,5,16,3,0,0,4,4]
[2025-01-26 18:41:49] debug: 	zh:zstack:unpi:parser: <-- [254,1,100,1,0,100]
[2025-01-26 18:41:49] debug: 	zh:zstack:unpi:parser: --- parseNext [254,1,100,1,0,100]
[2025-01-26 18:41:49] debug: 	zh:zstack:unpi:parser: --> parsed 1 - 3 - 4 - 1 - [0] - 100
[2025-01-26 18:41:49] debug: 	zh:zstack:znp: <-- SRSP: AF - dataRequest - {"status":0}
[2025-01-26 18:41:49] debug: 	zh:zstack:unpi:parser: --- parseNext []
[2025-01-26 18:41:49] debug: 	zh:zstack:unpi:parser: <-- [254,3,68,128,0,1,2,196]
[2025-01-26 18:41:49] debug: 	zh:zstack:unpi:parser: --- parseNext [254,3,68,128,0,1,2,196]
[2025-01-26 18:41:49] debug: 	zh:zstack:unpi:parser: --> parsed 3 - 2 - 4 - 128 - [0,1,2] - 196
[2025-01-26 18:41:49] debug: 	zh:zstack:znp: <-- AREQ: AF - dataConfirm - {"status":0,"endpoint":1,"transid":2}
[2025-01-26 18:41:49] debug: 	zh:zstack:unpi:parser: --- parseNext []
[2025-01-26 18:41:49] debug: 	zh:zstack:unpi:parser: <-- [254,3,69,196,59,28,0,165,254,30,68,129,0,0,2,7,59,28,3,1,0,116,0,191,246,235,0,0,10,24,3,1]
[2025-01-26 18:41:49] debug: 	zh:zstack:unpi:parser: --- parseNext [254,3,69,196,59,28,0,165,254,30,68,129,0,0,2,7,59,28,3,1,0,116,0,191,246,235,0,0,10,24,3,1]
[2025-01-26 18:41:49] debug: 	zh:zstack:unpi:parser: --> parsed 3 - 2 - 5 - 196 - [59,28,0] - 165
[2025-01-26 18:41:49] debug: 	zh:zstack:znp: <-- AREQ: ZDO - srcRtgInd
[2025-01-26 18:41:49] debug: 	zh:zstack:unpi:parser: --- parseNext [254,30,68,129,0,0,2,7,59,28,3,1,0,116,0,191,246,235,0,0,10,24,3,1]
[2025-01-26 18:41:49] debug: 	zh:zstack:unpi:parser: <-- [0,4,0,42,0,0,0,59,28,29,41]
[2025-01-26 18:41:49] debug: 	zh:zstack:unpi:parser: --- parseNext [254,30,68,129,0,0,2,7,59,28,3,1,0,116,0,191,246,235,0,0,10,24,3,1,0,4,0,42,0,0,0,59,28,29,41]
[2025-01-26 18:41:49] debug: 	zh:zstack:unpi:parser: --> parsed 30 - 2 - 4 - 129 - [0,0,2,7,59,28,3,1,0,116,0,191,246,235,0,0,10,24,3,1,0,4,0,42,0,0,0,59,28,29] - 41
[2025-01-26 18:41:49] debug: 	zh:zstack:znp: <-- AREQ: AF - incomingMsg - {"groupid":0,"clusterid":1794,"srcaddr":7227,"srcendpoint":3,"dstendpoint":1,"wasbroadcast":0,"linkquality":116,"securityuse":0,"timestamp":15464127,"transseqnumber":0,"len":10,"data":{"type":"Buffer","data":[24,3,1,0,4,0,42,0,0,0]}}
[2025-01-26 18:41:49] debug: 	zh:controller: Received payload: clusterID=1794, address=7227, groupID=0, endpoint=3, destinationEndpoint=1, wasBroadcast=false, linkQuality=116, frame={"header":{"frameControl":{"frameType":0,"manufacturerSpecific":false,"direction":1,"disableDefaultResponse":true,"reservedBits":0},"transactionSequenceNumber":3,"commandIdentifier":1},"payload":[{"attrId":1024,"status":0,"dataType":42,"attrData":0}],"command":{"ID":1,"name":"readRsp","parameters":[{"name":"attrId","type":33},{"name":"status","type":32},{"name":"dataType","type":32,"conditions":[{"type":"statusEquals","value":0}]},{"name":"attrData","type":1000,"conditions":[{"type":"statusEquals","value":0}]}]}}
[2025-01-26 18:41:49] debug: 	zh:zstack:unpi:parser: --- parseNext []
[2025-01-26 18:41:49] debug: 	z2m: Received Zigbee message from '0x001fee0000006e19', type 'readResponse', cluster 'seMetering', data '{"instantaneousDemand":0}' from endpoint 3 with groupID 0
[2025-01-26 18:41:49] info: 	z2m:mqtt: MQTT publish: topic 'zigbee2mqtt/0x001fee0000006e19', payload '{"energy":0,"linkquality":116,"power":0,"power_on_behavior":"off","power_on_behavior_l1":"off","state":"OFF","update":{"installed_version":37749810,"latest_version":37749810,"state":"idle"}}'
[2025-01-26 18:41:50] debug: 	z2m:mqtt: Received MQTT message on 'zigbee2mqtt/0x001fee0000006e19/get' with data '{"energy":""}'
[2025-01-26 18:41:50] debug: 	z2m: Publishing get 'get' 'energy' to '0x001fee0000006e19'
[2025-01-26 18:41:50] debug: 	zh:controller:endpoint: ZCL command 0x001fee0000006e19/3 seMetering.read(["currentSummDelivered"], {"timeout":10000,"disableResponse":false,"disableRecovery":false,"disableDefaultResponse":true,"direction":0,"reservedBits":0,"writeUndiv":false})
[2025-01-26 18:41:50] debug: 	zh:zstack: sendZclFrameToEndpointInternal 0x001fee0000006e19:7227/3 (0,0,1)
[2025-01-26 18:41:50] debug: 	zh:zstack:znp: --> SREQ: AF - dataRequest - {"dstaddr":7227,"destendpoint":3,"srcendpoint":1,"clusterid":1794,"transid":3,"options":0,"radius":30,"len":5,"data":{"type":"Buffer","data":[16,4,0,0,0]}}
[2025-01-26 18:41:50] debug: 	zh:zstack:unpi:writer: --> frame [254,15,36,1,59,28,3,1,2,7,3,0,30,5,16,4,0,0,0,6]
[2025-01-26 18:41:50] debug: 	zh:zstack:unpi:parser: <-- [254,1,100,1,0,100]
[2025-01-26 18:41:50] debug: 	zh:zstack:unpi:parser: --- parseNext [254,1,100,1,0,100]
[2025-01-26 18:41:50] debug: 	zh:zstack:unpi:parser: --> parsed 1 - 3 - 4 - 1 - [0] - 100
[2025-01-26 18:41:50] debug: 	zh:zstack:znp: <-- SRSP: AF - dataRequest - {"status":0}
[2025-01-26 18:41:50] debug: 	zh:zstack:unpi:parser: --- parseNext []
[2025-01-26 18:41:50] debug: 	zh:zstack:unpi:parser: <-- [254,3,68,128,0,1,3,197]
[2025-01-26 18:41:50] debug: 	zh:zstack:unpi:parser: --- parseNext [254,3,68,128,0,1,3,197]
[2025-01-26 18:41:50] debug: 	zh:zstack:unpi:parser: --> parsed 3 - 2 - 4 - 128 - [0,1,3] - 197
[2025-01-26 18:41:50] debug: 	zh:zstack:znp: <-- AREQ: AF - dataConfirm - {"status":0,"endpoint":1,"transid":3}
[2025-01-26 18:41:50] debug: 	zh:zstack:unpi:parser: --- parseNext []
[2025-01-26 18:41:50] debug: 	zh:zstack:unpi:parser: <-- [254,3,69,196,59,28,0,165,254,33,68,129,0,0,2,7,59,28,3,1,0,116,0,116,242,236,0,0,13,24,4,1]
[2025-01-26 18:41:50] debug: 	zh:zstack:unpi:parser: --- parseNext [254,3,69,196,59,28,0,165,254,33,68,129,0,0,2,7,59,28,3,1,0,116,0,116,242,236,0,0,13,24,4,1]
[2025-01-26 18:41:50] debug: 	zh:zstack:unpi:parser: --> parsed 3 - 2 - 5 - 196 - [59,28,0] - 165
[2025-01-26 18:41:50] debug: 	zh:zstack:znp: <-- AREQ: ZDO - srcRtgInd
[2025-01-26 18:41:50] debug: 	zh:zstack:unpi:parser: --- parseNext [254,33,68,129,0,0,2,7,59,28,3,1,0,116,0,116,242,236,0,0,13,24,4,1]
[2025-01-26 18:41:50] debug: 	zh:zstack:unpi:parser: <-- [0,0,0,37,0,0,0,0,0,0,59,28,29,213]
[2025-01-26 18:41:50] debug: 	zh:zstack:unpi:parser: --- parseNext [254,33,68,129,0,0,2,7,59,28,3,1,0,116,0,116,242,236,0,0,13,24,4,1,0,0,0,37,0,0,0,0,0,0,59,28,29,213]
[2025-01-26 18:41:50] debug: 	zh:zstack:unpi:parser: --> parsed 33 - 2 - 4 - 129 - [0,0,2,7,59,28,3,1,0,116,0,116,242,236,0,0,13,24,4,1,0,0,0,37,0,0,0,0,0,0,59,28,29] - 213
[2025-01-26 18:41:50] debug: 	zh:zstack:znp: <-- AREQ: AF - incomingMsg - {"groupid":0,"clusterid":1794,"srcaddr":7227,"srcendpoint":3,"dstendpoint":1,"wasbroadcast":0,"linkquality":116,"securityuse":0,"timestamp":15528564,"transseqnumber":0,"len":13,"data":{"type":"Buffer","data":[24,4,1,0,0,0,37,0,0,0,0,0,0]}}
[2025-01-26 18:41:50] debug: 	zh:controller: Received payload: clusterID=1794, address=7227, groupID=0, endpoint=3, destinationEndpoint=1, wasBroadcast=false, linkQuality=116, frame={"header":{"frameControl":{"frameType":0,"manufacturerSpecific":false,"direction":1,"disableDefaultResponse":true,"reservedBits":0},"transactionSequenceNumber":4,"commandIdentifier":1},"payload":[{"attrId":0,"status":0,"dataType":37,"attrData":0}],"command":{"ID":1,"name":"readRsp","parameters":[{"name":"attrId","type":33},{"name":"status","type":32},{"name":"dataType","type":32,"conditions":[{"type":"statusEquals","value":0}]},{"name":"attrData","type":1000,"conditions":[{"type":"statusEquals","value":0}]}]}}
[2025-01-26 18:41:50] debug: 	zh:zstack:unpi:parser: --- parseNext []
[2025-01-26 18:41:50] debug: 	z2m: Received Zigbee message from '0x001fee0000006e19', type 'readResponse', cluster 'seMetering', data '{"currentSummDelivered":0}' from endpoint 3 with groupID 0
[2025-01-26 18:41:50] info: 	z2m:mqtt: MQTT publish: topic 'zigbee2mqtt/0x001fee0000006e19', payload '{"energy":0,"linkquality":116,"power":0,"power_on_behavior":"off","power_on_behavior_l1":"off","state":"OFF","update":{"installed_version":37749810,"latest_version":37749810,"state":"idle"}}'

Additional tests from my prod network after pushing the change there:

This was an S2, to make sure I didn't break these

[2025-01-26 18:47:20] debug:    z2m: Publishing get 'get' 'power' to 'switch/kitchen/light'
[2025-01-26 18:47:20] debug:    z2m: Received Zigbee message from 'switch/kitchen/light', type 'readResponse', cluster 'seMetering', data '{"instantaneousDemand":1}' from endpoint 5 with groupID 0
[2025-01-26 18:47:21] debug:    z2m: Publishing get 'get' 'energy' to 'switch/kitchen/light'
[2025-01-26 18:47:21] debug:    z2m: Received Zigbee message from 'switch/kitchen/light', type 'readResponse', cluster 'seMetering', data '{"currentSummDelivered":4602}' from endpoint 5 with groupID 0

This was a J1

[2025-01-26 18:48:04] debug:    z2m: Publishing get 'get' 'power' to 'cover/office/window'
[2025-01-26 18:48:04] debug:    z2m: Received Zigbee message from 'cover/office/window', type 'readResponse', cluster 'seMetering', data '{"instantaneousDemand":0}' from endpoint 3 with groupID 0
[2025-01-26 18:48:05] debug:    z2m: Publishing get 'get' 'energy' to 'cover/office/window'
[2025-01-26 18:48:05] debug:    z2m: Received Zigbee message from 'cover/office/window', type 'readResponse', cluster 'seMetering', data '{"currentSummDelivered":252}' from endpoint 3 with groupID 0

@sjorge sjorge marked this pull request as draft January 27, 2025 05:51
@sjorge
Copy link
Contributor Author

sjorge commented Jan 27, 2025

Found 1 issue, will look at it hopefully before next weekend.

{
    "energy": 0.33,
    "energy_3": 0.332,
    "last_seen": "2025-01-27T05:50:16.881Z",
    "linkquality": 163,
    "position": 0,
    "power": 0,
    "power_3": 0,
    "state": "CLOSE",
    "update": {
        "installed_version": 38798407,
        "latest_version": 38798407,
        "state": "idle"
    }
}

Although the right endpoints gets called, it should not have the endpoint name appended to it.

@sjorge sjorge marked this pull request as ready for review January 27, 2025 16:37
@sjorge
Copy link
Contributor Author

sjorge commented Jan 27, 2025

Fixed now, I removed a tiny bit to much in in meta before :|

@sjorge
Copy link
Contributor Author

sjorge commented Jan 27, 2025

Christian (Ubisys) this should be good now for the S1-R Series 2, if you do similar changes for the S1, S2, J1 let me know as there will need to be some smaller tweaks then too.

@Koenkk Koenkk merged commit d8ade3e into Koenkk:master Jan 27, 2025
2 checks passed
@Koenkk
Copy link
Owner

Koenkk commented Jan 27, 2025

Thanks!

@sjorge sjorge deleted the ubisyss1rs2 branch January 27, 2025 19:01
@cmaschke
Copy link

Christian (Ubisys) this should be good now for the S1-R Series 2, if you do similar changes for the S1, S2, J1 let me know as there will need to be some smaller tweaks then too.

Will be done :-)
Thank you very much for working on this.

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

Successfully merging this pull request may close these issues.

4 participants