You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am developing a component for integrating Xiaomi Gateway 3 and understood how sequence id (start_id and _id) works.
I think the problem does not concern only Gateway, but applies to all devices with the miio protocol.
If the device receives the same sequence id in a short time, it will not respond to the request. Device remembers the last few sequence id and therefore increasing the value by 100 does not fix problem. Setting start_id = 1000 or any other value will not help either. 1000, 1100, 1200... Chances are very high that the numbers are repeated. It happens when Home Assistant restarts frequently.
The mobile application (Mi Home) also maintains its own counter from 0 and they overlap each other. As a result, both the mobile application and the Home Assistant component are freezes.
There are two ways out:
Bind start_id to time. For example, the number of seconds from the beginning of the hour. But then the two versions of the component can interfere with each other.
Add random to the start value. And random when an error occurs. At the same time, increase the maximum sequence to a million from 9999. The Gateway is doing fine. I do not know how other devices will behave.
I chose the second option. The code can be viewed here.
The text was updated successfully, but these errors were encountered:
I´m using the Xiaomi Mi Robot Mop Pro which behaves not stable when I send commands via cli.
Takes ages that commands are executed. Sometimes its fast.
Could be the same cause you try to fix.
I think the problem does not concern only Gateway, but applies to all devices with the miio protocol.
How can I try to use this fix for "viomivacuum" type?
I am developing a component for integrating Xiaomi Gateway 3 and understood how sequence id (
start_id
and_id
) works.I think the problem does not concern only Gateway, but applies to all devices with the miio protocol.
If the device receives the same sequence id in a short time, it will not respond to the request. Device remembers the last few sequence id and therefore increasing the value by 100 does not fix problem. Setting start_id = 1000 or any other value will not help either. 1000, 1100, 1200... Chances are very high that the numbers are repeated. It happens when Home Assistant restarts frequently.
The mobile application (Mi Home) also maintains its own counter from 0 and they overlap each other. As a result, both the mobile application and the Home Assistant component are freezes.
There are two ways out:
Bind start_id to time. For example, the number of seconds from the beginning of the hour. But then the two versions of the component can interfere with each other.
Add random to the start value. And random when an error occurs. At the same time, increase the maximum sequence to a million from 9999. The Gateway is doing fine. I do not know how other devices will behave.
I chose the second option. The code can be viewed here.
The text was updated successfully, but these errors were encountered: