BottlecapDave / HomeAssistant-OctopusEnergy

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

Getting an error on setup #62

Closed pwwukpw closed 1 year ago

pwwukpw commented 1 year ago

I've restarted .

I've regerated API key .

Clearly the screen shot does not include my full key or account number however been ultra careful to ensure they are complete. Screenshot_20220910-081628_Home Assistant

BottlecapDave commented 1 year ago

Sorry you're having issues. Do you have any errors in your Home Assistant logs?

pwwukpw commented 1 year ago

Dave,

Thank you for following this up personally.

Please see log

Many thanks Peter This error originated from a custom integration.

Logger: aiohttp.server Source: custom_components/octopus_energy/api_client.py:120 Integration: Octopus Energy (documentation, issues) First occurred: 18:06:21 (2 occurrences) Last logged: 18:06:27

Error handling request Traceback (most recent call last): File "/usr/local/lib/python3.10/site-packages/aiohttp/web_protocol.py", line 435, in _handle_request resp = await request_handler(request) File "/usr/local/lib/python3.10/site-packages/aiohttp/web_app.py", line 504, in _handle resp = await handler(request) File "/usr/local/lib/python3.10/site-packages/aiohttp/web_middlewares.py", line 117, in impl return await handler(request) File "/usr/src/homeassistant/homeassistant/components/http/security_filter.py", line 60, in security_filter_middleware return await handler(request) File "/usr/src/homeassistant/homeassistant/components/http/forwarded.py", line 100, in forwarded_middleware return await handler(request) File "/usr/src/homeassistant/homeassistant/components/http/request_context.py", line 28, in request_context_middleware return await handler(request) File "/usr/src/homeassistant/homeassistant/components/http/ban.py", line 82, in ban_middleware return await handler(request) File "/usr/src/homeassistant/homeassistant/components/http/auth.py", line 236, in auth_middleware return await handler(request) File "/usr/src/homeassistant/homeassistant/components/http/view.py", line 136, in handle result = await result File "/usr/src/homeassistant/homeassistant/components/config/config_entries.py", line 178, in post return await super().post(request, flow_id) File "/usr/src/homeassistant/homeassistant/components/http/data_validator.py", line 73, in wrapper result = await method(view, request, data, *args, **kwargs) File "/usr/src/homeassistant/homeassistant/helpers/data_entry_flow.py", line 110, in post result = await self._flow_mgr.async_configure(flow_id, data) File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 280, in async_configure result = await self._async_handle_step( File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 367, in _async_handle_step result: FlowResult = await getattr(flow, method)(user_input) File "/config/custom_components/octopus_energy/config_flow.py", line 156, in async_step_user return await self.async_setup_initial_account(user_input) File "/config/custom_components/octopus_energy/config_flow.py", line 86, in async_setup_initial_account account_info = await client.async_get_account(user_input[CONFIG_MAIN_ACCOUNT_ID]) File "/config/custom_components/octopus_energy/api_client.py", line 112, in async_get_account "gas_meter_points": list(map(lambda mp: { File "/config/custom_components/octopus_energy/api_client.py", line 117, in "agreements": list(map(lambda a: { File "/config/custom_components/octopus_energy/api_client.py", line 120, in "tariff_code": a["tariff"]["tariffCode"], TypeError: 'NoneType' object is not subscriptable

On Sat, 10 Sept 2022, 09:36 David Kendall, @.***> wrote:

Sorry you're having issues. Do you have any errors in your Home Assistant logs?

— Reply to this email directly, view it on GitHub https://github.com/BottlecapDave/HomeAssistant-OctopusEnergy/issues/62#issuecomment-1242669734, or unsubscribe https://github.com/notifications/unsubscribe-auth/AVCTQASYUAHI3GVFROZIBSLV5RCBLANCNFSM6AAAAAAQJG6PVY . You are receiving this because you authored the thread.Message ID: @.*** com>

BottlecapDave commented 1 year ago

Sorry for the late response. Do you have the ability to set your log level to 'debug' and try again? This should add the raw response to your home assistant logs when you attempt again. This will help guide why you're getting the error you're getting. My gut feeling is I'm attempting to read an old agreement that you once had which is no longer applicable (I'm still on my first tariff).

github-actions[bot] commented 1 year ago

This issue has become stale because it has been open for 30 days with no activity. If you still think it's an issue, please respond soon.

github-actions[bot] commented 1 year ago

This issue has been closed because it has been inactive for 14 days since being marked as stale. This is done to help keep on top of active issues. If you still think it's an issue, please respond to this issue