BottlecapDave / HomeAssistant-OctopusEnergy

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

Error setting up entry A-######## for octopus_energy #922

Closed SmilingAxeman closed 1 week ago

SmilingAxeman commented 1 week ago

Describe the bug

Octopus Addon fails to start after manual install and save configuration Integration panel displays "Failed to setup"

Reproduction steps

Copied latest octopus_energy v11.2.0 folder under custom_components Reboot HA Settings -> Devices -> Add Integration -> Octopus Configure add account settings inc api , account and tick home mini which I can access on mobile app fine. Reboot Repeated configure and click update but still failed to setup

Expected behaviour

Expected successful setup and to create 20ish new entities

Tariff Code

E-1R-VAR-22-11-01-M

Integration Version

v11.2.0

Home Assistant Version

Home Assistant 2023.3.4

Fresh Install?

Fresh install

Home Assistant Logs

2024-06-16 19:13:02.126 DEBUG (MainThread) [homeassistant.components.websocket_api.http.connection] [###########] Sending [{"id":164,"type":"event","event":[{"type":"updated","entry":{"entry_id":"#############################","domain":"octopus_energy","title":"A-########","source":"user","state":"setup_in_progress","supports_options":true,"supports_remove_device":true,"supports_unload":true,"pref_disable_new_entities":false,"pref_disable_polling":false,"disabled_by":null,"reason":null}}]},{"id":164,"type":"event","event":[{"type":"updated","entry":{"entry_id":"#############################","domain":"octopus_energy","title":"A-########","source":"user","state":"setup_in_progress","supports_options":true,"supports_remove_device":true,"supports_unload":true,"pref_disable_new_entities":false,"pref_disable_polling":false,"disabled_by":null,"reason":null}}]}] 2024-06-16 19:13:02.584 DEBUG (MainThread) [custom_components.octopus_energy.api_client] account: {'data': {'octoplusAccountInfo': {'isOctoplusEnrolled': True}, 'account': {'electricityAgreements': [{'meterPoint': {'mpan': '#####...

2024-06-16 19:13:02.586 DEBUG (MainThread) [custom_components.octopus_energy.coordinators] last_retrieved: 2024-06-16 18:13:02.585822+00:00; request_attempts: 1; refresh_rate_in_minutes: 60; next_refresh: 2024-06-16 19:13:02.585822+00:00 2024-06-16 19:13:02.587 DEBUG (MainThread) [custom_components.octopus_energy.intelligent] MOCK_INTELLIGENT_DATA: False 2024-06-16 19:13:02.590 DEBUG (SyncWorker_8) [homeassistant.util.json] JSON file not found: /config/.storage/octopus_energy.#######################-tariff-override.json 2024-06-16 19:13:02.595 ERROR (MainThread) [homeassistant.config_entries] Error setting up entry A-######## for octopus_energy File "/config/custom_components/octopus_energy/init.py", line 132, in async_setup_entry File "/config/custom_components/octopus_energy/init.py", line 356, in async_setup_dependencies File "/config/custom_components/octopus_energy/coordinators/electricity_rates.py", line 230, in async_setup_electricity_rates_coordinator 2024-06-16 19:13:02.610 DEBUG (MainThread) [homeassistant.components.websocket_api.http.connection] [###########] Sending {"id":164,"type":"event","event":[{"type":"updated","entry":{"entry_id":"##########################","domain":"octopus_energy","title":"A-########","source":"user","state":"setup_error","supports_options":true,"supports_remove_device":true,"supports_unload":true,"pref_disable_new_entities":false,"pref_disable_polling":false,"disabled_by":null,"reason":null}}]}

Confirmation

BottlecapDave commented 1 week ago

Hello, sorry that you're seeing this issue. Those errors are a little odd with where they are referencing. I've tried setting up a new account on my second instance and didn't see what you were seeing. Could you please try downloading and updating the integration again?

SmilingAxeman commented 1 week ago

Thanks for getting back. My issue was with being stuck on HA V2023.3.4 which is too old for your latest v11.2.0. Apologies should have spotted this earlier. My work around was to delete your newest v11.2.0 and install an old version v7.2.0 which is working fine retrieving upto the minute data. Probably not recommended but works for me so great work Dave.

BottlecapDave commented 1 week ago

Sorry that I didn't clock the version of HA you were on. I try to make it clear in the release notes. Glad you figured out the issue.