-
-
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
Integration in home assistant #4
Comments
A very basic support is already available in this repository, I have avoided submitting it yet as I have felt the library has not received enough testing (e.g. the problem described in #1 is just fixed since yesterday. |
Ah sorry! I just saw the documentation on it. Can you add some lines on what is currently possible via home assistant? E.g. start the robot in an action? This would help to decide if I should go through the install and test it 😃 |
Hi rytilahti, Many thanks for all your great work..
Do you have any idea what is happening there?? My config is as folow:
|
Just created a topic on homeassistant as I think it's mainly related to it. |
I'd seriously appreciate if you'd be willing to try to get your changes included to this repository instead of creating a fork to maintain.. Now that being said, I think it may indeed be an issue how homeassistant handles the config files. The common way is to pass a list inside the same platform definition and then loop over it to create the linked devices, see e.g. https://github.com/home-assistant/home-assistant/blob/dev/homeassistant/components/light/yeelight.py#L81 . |
Sorry for your first point Rytilahti, I'm quite new to Github. I will make a fork of your repo and include those changes. |
Ok, not a problem. And yeah, the token handling in the library is currently awfully done, good to hear that you got it working though! |
Hi. I am really new to HA, hassbian and programming in general. I manage to install xavV plugin to work with my smart plug. However, i have 2 xiaomi components right now. One is in custom component ( which is xavV's version of yours) and the beta xiaomi integration for the smart home gateway. In my config file, when i place the config under Switch, HA doesnt load. I have to remove the line for HA to load. Is the file conflicting with each other? as both custom_component and component has xiaomi.py under Switch. If yes, how do i install this the proper way? Thank you in advance. |
I have been using this on HA for a few weeks now and it works very nice, you should submit it! I'm getting this on my log when I restart HA but still works perfectly!
Thanks a lot for creating this! |
@jcastro I'm getting the same errors in my HA log, although up until now it's been working, I have a automation to start the mi robot later today so I'll see for sure if it still responds, this is pretty cool! Also agree on that this should be submitted :) |
Not seeing the error mentioned here, running it in HA for 3 weeks now. Only thing I'm seeing is that the bot turns on if the boolean is switched to on, and then the boolean immediately switches back to off. After some time HA sees it is on and reflects the correct state. You should seriously consider to create a PR on HA for this component, as it works flawlessly. |
nice one!. I got mine automated so when no one is at home it turns on. Then when someone arrives it turns off |
@xavV : Where to put your files? I just renamed your xiaomi.py to xiaomy.plug.py (because as @flyguy729 I too have already the Gateway as xiaomi.py integrated) and put it under custom_components. Anything more? Because I only get the following error:
Any ideas? +1 on @jcastro. I'd love to see it being integrated into HomeAssistant |
@lv-88 Cool, do you have the automations for the scheduler somewhere on github by any chance? I already created template sensors for everything except the scheduler. The scheduling would be the finishing touch :) |
Hi all, Thank you! |
@jcastro the error happens sometimes when the robot doesn't answer. Maybe the component could do a retry if it fails to receive a response, but this is not a priority at the moment. @UltraSub the toggling issue sounds like something that could be avoided by setting the is_on in the component after a successful start. @UltraSub, @jcastro, I haven't yet submitted it to homeassistant because lack of polishing (that error, maybe a custom card for vacuums in general like @lv-88 had done?) and the fact that it'd require writing some documentation about how to fetch the token and how to use it. It's on my todo list though. @santirguez could you modify the line containing the error by adding exc_info=True (_LOGGER.error("Got exception while fetching the state: %s" % ex, exc_info=True) and see which line causes the error? |
@UltraSub I don't have it up somewhere yet, the automations are really simplistic, they are based on the same concept like the Alarm Clock code on the HA forums. Works great for me! Here is one of the automations (the first one activated in the screenshot) You can tweak these to make it fit you.
And then the sensor templates (that use input_sliders as you can see, so create those as well and you're good to go!):
|
Hi @rytilahti Thank you for the hint. It was catching the token as int so i put the token in 'XXXXXXXXXX' instead of XXXXXXXXX format, and now working as a charm! Thank you! |
@rytilahti I could help you write the documentation! |
@jcastro I created a PR for the code part (home-assistant/core#7913), if you want you could create a documentation here: https://github.com/home-assistant/home-assistant.github.io/tree/next/source/_components - A lot of it will be fairly similar to other components, but we need a nice explanation how one extracts the token from the robot :-) Btw, the component is renamed to xiaomi_vacuum instead of mirobo, so when the new component gets released it requires configuration changes for those using the component currently. |
So this stays for the Xiaomi Vacuum only? Correct me if I'm wrong but didn't you want @xavV to integrate his changes to your repo so the Wifi plug and the Air Purifier work too? :-) |
@Regularj I have nothing against integrating support for more devices but sofar I haven't received PRs. Looks like https://github.com/aholstenson/miio supports quite a few different devices with the same protocol so it'd be just about putting some effort to make it happen in python too. (It's more or less adding wrappers for different type of device communication). Only thing that doesn't (perhaps) make sense to support here is the xiaomi gateway (assuming the homeassistant support for it will be done using a separate lib), and yeelight bulbs (there's python-yeelight, which requires enabling developer mode though). There is a PR #13 for fixing an issue with out-of-sync clocks (apparently happens with some devices), but I haven't yet had time to go and test it thoroughly. edit: to add, adding support for more devices into homeassistant would require creating separate components I think, considering how different the devices are. |
Really glad to see this happening ! already testing the new component, works like a charm 👍 @jcastro nice work on documentation ! |
@pixeye33 sure! I would love to add it... can you point me in the right direction to a tutorial or something regarding the packet sender method? thanks! |
It's this method : #5 (comment) here's what it looks like : https://cloud.githubusercontent.com/assets/1382471/26220874/ba69f44e-3c14-11e7-96e5-5e2bb4b35052.png |
@lv-88 would you mind if I add your configuration and automations as an additional config example in the documentation? If no problem, could you send me the entire update code for the automations and sensors? thanks! |
@jcastro sure thing! Go ahead, here is everything in my current setup, I'm sure you can make it more "generic" for the documentation:
|
Seeing a lot of time-outs in hass log. Any idea where they come from or even better, how to solve it? :)
|
That problem is probably related to #14 . |
Not sure. Don't think so. Had this from day one according to Kibana. And never upgraded firmware during the last 9 weeks. |
Sometimes the robot doesn't answer even when everything is fine, or that's my experience with older firmware versions. When I get the problem with the newest FW sorted out, maybe it'd make sense to send the command multiple times. Anyway, the timeout comes from the fact that the robot is not answering to the request. |
This has been merged to the upstream, I'll going to bump the version after the 0.1.0 release which fixes it also for the newer firmware versions, closing this now. |
I added the robot as a switch in home assistant. I am also seeing frequent errors in my log:
Furthermore, the robot sometimes does not turn on, when triggered in home assistant. The log shows:
I wanted to replace the timer set in the Home app with home assistant. But then the robot must reliably turn on if I it is started by an automation. Any idea? Even mirobo status sometimes can not find the robot
But even if the status command works, home assistant can`t connect to the robot. Two hours ago, everything worked without an issue. |
@TribuneX What version of python-mirobo are you running and when did you update the the component? Are you sure this is not related to #14 ? edit: the component is now part of homeassistant, and the version 0.1.1 is a requirement in the current dev branch. One problematic part could be that homeassistant tries to update the status of the robot quite often, potentially causing problems with sequence numbers if one tries to use mirobo console tool at the same time, I suppose. |
I was running 0.0.9. I am just updated to 0.1.1 and will check if the issue is solved. Will this component be included in the next HASS release which will be released on the next weekend? I am currently running it as a custom component. |
Still get the same errors in the log with 0.1.1. My robot runs firmware version 3.3.9_003073
|
Yes, it is to be released with the next HASS release. Are you using the custom component from homeassistant repo or from this one? The time outs are reported when the device does not answer to queries for reason or another.. Are you running multiple scripts trying to connect with the device at the same time? In anycase, please create a new issue for those troubles, this task has been closed for a while as the integration is already done. |
Hi all, Recently I am having this error, after I got it working normally:
I tried to uninstall and install again python-mirobo, uninstall ir completely and let HA install it automatically, but I always got the same error. Thank you! |
Hi,
does someone plan to integrate this into home assistant?
The text was updated successfully, but these errors were encountered: