How often you should read an attribute from Zigbee device?

Thanks a lot @kkossev .

Here is the detail from GetInfo

Get Info

dev:152022-08-14 10:23:53.779 pm info fingerprint profileId:"0104", endpointId:"01", inClusters:"0000,0003,0406", outClusters:"0003", model:"OCP305", manufacturer:"OWON"
dev:152022-08-14 10:23:53.643 pm trace ZCL version:03
dev:152022-08-14 10:23:53.607 pm trace Software Build Id:unknown
dev:152022-08-14 10:23:53.605 pm trace Model:OCP305
dev:152022-08-14 10:23:53.602 pm trace Manufacturer:OWON
dev:152022-08-14 10:23:53.424 pm debug getting info for unknown Zigbee device...

Here are the logs after the power cycle.

Logs after power

dev:152022-08-14 10:29:31.414 pm info reporting configuration for Power Configuration (cluster 0x0001), attribute 0x0021 failed, unsupported attribute
dev:152022-08-14 10:29:31.411 pm debug descMap:[raw:catchall: 0104 0001 01 01 0040 00 FC7C 00 00 0000 07 01 86002100, profileId:0104, clusterId:0001, clusterInt:1, sourceEndpoint:01, destinationEndpoint:01, options:0040, messageType:00, dni:FC7C, isClusterSpecific:false, isManufacturerSpecific:false, manufacturerId:0000, command:07, direction:01, data:[86, 00, 21, 00]]
dev:152022-08-14 10:29:30.615 pm info skipped:[raw:catchall: 0000 8021 00 00 0040 00 FC7C 00 00 0000 00 00 688D, profileId:0000, clusterId:8021, clusterInt:32801, sourceEndpoint:00, destinationEndpoint:00, options:0040, messageType:00, dni:FC7C, isClusterSpecific:false, isManufacturerSpecific:false, manufacturerId:0000, command:00, direction:00, data:[68, 8D]]
dev:152022-08-14 10:29:30.613 pm debug descMap:[raw:catchall: 0000 8021 00 00 0040 00 FC7C 00 00 0000 00 00 688D, profileId:0000, clusterId:8021, clusterInt:32801, sourceEndpoint:00, destinationEndpoint:00, options:0040, messageType:00, dni:FC7C, isClusterSpecific:false, isManufacturerSpecific:false, manufacturerId:0000, command:00, direction:00, data:[68, 8D]]
dev:152022-08-14 10:29:29.809 pm info reporting configuration for Temperature Measurement (cluster 0x0402), attribute 0x0000 failed, unsupported attribute
dev:152022-08-14 10:29:29.805 pm debug descMap:[raw:catchall: 0104 0402 01 01 0040 00 FC7C 00 00 0000 07 01 86000000, profileId:0104, clusterId:0402, clusterInt:1026, sourceEndpoint:01, destinationEndpoint:01, options:0040, messageType:00, dni:FC7C, isClusterSpecific:false, isManufacturerSpecific:false, manufacturerId:0000, command:07, direction:01, data:[86, 00, 00, 00]]
dev:152022-08-14 10:29:29.004 pm info skipped:[raw:catchall: 0000 8021 00 00 0040 00 FC7C 00 00 0000 00 00 668D, profileId:0000, clusterId:8021, clusterInt:32801, sourceEndpoint:00, destinationEndpoint:00, options:0040, messageType:00, dni:FC7C, isClusterSpecific:false, isManufacturerSpecific:false, manufacturerId:0000, command:00, direction:00, data:[66, 8D]]
dev:152022-08-14 10:29:29.001 pm debug descMap:[raw:catchall: 0000 8021 00 00 0040 00 FC7C 00 00 0000 00 00 668D, profileId:0000, clusterId:8021, clusterInt:32801, sourceEndpoint:00, destinationEndpoint:00, options:0040, messageType:00, dni:FC7C, isClusterSpecific:false, isManufacturerSpecific:false, manufacturerId:0000, command:00, direction:00, data:[66, 8D]]
dev:152022-08-14 10:29:28.203 pm info reporting configuration for Illuminance Measurement (cluster 0x0400), attribute 0x0000 failed, unsupported attribute
dev:152022-08-14 10:29:28.200 pm debug descMap:[raw:catchall: 0104 0400 01 01 0040 00 FC7C 00 00 0000 07 01 86000000, profileId:0104, clusterId:0400, clusterInt:1024, sourceEndpoint:01, destinationEndpoint:01, options:0040, messageType:00, dni:FC7C, isClusterSpecific:false, isManufacturerSpecific:false, manufacturerId:0000, command:07, direction:01, data:[86, 00, 00, 00]]
dev:152022-08-14 10:29:27.398 pm info skipped:[raw:catchall: 0000 8021 00 00 0040 00 FC7C 00 00 0000 00 00 648D, profileId:0000, clusterId:8021, clusterInt:32801, sourceEndpoint:00, destinationEndpoint:00, options:0040, messageType:00, dni:FC7C, isClusterSpecific:false, isManufacturerSpecific:false, manufacturerId:0000, command:00, direction:00, data:[64, 8D]]
dev:152022-08-14 10:29:27.395 pm debug descMap:[raw:catchall: 0000 8021 00 00 0040 00 FC7C 00 00 0000 00 00 648D, profileId:0000, clusterId:8021, clusterInt:32801, sourceEndpoint:00, destinationEndpoint:00, options:0040, messageType:00, dni:FC7C, isClusterSpecific:false, isManufacturerSpecific:false, manufacturerId:0000, command:00, direction:00, data:[64, 8D]]
dev:152022-08-14 10:29:26.592 pm debug skipped:[raw:catchall: 0104 0406 01 01 0040 00 FC7C 00 01 100B 01 01 300086, profileId:0104, clusterId:0406, clusterInt:1030, sourceEndpoint:01, destinationEndpoint:01, options:0040, messageType:00, dni:FC7C, isClusterSpecific:false, isManufacturerSpecific:true, manufacturerId:100B, command:01, direction:01, data:[30, 00, 86]]
dev:152022-08-14 10:29:26.589 pm debug descMap:[raw:catchall: 0104 0406 01 01 0040 00 FC7C 00 01 100B 01 01 300086, profileId:0104, clusterId:0406, clusterInt:1030, sourceEndpoint:01, destinationEndpoint:01, options:0040, messageType:00, dni:FC7C, isClusterSpecific:false, isManufacturerSpecific:true, manufacturerId:100B, command:01, direction:01, data:[30, 00, 86]]
dev:152022-08-14 10:29:26.359 pm info Master bathroom occupancy is active
dev:152022-08-14 10:29:26.357 pm debug descMap:[raw:FC7C0104060800001801, dni:FC7C, endpoint:01, cluster:0406, size:08, attrId:0000, encoding:18, command:0A, value:01, clusterInt:1030, attrInt:0]
dev:152022-08-14 10:29:25.784 pm debug descMap:[raw:catchall: 0104 0406 01 01 0040 00 FC7C 00 01 100B 04 01 863000, profileId:0104, clusterId:0406, clusterInt:1030, sourceEndpoint:01, destinationEndpoint:01, options:0040, messageType:00, dni:FC7C, isClusterSpecific:false, isManufacturerSpecific:true, manufacturerId:100B, command:04, direction:01, data:[86, 30, 00]]
dev:152022-08-14 10:29:24.992 pm info reporting configuration for Occupancy Sensing (cluster 0x0406) succeeded
dev:152022-08-14 10:29:24.981 pm debug descMap:[raw:catchall: 0104 0406 01 01 0040 00 FC7C 00 00 0000 07 01 00, profileId:0104, clusterId:0406, clusterInt:1030, sourceEndpoint:01, destinationEndpoint:01, options:0040, messageType:00, dni:FC7C, isClusterSpecific:false, isManufacturerSpecific:false, manufacturerId:0000, command:07, direction:01, data:[00]]
dev:152022-08-14 10:29:24.167 pm info skipped:[raw:catchall: 0000 8021 00 00 0040 00 FC7C 00 00 0000 00 00 6000, profileId:0000, clusterId:8021, clusterInt:32801, sourceEndpoint:00, destinationEndpoint:00, options:0040, messageType:00, dni:FC7C, isClusterSpecific:false, isManufacturerSpecific:false, manufacturerId:0000, command:00, direction:00, data:[60, 00]]
dev:152022-08-14 10:29:24.164 pm debug descMap:[raw:catchall: 0000 8021 00 00 0040 00 FC7C 00 00 0000 00 00 6000, profileId:0000, clusterId:8021, clusterInt:32801, sourceEndpoint:00, destinationEndpoint:00, options:0040, messageType:00, dni:FC7C, isClusterSpecific:false, isManufacturerSpecific:false, manufacturerId:0000, command:00, direction:00, data:[60, 00]]
dev:152022-08-14 10:29:23.360 pm debug skipped:[raw:catchall: 0104 0406 01 01 0040 00 FC7C 00 00 0000 01 01 100086, profileId:0104, clusterId:0406, clusterInt:1030, sourceEndpoint:01, destinationEndpoint:01, options:0040, messageType:00, dni:FC7C, isClusterSpecific:false, isManufacturerSpecific:false, manufacturerId:0000, command:01, direction:01, data:[10, 00, 86]]
dev:152022-08-14 10:29:23.356 pm debug descMap:[raw:catchall: 0104 0406 01 01 0040 00 FC7C 00 00 0000 01 01 100086, profileId:0104, clusterId:0406, clusterInt:1030, sourceEndpoint:01, destinationEndpoint:01, options:0040, messageType:00, dni:FC7C, isClusterSpecific:false, isManufacturerSpecific:false, manufacturerId:0000, command:01, direction:01, data:[10, 00, 86]]
dev:152022-08-14 10:29:22.557 pm debug descMap:[raw:catchall: 0104 0406 01 01 0040 00 FC7C 00 00 0000 04 01 861000, profileId:0104, clusterId:0406, clusterInt:1030, sourceEndpoint:01, destinationEndpoint:01, options:0040, messageType:00, dni:FC7C, isClusterSpecific:false, isManufacturerSpecific:false, manufacturerId:0000, command:04, direction:01, data:[86, 10, 00]]
dev:152022-08-14 10:29:22.394 pm warn description logging is: true
dev:152022-08-14 10:29:22.393 pm warn debug logging is: true
dev:152022-08-14 10:29:22.392 pm info updated...

