kuralabs / iotawatt_ha

We had to fork Home Assistant IoTaWatt integration, people is crazy
Apache License 2.0
9 stars 2 forks source link

Iotawatt frequently dropping connection #1

Open braclh opened 11 months ago

braclh commented 11 months ago

Hi, first of all, thanks for creating this fork.

I don't know if I should file this issue here or in the official integration. The issue occurs in both integrations -- but I know there is an impasse between the integration owners and the Iotawatt creator, making it difficult to get anything done.

For many months, my Home Assistant has frequent connection loss with Iotawatt, where the sensors show as "unavailable". There is no data loss when I examine the graphs in the Iotawatt web UI, so I believe the issue is with the integration. I wiped my HA installation and started again with a clean installation, but the issue persists.

I raised this in the forum but didn't get any response.

Screenshot 2023-08-05 at 11 01 57 AM

Here is a sample of the logfile at an affected time. There is an Eero satellite AP in the same room as the Iotawatt, so I think the WiFi connectivity is OK.

If you have any suggestions I'd really appreciate it. Obviously this is affecting my automation behaviors :( Thanks 😀

Home Assistant 2023.6.3 Supervisor 2023.07.1 Operating System 10.3 Frontend 20230608.0 - latest

Logger: custom_components.iotawatt.coordinator
Source: custom_components/iotawatt/coordinator.py:76 
Integration: IoTaWatt ([documentation](https://github.com/kuralabs/iotawatt_ha/issues/new)) 
First occurred: August 1, 2023 at 11:05:24 AM (3623 occurrences) 
Last logged: 11:06:54 AM

Unexpected error fetching 10.1.1.141 data: 'NoneType' object has no attribute 'text'
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/iotawatt/coordinator.py", line 76, in _async_update_data
    await self.api.update(lastUpdate=self._last_run)
  File "/usr/local/lib/python3.11/site-packages/iotawattpy/iotawatt.py", line 76, in update
    await self._refreshSensors(timespan, lastUpdate)
  File "/usr/local/lib/python3.11/site-packages/iotawattpy/iotawatt.py", line 258, in _refreshSensors
    values = json.loads(response.text)
                        ^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'text'