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

Hybrid intermittent/constant window targets #701

Closed jellybob closed 10 months ago

jellybob commented 10 months ago

Describe the feature

The target entity currently only supports being on/off intermittently or continuously for an n hour period of time. Ideally I'd like to be able to have the cost tracker find two one hour windows at the lowest price.

Expected behaviour

When configured in this way the target would find a number of continuous time periods that have the lowest rates, rather than one single continuous time period, or many half hour time periods.

Use Case

I have a storage heater connected to the off-peak circuit of an economy 7 meter. This circuit isn't on a timer since switching to Octopus Agile, but can be told to activate at any time, but when activated it will remain active for 1 hour from the point at which it's turned on. I need my heater to receive power for about two hours to provide heat for the next day.

Currently I have a continuous target set to find the cheapest two hour window, which is generally fine but in many cases isn't optimal - it's not uncommon for it to select a two period which encompasses 30 minutes of significantly more expensive energy.

Confirmation

BottlecapDave commented 10 months ago

Hello, this feels like a very bespoke use case and would a fair amount of time to implement, where the target rate sensor configuration is already quite complicated (with some further complication already planned). Therefore I'll put it into the "under consideration" bucket, but have no plans for this anytime in the future.

Currently I have a continuous target set to find the cheapest two hour window, which is generally fine but in many cases isn't optimal - it's not uncommon for it to select a two period which encompasses 30 minutes of significantly more expensive energy.

I would be interested in diving into this, as it should pick the window where the overall cost is the cheapest (all rate added together). If you could raise a separate issue with

jellybob commented 10 months ago

That's entirely fair enough, and the response I was expecting, just thought I'd take a punt!

Given the constraints I'd provided the target rate sensor was probably picking the correct window, I currently have to manually kick of the off-peak circuit so the times it can choose from are the ones where I'm awake, and in all the cases I can remember while it wasn't quite optimal it was the lowest cost continuous 2 hour period available to it.

I'm going to close this rather than leave you with an annoying issue lingering for the miraculous day on which there's literally nothing else that could be improved, feel free to reopen if you're really itching for that!