dan-r / HomeAssistant-Ohme

Unofficial Home Assistant integration for interacting with Ohme EV chargers (EVSE) 🚗⚡️
MIT License
33 stars 10 forks source link

Octopus cheap rate 30 minute binary sensor #59

Closed maegibbons closed 2 months ago

maegibbons commented 3 months ago

Hi, thanks for this excellent integration. I use the Ohme pro with Intelligent Octopus Go.

What I would like to see is a seperate binary sensor for "if within half hour Octopus intelligent charging slot".

The slots that come through from octopus via ohme start and end on 15 minute boundaries.

However, Octopus bill based on half hour/30 min slots. I.e the MINIMUM slot is 30 minutes and i would like to trigger charging of home batteries for the full half hour not just the 15 min EV charging slot because the 30 minutes is all at cheap rate.

Therefore, I would like a sensor so that if we have a ohme EV slot scheduled between say 19:00 and 19:15 that that "octopus_in_cheap_slot" sensor is true for the full half hour. I.e. 19:00 to 19:30.

Krs

Mark

dan-r commented 3 months ago

With my Ohme I find that 90% of the time charge slots tend to be on half hour boundaries. The easiest way to do this may be with an automation in home assistant?

maegibbons commented 3 months ago

Hmm... interesting. For me I would say at least 50% are on 15 minute boundaries.

It could be done as an automation. Just felt that it would be easier in python within the integration where you are holding state.

There are cases such as the 2nd 15 minute block in 30 mins that one has to assume that the charge will take place and not be cancelled.

In the cancellation instance the sensor would have to go false.

If that's a definate NO from you then I will try and pursue it in pyscript and this request can be closed.

Many thanks

Mark

maegibbons commented 3 months ago

Screenshot_20240211_180321_Ohme.jpg

Above is classic example

dan-r commented 3 months ago

@maegibbons I'm looking into implementing this, just haven't had the time to give it a go yet. I'll leave this open and keep you updated

maegibbons commented 3 months ago

Hi Dan

Many thanks.

Krs

Mark

jeldwendean commented 3 months ago

Predbat will assume the whole :00 or :30 slot is 7.5p even if the slot is :15 or :45 so maybe look into that? It would save you a lot of time writing manual automations (and it now works with this integration, just replace the Octopus Energy sensors in the yaml file with the ones from this integration)

maegibbons commented 3 months ago

Umm....

I don't really want or need predbat to be honest.

Just an extension to this integration to give a sensor for the whole 30 mins.

But thanks for the suggestion.

Krs

Mark

dan-r commented 2 months ago

I haven't come up with an elegant way to achieve this which isn't otherwise solved easier using automations/scripting or something like predbat, so can't prioritise it at the moment. I always welcome contributions if anyone else gets a chance to look at implementing it though.