BottlecapDave / HomeAssistant-OctopusEnergy

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

Still pulling Agile pricing #1

Closed mdeakin99 closed 2 years ago

mdeakin99 commented 2 years ago

I have installed this but it still seems to be pulling Agile pricing and not Go (which I am on). I have correctly selected 'Go' in the drop down but I am concious I might not be using the right code (which include AGILE in it).

Also it isnt pulling in gas/electric meters yet.

Any help greatly appreciated.

mdeakin99 commented 2 years ago

I used https://energy.guylipman.com/sm/admin?source=octopus to confirm the tariff code (changed it to a GO code) and there are no entities etc created by the integration.

BottlecapDave commented 2 years ago

Hii, sorry to hear you're having issues. This component is still a work in progress and I've only just switched to Octopus myself so I'm still waiting to get data myself to iron out the bugs. I'll update the readme to make this clearer.

In regards to the GO prices, I have a todo in the code to adjust the rates for this, which I'll try and get to as soon as possible.

For tthe gas/electric meters, are you receiving any errors in your logs?

Also what version of Home Assistant are you using, as their latest release has broken sensor states which might be causing the gas/electric meter issue.

mdeakin99 commented 2 years ago

No worries at about being work in progress. Happy to help where I can. Two log items.

This error originated from a custom integration.

Logger: custom_components.octopus_energy Source: custom_components/octopus_energy/api_client.py:18 Integration: Octopus Energy (documentation, issues) First occurred: 19:04:43 (1 occurrences) Last logged: 19:04:43

Unexpected error fetching rates data: 'results' Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 187, in _async_refresh self.data = await self._async_update_data() File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 147, in _async_update_data return await self.update_method() File "/config/custom_components/octopus_energy/init.py", line 36, in async_update_data hass.data[DOMAIN][DATA_RATES] = await client.async_get_rates('AGILE-18-02-21', config[CONFIG_MAIN_TARIFF_CODE]) File "/config/custom_components/octopus_energy/api_client.py", line 18, in async_get_rates data = data["results"] KeyError: 'results'

….. and the second one….

This error originated from a custom integration.

Logger: custom_components.octopus_energy Source: custom_components/octopus_energy/api_client.py:18 Integration: Octopus Energy (documentation, issues) First occurred: 19:04:43 (1 occurrences) Last logged: 19:04:43

Unexpected error fetching rates data: 'results' Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 187, in _async_refresh self.data = await self._async_update_data() File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 147, in _async_update_data return await self.update_method() File "/config/custom_components/octopus_energy/init.py", line 36, in async_update_data hass.data[DOMAIN][DATA_RATES] = await client.async_get_rates('AGILE-18-02-21', config[CONFIG_MAIN_TARIFF_CODE]) File "/config/custom_components/octopus_energy/api_client.py", line 18, in async_get_rates data = data["results"] KeyError: 'results'

BottlecapDave commented 2 years ago

Thanks for that. In my investigation, I've managed to find an easier way to setup the integration where you just need to provide an API key and account number. The upside is it should now be pulling down the right data. Downside is you'll need to remove the integration, install the update and restart home assistant. I've also updated the readme with further information.

mdeakin99 commented 2 years ago

Seen the update and pulled that one down. Still no entities created I am afraid.

Logger: OctopusAgile Source: custom_components/octopusagile/OctopusAgile/Agile.py:378 Integration: octopusagile (documentation, issues) First occurred: 5 September 2021, 19:31:19 (1764 occurrences) Last logged: 7:30:59

Unmatched consumption 2021-03-27T22:30:00Z / cost 2021-01-03T23:00:00Z Unmatched consumption 2021-03-27T23:00:00Z / cost 2021-01-03T23:30:00Z Unmatched consumption 2021-03-27T23:30:00Z / cost 2021-01-04T00:00:00Z Unmatched consumption 2021-03-28T00:00:00Z / cost 2021-01-04T00:30:00Z Unmatched consumption 2021-03-28T00:30:00Z / cost 2021-01-04T01:00:00Z

This error originated from a custom integration.

Logger: OctopusAgile Source: custom_components/octopusagile/OctopusAgile/Agile.py:373 Integration: octopusagile (documentation, issues) First occurred: 5 September 2021, 18:30:01 (93013 occurrences) Last logged: 7:31:20

UTC Unmatched consumption 2021-09-05T22:00:00+01:00 / cost 2021-06-14T21:30:00Z UTC Unmatched consumption 2021-09-05T22:30:00+01:00 / cost 2021-06-14T22:00:00Z UTC Unmatched consumption 2021-09-05T23:00:00+01:00 / cost 2021-06-14T22:30:00Z UTC Unmatched consumption 2021-09-05T23:30:00+01:00 / cost 2021-06-14T23:00:00Z UTC Unmatched consumption 2021-09-06T00:00:00+01:00 / cost 2021-06-14T23:30:00Z

This error originated from a custom integration.

Logger: custom_components.octopusagile Source: custom_components/octopusagile/init.py:408 Integration: octopusagile (documentation, issues) First occurred: 5 September 2021, 18:30:21 (16 occurrences) Last logged: 8:00:00

Expecting value: line 1 column 1 (char 0)

BottlecapDave commented 2 years ago

Those errors look like they're coming from a different integration (Octopus Agile)

mdeakin99 commented 2 years ago

Opps. My bad!

Who needs enemies when you have testers like me 😉

Sent from Mailhttps://go.microsoft.com/fwlink/?LinkId=550986 for Windows

From: David @.> Sent: 06 September 2021 08:59 To: @.> Cc: Mark @.>; @.> Subject: Re: [BottlecapDave/HomeAssistant-OctopusEnergy] Still pulling Agile pricing (#1)

Those errors look like they're coming from a different integration (Octopus Agile)

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2FBottlecapDave%2FHomeAssistant-OctopusEnergy%2Fissues%2F1%23issuecomment-913432501&data=04%7C01%7Cmarkde%40microsoft.com%7Ce474d5fbbc934a8ae3dc08d9710c33aa%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637665119511339798%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=CBa2%2FKLBV8ECbreGLiyVvMlPg2QnMAyU%2B1thzrXWmC4%3D&reserved=0, or unsubscribehttps://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FAM5C5J4GEKOYRKDYC7MW7MDUARYEVANCNFSM5DLUESRA&data=04%7C01%7Cmarkde%40microsoft.com%7Ce474d5fbbc934a8ae3dc08d9710c33aa%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637665119511339798%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=ANUDxm5y3ZNes7MXxpWHgX%2BL7ni8L0T8farlxJ1N0V0%3D&reserved=0. Triage notifications on the go with GitHub Mobile for iOShttps://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fapps.apple.com%2Fapp%2Fapple-store%2Fid1477376905%3Fct%3Dnotification-email%26mt%3D8%26pt%3D524675&data=04%7C01%7Cmarkde%40microsoft.com%7Ce474d5fbbc934a8ae3dc08d9710c33aa%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637665119511349751%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=vRTOXhI3H6WR0nNCNtMhHnW6u3r%2FbeSeTYcsMjWJrbo%3D&reserved=0 or Androidhttps://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fplay.google.com%2Fstore%2Fapps%2Fdetails%3Fid%3Dcom.github.android%26referrer%3Dutm_campaign%253Dnotification-email%2526utm_medium%253Demail%2526utm_source%253Dgithub&data=04%7C01%7Cmarkde%40microsoft.com%7Ce474d5fbbc934a8ae3dc08d9710c33aa%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637665119511349751%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=U%2BKDKa32k5HaLncQ59N%2BBO5Mde7%2FDp2vvcX%2FvZE4LTo%3D&reserved=0.

mdeakin99 commented 2 years ago

Will update you with any errors next time I reboot

BottlecapDave commented 2 years ago

No problem :) I'll keep this ticket open until you return :)

mdeakin99 commented 2 years ago

I can confirm I now see current/next energy price. Thats now working.

I need to wait for the 'meters' to update with consumption values. They are not in the correct format though for the 'Energy Dashboard' so will raise an issue for that. You can decide if that's important or not though :)

BottlecapDave commented 2 years ago

I've only just my meters updating, and it looks like Octopus only update the data once a day :( Not sure if that's just with my meter (v1) or all meters. I've reached out to them for clarity.

I'm thinking of adding a sensor for the previous day accumulated so I can at least get something useful out. Will close this ticket now that prices are coming through.