home-assistant / core

:house_with_garden: Open source home automation that puts local control and privacy first.
https://www.home-assistant.io
Apache License 2.0
72.18k stars 30.21k forks source link

None type error with forecast.solar #121150

Open bggsolar opened 3 months ago

bggsolar commented 3 months ago

The problem

Since updating to Core 2024.6.3, I have observed recurring and since 2024.6.4 permanent problems with the integration of forecast solar.

I am not sure where to start, here is the error log:

What version of Home Assistant Core has the issue?

core-2024.6.4

What was the last working version of Home Assistant Core?

core-2024.6.2

What type of installation are you running?

Home Assistant OS

Integration causing the issue

forecast.solar

Link to integration documentation on our website

https://www.home-assistant.io/integrations/forecast_solar

Diagnostics information

No response

Example YAML snippet

No response

Anything in the logs that might be useful for us?

Logger: homeassistant.components.forecast_solar
Quelle: helpers/update_coordinator.py:312
Integration: Forecast.Solar (Dokumentation, Probleme)
Erstmals aufgetreten: 3. Juli 2024 um 22:06:47 (867 Vorkommnisse)
Zuletzt protokolliert: 07:45:45

Unexpected error fetching forecast_solar data
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 312, in _async_refresh
    self.data = await self._async_update_data()
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/forecast_solar/coordinator.py", line 68, in _async_update_data
    return await self.forecast.estimate()
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/forecast_solar/__init__.py", line 200, in estimate
    return Estimate.from_dict(data)
           ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/forecast_solar/models.py", line 182, in from_dict
    datetime.fromisoformat(d): w for d, w in data["result"]["watts"].items()
                                             ~~~~^^^^^^^^^^
TypeError: 'NoneType' object is not subscriptable

Additional information

No response

home-assistant[bot] commented 3 months ago

Hey there @klaasnicolaas, @frenck, mind taking a look at this issue as it has been labeled with an integration (forecast_solar) you are listed as a code owner for? Thanks!

Code owner commands Code owners of `forecast_solar` can trigger bot actions by commenting: - `@home-assistant close` Closes the issue. - `@home-assistant rename Awesome new title` Renames the issue. - `@home-assistant reopen` Reopen the issue. - `@home-assistant unassign forecast_solar` Removes the current integration label and assignees on the issue, add the integration domain after the command. - `@home-assistant add-label needs-more-information` Add a label (needs-more-information, problem in dependency, problem in custom component) to the issue. - `@home-assistant remove-label needs-more-information` Remove a label (needs-more-information, problem in dependency, problem in custom component) on the issue.

(message by CodeOwnersMention)


forecast_solar documentation forecast_solar source (message by IssueLinks)

malrogers7 commented 3 months ago

I get the same error, although mine seemed to start when I updated to Core 2024.7.0.

Log:

Logger: homeassistant.components.forecast_solar Source: helpers/update_coordinator.py:312 integration: Forecast.Solar (documentation, issues) First occurred: 3 July 2024 at 23:12:29 (776 occurrences) Last logged: 07:52:04

Unexpected error fetching forecast_solar data Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 312, in _async_refresh self.data = await self._async_update_data() ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/components/forecast_solar/coordinator.py", line 68, in _async_update_data return await self.forecast.estimate() ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/forecast_solar/init.py", line 200, in estimate return Estimate.from_dict(data) ^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/forecast_solar/models.py", line 182, in from_dict datetime.fromisoformat(d): w for d, w in data["result"]["watts"].items()


TypeError: 'NoneType' object is not subscriptable

I get the following error in the UI:

Screenshot_20240704-075230

flightforum commented 3 months ago

Hi,

I have the same problem, currently 2024.7 installed.

Log:

