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

Support target rate sensors not meeting target hours #895

Open BottlecapDave opened 3 weeks ago

BottlecapDave commented 3 weeks ago

Describe the feature

Based on https://github.com/BottlecapDave/HomeAssistant-OctopusEnergy/discussions/894, add an option to support finding slots equal or below the target hours.

Expected behaviour

If the target hours is 3 but only 2 hours are found, then it should turn on during those times instead of never.

The thing that needs to be taken into consideration is agile pricing when all rate information isn't available. It should probably either

Use Case

See https://github.com/BottlecapDave/HomeAssistant-OctopusEnergy/discussions/894.

Confirmation

tim-b2 commented 1 week ago

In a couple of the cases you linked to this you were asking for a use case so hope it's helpful to provide mine - have set up a target rate sensor to switch on the ev charger for the cheapest 4 hours overnight (regardless of actual cost) - this isn't a full charge but is enough to cover several days use and keeps the battery in its optimum capacity for longevity.

However if electricity is very cheap I would prefer to import as much as possible (upto a full charge - this needs around 7 hours) , but even an extra 0.5h slot above the standard 4h is cost saving if means less charging needed on high cost days.

Setting a 2nd sensor with a 7h timer with a cost threshold (in a 13h overnight window) means if there are only 6 hours below the threshold it won't fire at all.

Using an intermittent, re-evaluating sensor (set at 0.5h to get as many slots as possible also creates possible issues: 1-If values were eg 3, 3,5,5,2,2,2,2,4,4,2,2 and threshold <4.5p then the first (3p) slots is ignored even though it would be usable. (the 4p slots are also ignored by this sensor but would be in the cheapest 4h window so my first sensor covers those. 2- I've also tried just triggering the charger on if current rate < max target rate but this isn't optimal, if there are e.g. 8 hours of 3p, then 3 hours at negative prices it would be best to use just some of the 3p hours along with the later slots, but currently although the trigger will still turn on the car will be full so won't take more charge.

(Ultimately would use data from the car to set the max hours dynamically to ensure always getting the right max duration).

Thanks for everything you've created so far.