-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
SA-003 Sending reports to the broadcast endpoint #2565
Comments
I think the only way to do this easily is to debounce on the transaction number (https://github.com/Koenkk/zigbee-herdsman/blob/master/src/controller/controller.ts#L501) |
Something like this? https://github.com/chriskemp/zigbee-herdsman/commit/464b01937af139bbff679b410439dc6becda2323 Are you ok with the meta data being used in this way or would you prefer a new device property? |
I think we can achieve this easier, can you try the changes from: Koenkk/zigbee-herdsman-converters@82202e0 |
Apart from the bug Koenkk/zigbee-herdsman-converters@82202e0#r36902229 this stops the multiple updates going out on MQTT but it doesn't stop the multiple "default responses" going out on zigbee, presumably since that has already been sent by the time the message gets to the converter? Obviously that's an improvement, but it'd be nice to keep the on-air traffic down as I was hoping to have quite a bunch of the devices. |
* Debounce SA-003-Zigbee on zclTransactionSequenceNumber. Koenkk/zigbee2mqtt#2565 * Update fromZigbee.js
Reading the ZCL specification I found the following: No default response to non-unicast message Can you try adding a check to see if the endpoint != 255 (https://github.com/Koenkk/zigbee-herdsman/blob/master/src/controller/controller.ts#L536) |
I started trying to do this, but (partly as in my original message) I don't think that zigbee-herdsman knows that it was sent to the 0xff endpoint. I've enabled more debug logging and I get:
...note that the incoming AREQ from z-stack has the dstendpoint set to the particular endpoint and the wasbroadcast flag isn't set, so I'm out of ideas how to tell! Any ideas? |
Just had a look at z-stack and I believe that this is the code that "hides" the broadcast endpoint from us: Components\stack\af\AF.c (line 423 ish):
This code seems to be the same in z-stack 3.0.2. |
yes that indeed seems to cause the issue. Can you try commenting I've also checked the |
I haven't tried compiling / flashing the z-stack code yet. I'll have a go! I guess the "perfect" solution is to set the wasbroadcast flag (or add a wasbroadcastendpoint) in z-stack and then handle it in herdsman...although it does seem rather an overkill! |
Hmm, sorry, I hadn't realised you had to get a 30 day licence to compile the z-stack code. I don't really want to do that right now as I might want it for something more useful another time! How about: https://github.com/chriskemp/zigbee-herdsman-converters/commit/3722b85cdc4938f3da0f32ed4a5aff2f521eddd1 ?? It doesn't solve the broadcast endpoint for any other devices but it seems a simple / tidy enough fix for now? |
Although this is a bit "hacky" I think its fine as it only affects this device and is in a device specific part. Can you make the PR's? Then I will merge them. |
…943) * Debounce SA-003-Zigbee on zclTransactionSequenceNumber. Koenkk/zigbee2mqtt#2565 * Update fromZigbee.js * The SA-003 always sends attributeReports to the broadcast endpoint. We shouldn't send a default response in this case, but Z-Stack doesn't tell us, so we just always set disableDefaultResponse for SA-003 attributeReports. * Update fromZigbee.js * Update fromZigbee.js Co-authored-by: Koen Kanters <koenkanters94@gmail.com>
Merged, thanks! |
I've got a couple of ewelink SA-003 on/off switches. They don't seem to respond to any attempts to configure reporting but instead seem to regulary send a report to the broadcast endpoint (255).
As far as I can tell they do this straight after a reset, and before any configuring has taken place, so I'm not sure there's much that can be done to configure them properly.
The wireshark log shows:
Note that it is sending it to endpoint 255.
The problem is that the CC2531 (or z-stack) then sends this same packet to four endpoints in the controller and so zigbee-herdsman responds with 4 generic responses (as per wireshark above) and zigbee2mqtt receives 4 identical messages:
debug 2019-12-18 01:00:53: Received Zigbee message from 'OnOff1', type 'attributeReport', cluster 'genOnOff', data '{"onOff":0}' from endpoint 1 with groupID 0
debug 2019-12-18 01:00:53: Received Zigbee message from 'OnOff1', type 'attributeReport', cluster 'genOnOff', data '{"onOff":0}' from endpoint 1 with groupID 0
debug 2019-12-18 01:00:53: Received Zigbee message from 'OnOff1', type 'attributeReport', cluster 'genOnOff', data '{"onOff":0}' from endpoint 1 with groupID 0
debug 2019-12-18 01:00:53: Received Zigbee message from 'OnOff1', type 'attributeReport', cluster 'genOnOff', data '{"onOff":0}' from endpoint 1 with groupID 0
Obviously none of this is a major issue, but it does seem unclean. Has anyone any suggestions on a "proper" way to deal with this? I'll happily then code/test and submit a PR.
If my understanding is correct, ideally (but I don't think it does) z-stack should tell us that a packet was sent to the broadcast endpoint and therefore the low levels shouldn't send a default response. Then each "endpoint handler" should decide whether to be interested / accept the packet.
In practice, at the moment, I don't think the controller code distinguishes much on its endpoint. I think the destination endpoint is lost by the time the report arrives at onZclOrRawData (zigbee-herdsman/src/controller/controller.ts:387). Potentially the destination endpoint can be added to the payload structure at adapter/z-stack/adapter/zStackAdapter.ts:500 and then, as a workaround, onZclOrRawData can use device specific info to not send a response and to only pass on up one of the four.
Any thoughts?
Thanks, Chris
The text was updated successfully, but these errors were encountered: