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

Draft
wants to merge 4 commits into
base: master
Choose a base branch
from
Draft

Ubisys S1-R (Series 2) #8627

wants to merge 4 commits into from

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/[email protected]/node_modules/zigbee-herdsman/src/utils/waitress.ts:59:23)
    at ZStackAdapter.sendZclFrameToEndpointInternal (/Users/sjorge/Documents/repos/zigbee2mqtt/node_modules/.pnpm/[email protected]/node_modules/zigbee-herdsman/src/adapter/z-stack/adapter/zStackAdapter.ts:663:47)
    at ZStackAdapter.sendZclFrameToEndpointInternal (/Users/sjorge/Documents/repos/zigbee2mqtt/node_modules/.pnpm/[email protected]/node_modules/zigbee-herdsman/src/adapter/z-stack/adapter/zStackAdapter.ts:695:28)
    at /Users/sjorge/Documents/repos/zigbee2mqtt/node_modules/.pnpm/[email protected]/node_modules/zigbee-herdsman/src/adapter/z-stack/adapter/zStackAdapter.ts:443:20
    at Queue.execute (/Users/sjorge/Documents/repos/zigbee2mqtt/node_modules/.pnpm/[email protected]/node_modules/zigbee-herdsman/src/utils/queue.ts:36:20)
    at ZStackAdapter.sendZclFrameToEndpoint (/Users/sjorge/Documents/repos/zigbee2mqtt/node_modules/.pnpm/[email protected]/node_modules/zigbee-herdsman/src/adapter/z-stack/adapter/zStackAdapter.ts:441:16)
    at Request.send (/Users/sjorge/Documents/repos/zigbee2mqtt/node_modules/.pnpm/[email protected]/node_modules/zigbee-herdsman/src/controller/helpers/request.ts:82:20)
    at Endpoint.sendRequest (/Users/sjorge/Documents/repos/zigbee2mqtt/node_modules/.pnpm/[email protected]/node_modules/zigbee-herdsman/src/controller/model/endpoint.ts:324:20)
    at Endpoint.zclCommand (/Users/sjorge/Documents/repos/zigbee2mqtt/node_modules/.pnpm/[email protected]/node_modules/zigbee-herdsman/src/controller/model/endpoint.ts:949:28)
    at Endpoint.read (/Users/sjorge/Documents/repos/zigbee2mqtt/node_modules/.pnpm/[email protected]/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/[email protected]/node_modules/zigbee-herdsman/src/utils/waitress.ts:59:23)
    at ZStackAdapter.sendZclFrameToEndpointInternal (/Users/sjorge/Documents/repos/zigbee2mqtt/node_modules/.pnpm/[email protected]/node_modules/zigbee-herdsman/src/adapter/z-stack/adapter/zStackAdapter.ts:663:47)
    at ZStackAdapter.sendZclFrameToEndpointInternal (/Users/sjorge/Documents/repos/zigbee2mqtt/node_modules/.pnpm/[email protected]/node_modules/zigbee-herdsman/src/adapter/z-stack/adapter/zStackAdapter.ts:695:28)
    at /Users/sjorge/Documents/repos/zigbee2mqtt/node_modules/.pnpm/[email protected]/node_modules/zigbee-herdsman/src/adapter/z-stack/adapter/zStackAdapter.ts:443:20
    at Queue.execute (/Users/sjorge/Documents/repos/zigbee2mqtt/node_modules/.pnpm/[email protected]/node_modules/zigbee-herdsman/src/utils/queue.ts:36:20)
    at ZStackAdapter.sendZclFrameToEndpoint (/Users/sjorge/Documents/repos/zigbee2mqtt/node_modules/.pnpm/[email protected]/node_modules/zigbee-herdsman/src/adapter/z-stack/adapter/zStackAdapter.ts:441:16)
    at Request.send (/Users/sjorge/Documents/repos/zigbee2mqtt/node_modules/.pnpm/[email protected]/node_modules/zigbee-herdsman/src/controller/helpers/request.ts:82:20)
    at Endpoint.sendRequest (/Users/sjorge/Documents/repos/zigbee2mqtt/node_modules/.pnpm/[email protected]/node_modules/zigbee-herdsman/src/controller/model/endpoint.ts:324:20)
    at Endpoint.zclCommand (/Users/sjorge/Documents/repos/zigbee2mqtt/node_modules/.pnpm/[email protected]/node_modules/zigbee-herdsman/src/controller/model/endpoint.ts:949:28)
    at Endpoint.read (/Users/sjorge/Documents/repos/zigbee2mqtt/node_modules/.pnpm/[email protected]/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.

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.
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.

2 participants