-
-
Notifications
You must be signed in to change notification settings - Fork 566
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
Moving from custom_components to HA version not working #28
Comments
Same issue for me after upgrading to the HASS component in version 0.49 |
Ok, this is obviously bad. I'm unsure what's the reason for this, but one possibility is the lack of doing a rediscovery now and then (I think I saw miiojs doing it every 120 seconds or so). @jcastro are you still using an older FW? |
Umm nop, I'm on the latest firmware available (just checked for new one just in case) |
Latest firmware and experiencing issue. Tried the changing of the start_id in Device class to random value from 0 to 9999 between commands, to no avail. That did work when running without HA, but with HA, not working. |
I think the problem is time-outing for the long-lived instances (besides some random timeouts now and then), which require a new discovery. For the time being making Device's send() to call enter() for each invocation could be a potential solution. |
So change this:
To this:
|
Its the start_id. I just tested it with enter solution to no avail. But with a random start_id with success. |
So, there are (at least) two separate things which may cause connection failures:
For the first point, randomizing the start_id won't do any good if the chosen ID will be below the previously received one, but will just get it ignored by the robot. Assuming that the ID loops after 9999 (as seen in miiojs), maybe it would make sense to send 9999 as the first ID every single time and start then counting to make sure it works. I have not yet tested this though. To the second point, I modified it locally to do a discovery for every send as I mentioned, and even if it sometimes fails, it seems to recover just fine (running this since yesterday without problems). |
Hi rytilahti, I tried your second point by calling I will test first point, instead of randomizing but rather decrementing from 9999 as you say. |
It's more or less a hack but it is working for some people: |
Same problem here! |
syssi's fix seems to work. I guess capturing the exception and then refiring |
Ok, so the cause is expired discovery/handshake, I'll release a fixed release today and make a PR to homeassistant then. |
I just released 0.1.2 which should finally fix this (by incrementing the message id and retrying on errors), I'll prepare a PR for homeassistant soon enough, but it would be nice if someone could test it before it hits the new release. Changing xiaomi_vacuum.py inside the homeassistant to depend on version 0.1.2 should be enough :-) |
I think you didn't pushed your changes. :-) |
Indeed, sorry! It's been pushed now. |
Can you prepare a new release or update the release tag? tag 0.1.2 points still to commit 4ab8efd. |
Hm, that's the correct one though (it is the last commit on master, which bumps the version to 0.1.2 too). |
You are right. Perfect! :-) |
Hi! I've done a PR in Home Assistant to covert the switch to a component to integrate sensors and services. The new integration, with the new release should fix this issue and more. I'm testing it with |
Thanks for getting back and for your work on the homeassistant component! :) I think this can be closed now. |
Hello!
I've been using it for months now, as you know! However I've now moved to the official HA version and it seems to not work anymore. AFAIK It shouldn't have changed the token as I haven't repaired or changed anything on the Mi Home app and the robot.
I've deleted the .py file from custom_components and also the pycaches folders just in case.
I'm getting this error:
This is my current config:
IP also hasn't changed, so I'm not sure what's going on here!
Also my robot is perfectly connected to the Wifi and I can control it without problems with the Mi Home app!
The text was updated successfully, but these errors were encountered: