Zigbee binding

Probably you have a mismatch of versions as I think this class was recently removed.

Hi @chris

Good to hear! :slight_smile: . Thanks BTW.

Why do you think it doesnā€™t ? I think it does, as the TransactionManager, when calling queue.getTransaction() in the loop to poll the queues, is passing a new parameter asking for only ā€œfastā€ transactions, and in turn the queue is returning null if this parameter is ā€˜trueā€™ and the next transaction it contains is considered not to be fast.

Unless I coded something wrong, this was the principle I was following (and it is working indeed like this in my network)

Pedro

I think your system will not add any sleepy transactions if the queue size is currently > 5 - is that correct?

This means that if the queue has more than 5 frames, the system will only continue to put non-sleepy frames in the queue - this will slow down frames to sleepy devices, which is also not good, and may cause significant problems with such devices.

Or do I interpret your implementation incorrectly?

Ah, OK, your concern is about the 5: I just used five to make sure I could see the effects, but it is a configurable setting.

Normal setting would be 1, or 2 if we want to account for the possibility of some devices having gone offline. In the end I think this should end up being a teakable parameter, with a reasonable default.

The implementation is independent on the setting for the thresold.

No, I donā€™t care about the number, and obviously I can see that this is configurable. My point is that I donā€™t think it differentiates between sleepy and non-sleepy data, so if the queue fills up with non-sleepy data, and there is a lot of non-sleepy traffic going into the TransactionManager, then I think the implementation would only put non-sleepy frames into the transport queue. This is because it only checks if queue.size > x.

So, if queue.size == 6, then it will not send any sleepy frames, even if there are no sleepy frames in the queue, and it will not send any sleepy frames until the size drops back below 5. It will instead keep the queue full of non-sleepy frames - effectively delaying sleepy frames.

Ah, I see. I was only considering the queue filling up with slow transactions impacting the fast ones, but I see your point. I had not considererd the opposite case because fast transactions areā€¦ fast, but you are right :slight_smile:

There needs to be something like a counter of slow transactions already on air, and request ā€œfastOnlyā€ transactions to the queue if ā€œongoingSlowTransactions >= maxOutstandingTransactions - reservedFastTransactionsā€.

Would it make sense?

Pedro

Yes, and most of the time your implementation probably works just fine, but if there was a lot of traffic, then we could get into the situation where the queue is always above the threshold, so we only ā€œeverā€ send the non-sleepy frames.

Yes, that is effectively what Iā€™ve implemented.

@puzzle-star Iā€™ve pushed an update with the sleepy queue handling - please feel free to test itā€¦ Iā€™ve only tested it with static test cases as Iā€™m away from home at the moment.

Let me know how it looks :wink:

Hi @chris,

I will check this afternoon. Just a couple of comments (first sight):

  • I think you have not updated telegesis response timeout to 3s (will check how it goes)
  • The first time a device is discovered, it may be considered always sleepy, till the next restart, as at the moment of creating the queue maccapabilities are unknown. That is why in my implementation I checked everytime (not efficient).

Regarding this latter one, probably we would need:

  • queue.isSleepy() return Boolean (default null)
  • If it returns null, check if the device has already reported the node descriptor:
    • If it does not, do we consider it for this transaction sleepy or not?
    • If it does, we call setSleepy and act accordingly

Does it make sense?

Pedro

Yes, I did this. It was done in a separate PR for visibility -:

Good point - letā€™s see how it goes and get can take another look at this.

Quick question: does zigbee support unpairing? Or do I just delete the unwanted thing from the OH UI and hard reset the device?

Yes, you can remove a device from the network, but you can also just delete it and reset it. Thereā€™s no persistent information held in the coordinator - unlike ZWave.

@puzzle-star Iā€™ve pushed an update that should now account for the change to the device type. Again, Iā€™ve not had the chance to test this until I get home at the weekend, but if you get the chance, I welcome any feedback :slight_smile:

Iā€™ve created an updated snapshot 1.1.11-SNAPSHOT which includes the latest changes to the transaction manager if anyone fancies giving it a tryā€¦

1 Like

I would just need to use the transaction queue branch to get this ? Also curious where we were landing with the whole channel definition thing - I noticed the conversation kindof halted on github.

If you use @5ivers magic download script, then you should just need to specify the version as above and you should get the latest version I compiled earlier.

Was that the the issue about color mode, and UNDEF states etc?

Just an FYIā€¦ the latest version is populated for you as the default, based on the option that was selected (this one being the Zigbee library snapshot).

I just grabbed the latest.

1 Like

Yeah. Going to undef for color or ct when in the opposite mode can work - though you then lose visibility to the current brightness if you are in CT mode - if we added a brightness channel back it would allow us to see everything as the undef would tell you if the bulb was color or ct. The only drawback of that approach is that you wouldnā€™t be able to switch the bulb back to the previous color state when it was in ct mode - unless sending an undef to ct would cause it to flip back to previous state?

Hi @chris,

I am testing now. But at first sight, is it possible that we need this, to prevent the sleepyTransactions counter from getting out of sync if there are transactions in flight when the node is updated and we change the queue type?

/* Removed code as it has synchronization issues */
/* Will update as soon as I test the new approach */

Pedro

Yes, good point. Iā€™d tried to avoid having to reset this counter, but youā€™re right, this can probably get out of sync if the queue type changes.

I will try and look at this this afternoon, but Iā€™m travelling homeward again so not sure if Iā€™ll have time today.