BottlecapDave / HomeAssistant-OctopusEnergy

Unofficial Home Assistant integration for interacting with Octopus Energy
https://bottlecapdave.github.io/HomeAssistant-OctopusEnergy/
MIT License
612 stars 61 forks source link

Octopus Integration won't start - intelligent dispatch issue #679

Closed pgit2345 closed 10 months ago

pgit2345 commented 10 months ago

Describe the bug

Don't have an EV/charger, but do have a GivEnergy battery on Intelligent Octopus Flux.

Got this error on startup of the integration since upgrading HA and Octopus integration

File "/config/custom_components/octopus_energy/intelligent/init.py", line 220, in get_intelligent_features if provider.upper() in FULLY_SUPPORTED_INTELLIGENT_PROVIDERS: ^^^^^^^^^^^^^^ AttributeError: 'NoneType' object has no attribute 'upper'

Reproduction steps

Restart integration, fails with error. Entities no longer show on dashboard.

Expected behaviour

It should start (not sure what else to say!)

Tariff Code

E-1R-INTELLI-FLUX-IMPORT-23-07-14-E

Integration Version

v10.0.0

Home Assistant Version

11.3 (core 2024.1.1, super 2023.12.0)

Fresh Install?

After upgrading

Home Assistant Logs

Logger: homeassistant.config_entries Source: config_entries.py:406 First occurred: 7:18:17 PM (4 occurrences) Last logged: 7:24:42 PM

Error setting up entry A-5*****2D for octopus_energy Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/config_entries.py", line 406, in async_setup result = await component.async_setup_entry(hass, self) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/octopus_energy/init.py", line 91, in async_setup_entry await async_setup_dependencies(hass, config) File "/config/custom_components/octopus_energy/init.py", line 219, in async_setup_dependencies planned_dispatches_supported = get_intelligent_features(intelligent_device["provider"]).planned_dispatches_supported if intelligent_device is not None else True ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/octopus_energy/intelligent/init.py", line 220, in get_intelligent_features if provider.upper() in FULLY_SUPPORTED_INTELLIGENT_PROVIDERS: ^^^^^^^^^^^^^^ AttributeError: 'NoneType' object has no attribute 'upper'

Confirmation

pgit2345 commented 10 months ago

I should add I also see a charger entity with items such as ready time. All entities disabled of course, as the integration can't start. Think it assumes I have a car charger, which I don't!

pgit2345 commented 10 months ago

Rolled back to v9.2.1 of the integration for now, integration starts and entities showing on dashboard again, updating again etc.

BottlecapDave commented 10 months ago

Hello. Sorry that you've received this issue. Those entities should only appear if it manages to get intelligent device information from the API. Do those entities still exist on v9.2.1?

pgit2345 commented 10 months ago

Screenshot_20240105_205002_Home Assistant

Yeah, the device and the entities (some disabled) still seem to exist. But at least it's working for now!

BottlecapDave commented 10 months ago

Ok. That looks like another bug. They should be removed and the issue fixed in the next release.

BottlecapDave commented 10 months ago

This should now be resolved in v10.0.1. As mentioned, those entities should now be in an unavailable state and can be safely removed based on your tariff.