CharlesGillanders / homeassistant-alphaESS

Monitor your energy generation, storage, and usage data using the official API from Alpha ESS.
MIT License
101 stars 22 forks source link

Doesn't work from midnight until 1p.m. #104

Closed ahmedhoumeci closed 6 months ago

ahmedhoumeci commented 10 months ago

Hi, I have the following error and I don't know how to solve it:

Logger: custom_components.alphaess Source: helpers/update_coordinator.py:300 Integration: Alpha ESS (documentation, issues) First occurred: 14 gennaio 2024 alle ore 01:09:45 (956 occurrences) Last logged: 07:55:09

Unexpected error fetching alphaess data: unsupported operand type(s) for -: 'NoneType' and 'NoneType' 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/alphaess/coordinator.py", line 56, in _async_update_data inverterdata.update({"Solar to Load": _pv - _feedin})


TypeError: unsupported operand type(s) for -: 'NoneType' and 'NoneType'**

And the integration doesn't work from midnight until 1 p.m. more or less.

Any suggestion?
Thanks
Poshy163 commented 10 months ago

what does your API response look like during that time? i recently had the same issue, but was caused due to one of the sites being offline (cant connect to the internet), therefore everything returned as "none" in the API response

See here:

Screenshot 2024-01-15 at 9 00 29 am

Im working on a fix to catch this an alert the end user, could you be having the same issue?

ahmedhoumeci commented 10 months ago

@Poshy163 thank you for your answer. I can reach the cloud site without any problems if is that your question.

Poshy163 commented 10 months ago

Apologies, let me rephrase.

During 12-1 am;

If you are unsure, you can just send the logs through and i can have a look at what might be causing the issue

ahmedhoumeci commented 10 months ago

Hi @Poshy163. To answer to your question:

  1. The integration failed to boot
  2. Yes, it is correctly connette to internet
  3. I don't find anything in the logs exept this:

2024-01-15 09:34:00.056 ERROR (MainThread) [custom_components.alphaess] Unexpected error fetching alphaess data: unsupported operand type(s) for -: 'NoneType' and 'NoneType' 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/alphaess/coordinator.py", line 56, in _async_update_data inverterdata.update({"Solar to Load

ahmedhoumeci commented 10 months ago

@Poshy163 the entire error logs of my home assistant istance error_log-4.txt

Poshy163 commented 10 months ago

@ahmedhoumeci during that time, was your system connected to the internet? As i stated recently i had the same issue, but was caused due to one of the sites being offline (cant connect to the internet), and that threw me the "supported operand type(s) for -: 'NoneType' and 'NoneType'" error

if you know how to program/edit the source file, do you want to play a debug output for "feedin" and "_pv", as i have a feeling they are "none". if not dont stress as i can show you how a bit later.

i am currently away, but i arrive in antwerp tomorrow so i can work on a bit more of the debugging/bypass because it seems like a common issue that some people have

ahmedhoumeci commented 7 months ago

Hi @Poshy163 did you find a workaround for the issue?

Poshy163 commented 3 months ago

@ahmedhoumeci can you try the new beta release and see if it has been resolved? seems to be fixed on my end (from midnight to next API call)

(to get the beta, go to the HACS page for AlphaESS, click on the 3 dots at the top right. click show beta versions, and download the latest beta. restart)