batpred icon indicating copy to clipboard operation
batpred copied to clipboard

FR: Use Ohme integration action to get IOG Slots

Open jon798 opened this issue 10 months ago • 7 comments

Since the Ohme integration was moved into HA Core some of the sensors are no longer provided, and from the Octopus Energy integration, I am seeing the Intelligent Dispatching sensor not returning any planned slots, only completed slots (which I think is expected behaviour for Octopus IOG + Ohme?).

In the docs for the Ohme integration there’s now an action: ohme.list_charge_slots which seems to return slots still in progress, at least, and accurate to 15mins (matches the Ohme app, anyway).

This seems to return past, present and future slots as long as the car is plugged in - this might be a good way to bring info into Predbat?

Thanks for your ongoing efforts on this excellent add on!

jon798 avatar Feb 16 '25 07:02 jon798

I've not had anyone else report this as an issue, can you share some more details on the list_charge_slots and also what other sensors you have?

springfall2008 avatar Feb 18 '25 20:02 springfall2008

I noticed on Sunday afternoon when we plugged the car in ready to charge later that Ohme/Octopus had scheduled charging to start at 22:45 but that Predbat was only showing car charging from 23:30 in the plan.

This led me to try and figure out why, and the "planned dispatches" attribute of the Intelligent Dispatches sensor (part of the Octpus Energy integration, currently on v14.03) didn't show the charging slot at 22:45 either - in fact it stays empty, which is apparently a thing with the Ohme + Octopus integration.

Then I went looking and found the action in the Ohme integration documentation: https://www.home-assistant.io/integrations/ohme

This returns a JSON list of slots and the amount of energy Ohme either has used in the slot or expects to, and in my case included the 22:45 slot. If useful, I can supply an example next time I plug the car in (you get 'slots: []' when the car is not plugged in).

This is from developer tools, actions:

Image

In UI mode, you select the Ohmne account you want to use to perform the action (the integration can have multiple instances).

The other sensors that the Ohme integration provides are in the link above also, but of particular use for predbat I suspect would be sensor.ohme_home_go_status and maybe select.ohme_home_go_charge_mode, plus possibly time.ohme_home_go_target_time and number.ohme_home_go_target_percentage. The sensor.ohme_home_go_vehicle_battery sensor in our case is not much use as our Octpus integration is to the to the charger, not the car, so it mostly shows nonsense.

If there's anything I can supply to help, if you're interested in adding the extra slot info, please let me know.

jon798 avatar Feb 19 '25 07:02 jon798

@springfall2008 There's a new version of the Ohme integration (with some things currently missing/work-in-progress). danr is going to look at a proper predbat integration, see https://github.com/dan-r/HomeAssistant-Ohme/issues/108#issuecomment-2663208220

murkle avatar Feb 19 '25 08:02 murkle

I'm also in this situation. Currently if I get an IOG slot outside the normal window my home battery dumps into the car and I can't figure out how to pull the planned sessions into Predbat now. Has anyone figured this out?

BenCathro avatar Mar 16 '25 12:03 BenCathro

I believe this is dependent on the actual charger. I have a Zappi, and when I get slots outside the off-peak period, this is reflected in the Octopus plugin. This is not the case with Ohme, which my in-laws have. In my situation, predbat will recalculate when it sees the additional 7p slots but won't for the in-laws. What I would suggest is to set up an automation to: When Power to the car > 100W Set Predbat select.predbat_mode to "Monitor" Start Home battery charging or set home battery to hold as current SOC When Power to the car = 0W Do the reverse.

chris2172 avatar Mar 16 '25 12:03 chris2172

For Ohme you need to configure differently, the new ohme integration is now supported

https://springfall2008.github.io/batpred/devices/#new-ohme

springfall2008 avatar Mar 16 '25 18:03 springfall2008

I believe this is dependent on the actual charger. I have a Zappi, and when I get slots outside the off-peak period, this is reflected in the Octopus plugin. This is not the case with Ohme, which my in-laws have. In my situation, predbat will recalculate when it sees the additional 7p slots but won't for the in-laws. What I would suggest is to set up an automation to: When Power to the car > 100W Set Predbat select.predbat_mode to "Monitor" Start Home battery charging or set home battery to hold as current SOC When Power to the car = 0W Do the reverse.

Thanks for the suggestion. This would stop the battery exporting to the car but would require a different work around to get Predbat to charge the battery whenever an IOG slot is active.

It looks like @springfall2008 has figured out a solution. Thank you for dedicating time to this. I've implemented your changes and will see how things look for my next car charging session.

One quick question:

ohme_name: 're:time.ohme_(.+)_target_time'

This line is new. I'm not sure what its purpose is in relation to the incrementing energy sensor. Does it define when the sensor should reset?

BenCathro avatar Mar 16 '25 21:03 BenCathro