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

Missing entity's #896

Closed res2cpu closed 3 weeks ago

res2cpu commented 3 weeks ago

Describe the bug

I'm not sure this falls under a bug. After Octopus recently had issues with their API my entity's covering current/previous peak/off peak on my electric meter stopped working staying listed as unknown and no longer provided by the integration. So I had the bright spark idea to remove them thinking they would recreate but they didn't.

I've setup a test instance of HA and everything is as expected, they are presant and updating Done the normal stuff, restarted HA, removed and reloaded the integration.

Looking at the debug log's the entity's are not mentioned at all.

Reproduction steps

Unable to reproduce as unable to remove the entity's while they are provided by the integration

Expected behaviour

The missing entity's to be recreated either on restart or reinstall of the integration.

Tariff Code

E-1R-GO-VAR-22-10-14-A

Integration Version

11.0.2

Home Assistant Version

2024.5.5

Fresh Install?

Not specified

Home Assistant Logs

home-assistant_octopus_energy_2024-06-02T14-22-25.468Z.log

Confirmation

BottlecapDave commented 3 weeks ago

Hello. The integration uses the rate information to categorise consumption and costs. During initial initalisation it looks at the rate information for the assigned tariffs and caches the number of unique rates. The caching is done to reduce load on the API during setup. As per the docs, if the tariff you're on provides 2 or 3 unique rates, then the peak/off peak/standard sensors will be provided. However if the data provided by OE is incomplete, this could cause the cache to save the wrong value.

If you installed the integration (or upgraded to v11 or higher) before OE were having issues, you should be able to just reload the account config or restart HA to have the sensors come back. If you installed the integration (or upgraded) during this blip, then you'll need to delete the cached data before reloading the integration. This can be found in your .storage folder of your config location in the form of octopus_energy.tariff-<<TARIFF>>.json (e.g. octopus_energy.tariff-E-1R-INTELLI-VAR-22-10-14-C.json). I'll have a look at rectifying this data automatically in the future, but no timescales on when.

res2cpu commented 3 weeks ago

Thank you for getting back to me so quickly.

When the outage hit I thought it might have been my end as I was out of date on HA by a month and the octopus integration by 2 months. So all explained!

I've removed the files, restarted HA and everything has repopulated.

Thank you for your work on this, It's been a great help!

BottlecapDave commented 3 weeks ago

No problem and thank you for the sponsorship :)