1 Like

Here is where the inaccurate status of inactive is reported.

Logs

dev:152022-08-14 10:37:30.076 pm info Master bathroom occupancy is active
dev:152022-08-14 10:37:30.073 pm debugdescMap:[raw:FC7C0104060800001801, dni:FC7C, endpoint:01, cluster:0406, size:08, attrId:0000, encoding:18, command:0A, value:01, clusterInt:1030, attrInt:0]
dev:152022-08-14 10:37:21.876 pm info Master bathroom occupancy is inactive
dev:152022-08-14 10:37:21.874 pm debugdescMap:[raw:FC7C0104060800001881, dni:FC7C, endpoint:01, cluster:0406, size:08, attrId:0000, encoding:18, command:0A, value:81, clusterInt:1030, attrInt:0]
dev:152022-08-14 10:37:13.733 pm info Master bathroom occupancy is active
dev:152022-08-14 10:37:13.731 pm debugdescMap:[raw:FC7C0104060800001801, dni:FC7C, endpoint:01, cluster:0406, size:08, attrId:0000, encoding:18, command:0A, value:01, clusterInt:1030, attrInt:0]
dev:152022-08-14 10:36:49.152 pm info Master bathroom occupancy is inactive
dev:152022-08-14 10:36:49.150 pm debugdescMap:[raw:FC7C0104060800001881, dni:FC7C, endpoint:01, cluster:0406, size:08, attrId:0000, encoding:18, command:0A, value:81, clusterInt:1030, attrInt:0]
dev:152022-08-14 10:34:29.717 pm info Master bathroom occupancy is active
dev:152022-08-14 10:34:29.715 pm debugdescMap:[raw:FC7C0104060800001801, dni:FC7C, endpoint:01, cluster:0406, size:08, attrId:0000, encoding:18, command:0A, value:01, clusterInt:1030, attrInt:0]
dev:152022-08-14 10:31:46.894 pm info Master bathroom occupancy is inactive
dev:152022-08-14 10:31:46.892 pm debugdescMap:[raw:FC7C0104060800001800, dni:FC7C, endpoint:01, cluster:0406, size:08, attrId:0000, encoding:18, command:0A, value:00, clusterInt:1030, attrInt:0]

