barleybobs / homeassistant-ecowater-softener

A Homeassistant custom component to integrate Ecowater water softeners
https://github.com/barleybobs/homeassistant-ecowater-softener
MIT License
33 stars 10 forks source link

"Error while setting up ecowater_softener platform for sensor" since new Ecowater login page/URL #43

Closed olafz closed 7 months ago

olafz commented 1 year ago

The following error is logged during startup (and the ecowater platform does not work anymore). I'm running HACS 1.32.1, and Ecowater Softener v.3.0.0.

Update: The URL wifi.ecowater.com now redirects to https://app.ecowatersystemswifimanager.com/, which probably is the cause for this error.

The error is as follows:

Error while setting up ecowater_softener platform for sensor

Traceback (most recent call last):
  File "/config/custom_components/ecowater_softener/coordinator.py", line 50, in _async_update_data
    data_json = await self.hass.async_add_executor_job(lambda: ecowaterDevice._get())
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/concurrent/futures/thread.py", line 58, in run
    result = self.fn(*self.args, **self.kwargs)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/ecowater_softener/coordinator.py", line 50, in <lambda>
    data_json = await self.hass.async_add_executor_job(lambda: ecowaterDevice._get())
                                                               ^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/ecowater_softener/ecowater.py", line 42, in _get
    payload['__RequestVerificationToken'] = tokens[0]
                                            ~~~~~~^^^
IndexError: list index out of range

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 293, in _async_refresh
    self.data = await self._async_update_data()
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/ecowater_softener/coordinator.py", line 83, in _async_update_data
    raise UpdateFailed(f"Error communicating with API: {e}")
homeassistant.helpers.update_coordinator.UpdateFailed: Error communicating with API: list index out of range

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 359, in _async_setup_platform
    await asyncio.shield(task)
  File "/config/custom_components/ecowater_softener/sensor.py", line 107, in async_setup_entry
    await coordinator.async_config_entry_first_refresh()
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 264, in async_config_entry_first_refresh
    raise ex
homeassistant.exceptions.ConfigEntryNotReady: Error communicating with API: list index out of range
nanderson97651 commented 1 year ago

I started seeing this same issue this morning and I'm still on 2023.8.4.

Error while setting up ecowater_softener platform for sensor
Traceback (most recent call last):
  File "/config/custom_components/ecowater_softener/coordinator.py", line 50, in _async_update_data
    data_json = await self.hass.async_add_executor_job(lambda: ecowaterDevice._get())
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/concurrent/futures/thread.py", line 58, in run
    result = self.fn(*self.args, **self.kwargs)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/ecowater_softener/coordinator.py", line 50, in <lambda>
    data_json = await self.hass.async_add_executor_job(lambda: ecowaterDevice._get())
                                                               ^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/ecowater_softener/ecowater.py", line 42, in _get
    payload['__RequestVerificationToken'] = tokens[0]
                                            ~~~~~~^^^
IndexError: list index out of range

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 283, in _async_refresh
    self.data = await self._async_update_data()
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/ecowater_softener/coordinator.py", line 83, in _async_update_data
    raise UpdateFailed(f"Error communicating with API: {e}")
homeassistant.helpers.update_coordinator.UpdateFailed: Error communicating with API: list index out of range

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 362, in _async_setup_platform
    await asyncio.shield(task)
  File "/config/custom_components/ecowater_softener/sensor.py", line 107, in async_setup_entry
    await coordinator.async_config_entry_first_refresh()
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 258, in async_config_entry_first_refresh
    raise ex
homeassistant.exceptions.ConfigEntryNotReady: Error communicating with API: list index out of range
figorr commented 1 year ago

The problem seems to be related to the new web page login.

Now the new web login is:

https://app.ecowatersystemswifimanager.com/Site/Login?redirect=/

Instead the old web login that was wifi.ecowater.com

So maybe the integration has to be updated to point to the new web login

olafz commented 1 year ago

I started seeing this same issue this morning and I'm still on 2023.8.4.

The problem seems to be related to the new web page login.

Ah. I updated Home Assistant today and did not notice any issues before, so I (wrongfully) attributed the error to the upgrade. I'll update the issue title and opening post.

normanwieja commented 1 year ago

Same here, integration stop working yesterday.

nicolasm38 commented 1 year ago

hi, I don't use this integration, but the script I used is similar and I've got the same error since yesterday.

figorr commented 1 year ago

The integration started working again. Today the ecowater domain has returned to the previous domain at wifi.ecowater.com. So probably due to maintenance they pointed to a different domain for a while. So only it is necessary to reload the integration from the "integration" menu at home assistant and everything started working again.

barleybobs commented 7 months ago

It appeared that the website went down for a bit for maintenance. I left this issue open in case this issue reappeared but am now satisfied that the current website is ok.

Thanks 👍