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

Add "Minimum time left" to Rolling Target sensor #912

Open heisenberg2980 opened 1 week ago

heisenberg2980 commented 1 week ago

Describe the feature

I would like to be able to specify the minimum time left in the rolling target sensors, so when there is less than that time left, the sensor will recalculate and jump to the next slot. For instance in a 3 hours rolling target sensor if this new parameter "minimum time left" is set to 2 hours, if the cheapest 3h window is from 1pm to 4pm the target sensor will show 1pm to 4pm until 2pm, and then at 2pm it will recalculate the next cheapest window for the day, which might be 8pm to 11pm

Expected behaviour

The new parameter "minimum time left" will force the target sensor to recalculate before the end of the period

Use Case

I use a target sensor to display on a screen the cheapest 3h window of the day, so everyone in the family knows when they should connect the non-critical appliances like the washing machine, dishwasher, etc. The problem is when there is for instance only 30min left, people keep asking what is the next window as 30min is not enough for any appliance to complete its cycle. It would be nice to be able to specify a "minimum time left" so the target sensor automatically jumps to the next window when there is no much time left

Confirmation