Value 81 for attribute id 000 is reported as inactive. Active is 1, and Inactive is 0. I'll ask the developers to find out what 81 means.

1 Like

The return value of 0x0406, attribute 0000 is a bitmap, with only bit 0 being used, the other bits are documented as "reserved". For whatever reason, they've also set the high bit (0x80). The driver should be masking off the low bit only and using that to determine active (set) or inactive (clear), ignoring other bits, not just doing a direct comparison.

2 Likes

I'm using the inbuild Hue Motion sensor for this. Not sure if 81 means something for a motion sensor and this is an occupancy sensor.

Thank you for your help.

1 Like

And if you're writing the driver yourself, just do a simple mask operation with the value of the 0x0000 attribute.

Something like:

def attrValue = /* Get the attribute value from the decoded message */
bool isActive = (attrValue & 0x01) != 0
1 Like

Hue OWON likely customized 0x0406/0x0000 for their own needs with their hub or some other customer. Its against the spec though, since all other flags other than bit 0 are reserved.

That being said, the built in driver should be updated to do the masking.

I'm fine with coding. However, I cannot find enough materials to start a driver from scratch. Is there something you can recommend online that I can use to do so?

Here is what the developer said.

You need to parse 0x81 to 1000 0001(B), then refer to this table

bit0 = 1 occupied