Logger: homeassistant.components.forecast_solar
Quelle: helpers/update_coordinator.py:312
Integration: Forecast.Solar ([Dokumentation](https://www.home-assistant.io/integrations/forecast_solar), [Probleme](https://github.com/home-assistant/core/issues?q=is%3Aissue+is%3Aopen+label%3A%22integration%3A+forecast_solar%22))
Erstmals aufgetreten: 08:10:45 (60 Vorkommnisse)
Zuletzt protokolliert: 09:26:18

Unexpected error fetching forecast_solar data
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 312, in _async_refresh
    self.data = await self._async_update_data()
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/forecast_solar/coordinator.py", line 68, in _async_update_data
    return await self.forecast.estimate()
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/forecast_solar/__init__.py", line 200, in estimate
    return Estimate.from_dict(data)
           ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/forecast_solar/models.py", line 182, in from_dict
    datetime.fromisoformat(d): w for d, w in data["result"]["watts"].items()
                                             ~~~~^^^^^^^^^^
TypeError: 'NoneType' object is not subscriptable
BastiPrivat commented 3 months ago

Hi, same for me, since I have updated to 2024.7 yesterday evening.

Log:

*TypeError: 'NoneType' object is not subscriptable
2024-07-04 11:38:15.775 ERROR (MainThread) [homeassistant.components.forecast_solar] Unexpected error fetching forecast_solar data
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 312, in _async_refresh
    self.data = await self._async_update_data()
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/forecast_solar/coordinator.py", line 68, in _async_update_data
    return await self.forecast.estimate()
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/forecast_solar/__init__.py", line 200, in estimate
    return Estimate.from_dict(data)
           ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/forecast_solar/models.py", line 182, in from_dict
    datetime.fromisoformat(d): w for d, w in data["result"]["watts"].items()
                                             ~~~~^^^^^^^^^^
TypeError: 'NoneType' object is not subscriptable
2024-07-04 11:38:15.862 ERROR (MainThread) [homeassistant.components.forecast_solar] Unexpected error fetching forecast_solar data
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 312, in _async_refresh
    self.data = await self._async_update_data()
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/forecast_solar/coordinator.py", line 68, in _async_update_data
    return await self.forecast.estimate()
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/forecast_solar/__init__.py", line 200, in estimate
    return Estimate.from_dict(data)
           ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/forecast_solar/models.py", line 182, in from_dict
    datetime.fromisoformat(d): w for d, w in data["result"]["watts"].items()
                                             ~~~~^^^^^^^^^^
TypeError: 'NoneType' object is not subscriptable
2024-07-04 11:38:50.021 ERROR (MainThread) [homeassistant.components.forecast_solar] Unexpected error fetching forecast_solar data
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 312, in _async_refresh
    self.data = await self._async_update_data()
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/forecast_solar/coordinator.py", line 68, in _async_update_data
    return await self.forecast.estimate()
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/forecast_solar/__init__.py", line 200, in estimate
    return Estimate.from_dict(data)
           ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/forecast_solar/models.py", line 182, in from_dict
    datetime.fromisoformat(d): w for d, w in data["result"]["watts"].items()
                                             ~~~~^^^^^^^^^^
TypeError: 'NoneType' object is not subscriptable
2024-07-04 11:38:50.225 ERROR (MainThread) [homeassistant.components.forecast_solar] Unexpected error fetching forecast_solar data
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 312, in _async_refresh
    self.data = await self._async_update_data()
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/forecast_solar/coordinator.py", line 68, in _async_update_data
    return await self.forecast.estimate()
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/forecast_solar/__init__.py", line 200, in estimate
    return Estimate.from_dict(data)
           ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/forecast_solar/models.py", line 182, in from_dict
    datetime.fromisoformat(d): w for d, w in data["result"]["watts"].items()
                                             ~~~~^^^^^^^^^^
TypeError: 'NoneType' object is not subscriptable
**
flightforum commented 3 months ago

Hi! The problem solved itself for me... Now everything works as it should again without me doing anything.

KimpiegamesYT1 commented 3 months ago

Still have the issue here

malrogers7 commented 3 months ago

Hi! The problem solved itself for me... Now everything works as it should again without me doing anything.

The issue resolved itself for me too. I didn't do anything.

bggsolar commented 3 months ago

Also still have the issue here..

bggsolar commented 3 months ago

I've updated to 2024.7.1 - Problem is still there. But it seems do be different from before.

image

KimpiegamesYT1 commented 3 months ago

Yeah i get the same error

RATA1 commented 3 months ago

I've updated to 2024.7.1 - Problem is still there. But it seems do be different from before.

image

For this issue, check your PiHole/AdGuard etc. It was the cause if it for me. A recently updated list I think as it was fine prior to this evening. Screenshot_20240705_214601_Chrome White listed it, re-loaded it and it works now for me. 👍

KimpiegamesYT1 commented 3 months ago

This fixed the issue. Thanks

bggsolar commented 3 months ago

This fixed it also for me. Thanks!

BastiPrivat commented 2 months ago

Issue fixed for me, too. Solved by itself.