anhaehne / homeassistant_electrolux_purei9

11 stars 3 forks source link

How's it going? #1

Closed Ekman closed 3 years ago

Ekman commented 3 years ago

Hey,

This repo looks very promising. The Electrolux Pure i9 is in desperate need of a Home Assistant component, I appreciate that someone has taken the initiative.

What's the status of the repo? Is there anything that I can help with?

anhaehne commented 3 years ago

I'm not actively working on this component. It's work good enough for me.

I looked into the steps to make this an official component but i would first have to create a pip package and that is just way to much work since i'm not a python developer.

I anyone want's to take over this project feel free to fork this repository.

Ekman commented 3 years ago

Well it if works for you then that's good enough for me. Instead of me forking this repository, and since it's your component, how about I help out instead?

If you don't mind, I can submit a PR to make it a HACS component. In case you don't know, HACS is a third-party/alternate component market for Home Assistant. I'm not going to submit it to HACS but if we make it compatible it's easy enough to just add this Github repository and start using the component. I can create an install guide.

Would you mind committing a super simple readme that explains very quickly how configure the component up? Something like:

Add this to your config:

purei9:
  host: 127.0.0.1
anhaehne commented 3 years ago

I wrote a README but i don't feel comfortable with providing this component in any kind of store as i didn't write most of the code my self.

Phype commented 3 years ago

Hi :) If you think i can somehow help you, please feel free to give suggestions. I developed the "library" to control the purei9 from CLI, but i'm not running homeassistant (and i'm not really planning to), so i cannot support/test any of the homeassistant integration.

I recently added IP discovery to the library, so the static IP requirement is not needed anymore.

Edit: Ie. if you need changes in the purei9-cli API to make the integration more stable, feel free to request that.

anhaehne commented 3 years ago

First of all great work at reverse engineering the app.

If we could package your CLI in a PyPI package we could even go so far to move the integration into the official home-assistant repository, since that is a requirement for all platform integrations: https://developers.home-assistant.io/docs/creating_platform_index#interfacing-with-devices

So decoupling the CLI from the API would be helpful.

That would also allow me to more easily integrate new changes.

Phype commented 3 years ago

Ok, pypi package is available here: https://pypi.org/project/purei9-unofficial/

I refactored the code to be more like a proper library, hopefully you can work with this. Library has also been renamed to make it clear that i'm not affiliated with electrolux, hopefully this prevents any trademark issues.

Phype commented 3 years ago

PS: added possibility to control the robot via the new Wellbeing cloud api. Essentially there are now 3 ways to control the robot: local, legacy cloud API (not implemented) and the new Wellbeing API (only implemented in github, not in pypi version yet). I don't know what type of control you want to implement in the HomeAssistant integration, local or via cloud, but there are options now.

Update: The new Wellbeeing app seems to not support controlling the Robot via the local TCP connection apart from the onboarding process, and the new Wellbeing API does not expose the "local robot pw" anymore. So it is very much possible that this possibility will be deprecated and removed in the future. For future-proofeness, it might therefore be wise to use the Wellbeing API only.

Phype commented 3 years ago

The new wellbeing API seems to have been also reverse engineered by someone else to control Electrolux Pure A series air purifiers (uses the same APP/API now), but code isn't available: https://community.athom.com/t/started-on-app-for-electrolux-pure-a9-air-purifier-fan/12718/14

Ekman commented 3 years ago

I appreciate the hard work you've done @anhaehne!

As @Phype mentions then it seems like Eletrolux has disabled the local passwords which makes a local integration hard. I'm sure there are workarounds, but I just went ahead and created a Home Assistant integration using only cloud commands instead: https://github.com/Ekman/home-assistant-pure-i9

Edit: Thanks to you @Phype then creating such an integration was just a breeze, thank you.