bit 7 =1 static

So there was a person detected, but keep static

Not sure what 'static' would mean. Maybe its that there's occupancy but no recent motion? Regardless as far as I can tell, its not to Zigbee 3.0 spec.

@user1922 can you make a quick test with the driver from this link?
This driver is for Tuya devices (including 5-6 different types of Tuya mmWave radars), but I added the OWON radar fingerprint and cluster 0x406 processing as well.

Please let me know if the occupancy (motion) works. It should also show temperature and illuminance (lux).

2 Likes

Most probably yes. The mmWave radars are capable of distinguishing between active motion and standing still.

I'll try this tomorrow. I was reading up on zdo binding and global reporting. I did see your driver earlier and did add OWON fingerprint to that one to test it. However, i might have messed up something.

Anyways everyone is sleeping here and i dont want them to wake up and think there is a burgler at home. I'll report back how it goes tomorrow.

1 Like

Cluster 0x0406 was not processed in the previous versions. I have added a few lines of code ( 315..318 ) today.

Usually, there is no need to explicitly bind the device Zigbee clusters using 'zdo bind' commands, this is already done by the HE hub during the initial discovering/pairing procedure.

2 Likes

Thank you so much. It is working now. You are th man!! Now I'm going to reas your code and find out what is going on in there.

Thanks again.

1 Like

If you leave the OWON radar working with the above driver for a day, what does the 'rxCounter' show?

rxCounter counts the number of the Zigbee messages received by the device since the time when the device was paired to HE or Initialize button was pressed.
The screenshot below is from the awfully designed Tuya black square mmWave radar, which I am going to switch off and put on sale very soon. It has sent nearly 100,000 Zigbee packets to HE for about a week now (my C7 survived! )
image

2 Likes

Actually, you can obtain this information also from the Logs->Device Stats-> Sort by 'Count' :

352 so far. I think that a day or two's count.

Wow, i was looking at the Heiman sensor as well which can use AC and is a ceiling mount. Are you telling me not to think about it :rofl::rofl:

Thanks, the OWON device looks quiet!

Which Heiman sensor do you mean?

I cannot find a link i can share. I'm building a house and was talking the Heiman sales person. She said the model number is HS1OS-EFA.

I'm planning to get a bulk order of OWON.