barleybobs / homeassistant-ecowater-softener

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

Error while setting up ecowater_softener platform for sensor #52

Closed nanderson97651 closed 4 months ago

nanderson97651 commented 5 months ago

Similar to #43 but the error logs don't match up, and I'm still able to login at wifi.ecowater.com unlike last time when the URL changed for ~1 day.

Running v3.1.0 in Home Assistant Container 2024.1.6. Seeing issue since earlier this morning, ~9:30 CST. Restarting integration and restarting home assistant does not appear to restore functionality.

Logger: homeassistant.components.sensor
Source: helpers/entity_platform.py:360
Integration: Sensor (documentation, issues)
First occurred: 10:01:13 AM (3 occurrences)
Last logged: 12:31:38 PM

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 59, in _get
    json_data = json.loads(data.text)
                ^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/json/__init__.py", line 346, in loads
    return _default_decoder.decode(s)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/json/decoder.py", line 340, in decode
    raise JSONDecodeError("Extra data", s, end)
json.decoder.JSONDecodeError: Extra data: line 2 column 1 (char 1220)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 300, 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: Extra data: line 2 column 1 (char 1220)

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 360, 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 272, in async_config_entry_first_refresh
    raise ex
homeassistant.exceptions.ConfigEntryNotReady: Error communicating with API: Extra data: line 2 column 1 (char 1220)
figorr commented 5 months ago

Same issue since 3 hours ago. I am able to access through the mobile app (iOS) and also at wifi.ecowater.com.

figorr commented 5 months ago

It looks like a temporary problem with the api. I just recharged the integration and now it works OK again.

I tried recharging the integration some some hours ago and it didn’t work. But now it worked.

barleybobs commented 4 months ago

@nanderson97651 Did this issue resolve itself? It sounds like the API had an issue but figorr is reporting that it resolved itself.

figorr commented 4 months ago

Yes, I didn't see this error anymore. Probably it was a maintenance issue related to the API. So once the maintenance ended ... the API came back to life again.

barleybobs commented 4 months ago

Thanks! In that case, I'll close this issue.

👍