Phype / purei9_unofficial

This project includes a client/library to connect to Electrolux and AEG cleaner robots.
https://pypi.org/project/purei9-unofficial
MIT License
27 stars 5 forks source link

Unable to connect local vacuum because there is no localpw #6

Closed GitPetri closed 3 years ago

GitPetri commented 3 years ago

I am able to run (from hass.io) the following: python3 -m purei9_unofficial cloud -c username@domain:password status and I get the response with field values for id, name, localpw, connected, status, battery and firmware. The problem now for me is that the value for localpw is empty and python3 -m purei_unofficial local -a <ip_address> status doesn't work without -l value for local password, tried without it and with -l "" and with -l''

PureI firmware version: 41.16

Phype commented 3 years ago

A non-empty localpw is always needed to connect to the robot via the local TCP socket. The value for localpw is initially set by the app when configuring the robot (the process where you have to turn it upside down and connect to it's wifi). However, newer versions of the app do not seem to send this value to the cloud servers anymore and only control the robot through the cloud. To resolver this, you might try 2 options:

1. Just control the robot via the cloud service (easy)

You can just control your robot through the cloud via python3 -m purei9_unofficial cloud -c username@domain:password start etc. In this case, no localpw is required since the commands will go through the cloud servers.

2. Re-initialize the robot to set a new localpw (complicated, might not work)

Edit: It does work. When you've configured your robot using the new (Electrolux Wellbeeing) app, you can try to re-initialize it with the older (purei9) app (remove from account, then add it again). Then run python3 -m purei9_unofficial cloud -c username@domain:password status again and see if a localpw becomes available afterwards. If not, there is currently no way to recover the localpw. PS: i haven't tested this, but it should work from my understanding how the app works.

GitPetri commented 3 years ago

Thanks, I collided into this issue while attempting to troubleshoot why https://github.com/anhaehne/homeassistant_electrolux_purei9 doesn't work. I haven't checked the code there yet but I'd assume it attempts to use the local library (so using the cloud service directly is not an option for me here). I'll try to figure this out with the hass purei9 code.

GitPetri commented 3 years ago

A non-empty localpw is always needed to connect to the robot via the local TCP socket. The value for localpw is initially set by the app when configuring the robot (the process where you have to turn it upside down and connect to it's wifi). However, newer versions of the app do not seem to send this value to the cloud servers anymore and only control the robot through the cloud. To resolver this, you might try 2 options:

1. Just control the robot via the cloud service (easy)

You can just control your robot through the cloud via python3 -m purei9_unofficial cloud -c username@domain:password start etc. In this case, no localpw is required since the commands will go through the cloud servers.

2. Re-initialize the robot to set a new localpw (complicated, might not work)

When you've configured your robot using the new (Electrolux Wellbeeing) app, you can try to re-initialize it with the older (purei9) app (remove from account, then add it again). Then run python3 -m purei9_unofficial cloud -c username@domain:password status again and see if a localpw becomes available afterwards. If not, there is currently no way to recover the localpw. PS: i haven't tested this, but it should work from my understanding how the app works.

GitPetri commented 3 years ago

I can confirm that re-initializing the vacuum with purei9 App populates the local password to cloud. It also wipes the vacuuming history and cleaning zones from Wellbeing :(.

Phype commented 3 years ago

I can confirm that re-initializing the vacuum with purei9 App populates the local password to cloud. It also wipes the vacuuming history and cleaning zones from Wellbeing :(.

Thanks for the confirmation, so this can be used as a workaround for now.

The homeassistant integration still uses an older version of this code which only supports local connections, so it requires a localpw for now until it is updated to feature an option to control the robot through the cloud api.

Phype commented 2 years ago

Update: Starting with commit 413408a it is possible to set the localpw in setup mode (when the robot is turned upside down) with purei9_unofficial as well. You have to connect to the robots wifi and use the local setlocalpw command. This shouldn't cause any issues since the app isn't using the localpw after setup anyway, but it isn't really tested either.