dan-r/HomeAssistant-Ohme

Additional sensors for Predbat support

deanjesper opened this issue · 13 comments

Is your feature request related to a problem? Please describe.

I'm dabbling with Predbat (an automation tool that can control your home battery) and there are a few sensors which would be really useful but I'm not sure if it's easily accessible via the API or not so I thought I'd raise this request to see.

Describe the solution you'd like

  • An incrementing sensor which measures the charge added to your car (on the app you can see how many miles are added, is it possible to see that in kWh (for Wallbox and Zappi the sensors are sensor.myenergi_zappi_[0-9a-z]+_charge_added_session and sensor.wallbox_portal_added_energy)
  • SOC % of the car (obviously not all cars are supported but those which are connected might be known to the API)

Describe alternatives you've considered

N/A

Additional context

Here's Predbat if you're wondering what it is! https://github.com/springfall2008/batpred

So there's already an accumulative charge added sensor in kWh but it doesn't increment until after you disconnect. Something on my todo list is to add the charge from the current session to that so it goes up 'live'.

For SOC % I personally use my cars API (through my NissanConnect integration) but will look into adding this from Ohme. AFAIK the field is either percentage of the car or percentage added, so wouldn't even be restricted to API cars.

I think it may need a sensor that starts at 0 and increments as you charge but let me check on that (need to compare notes on what it’s expecting from Zappi and Wallbox).

For non API connected cars, can Ohme know the SOC or would it just be down to the user setting the correct % of charge to add for their session?

I left it as a continuously incrementing sensor for now because thats what Home Assistant needs for the energy dashboard, but could always make that configurable.

For non API connected cars, (I think) the SOC field starts at 0% and displays how many % Ohme think they have added to the car based on energy used and the battery size you have set for the car

@jeldwendean mind trying out v0.5.2-beta.1? Should read the API value from the car for the new SOC sensor but I haven't tested it as it isnt connected to my car.
For me it shows 67% and the app reckons it added 113mi on the last charge - that matches 67% of the (optimistic) 168mi Ohme reckon my Leaf can do.

I've just upgraded so will plug the car in later on this evening after the saving session etc and will report back :)

Sorry only just got round to this but as I expected the SOC is showing as 0% and I guess as it adds charge it will go up (e.g. if I add 15% tonight then it’ll go from 0% to 15% as Ohme can’t read my battery SOC).

IMG_1441

Might be worth trying v0.5.2-beta.2 tonight. It adds (experimental) support for live incrementing the accumulative energy sensor and fixes some weird bugs with the SOC sensor.

Cool I’ve just upgraded but SOC still says 0% and I think that’s because my car isn’t API integrated (be interesting to see what you get for SOC?)

For the live incrementing, I had a look at the Zappi integration and it has a sensor for the session rather than total, is this possible to add?

@jeldwendean I know its late but I've added a session energy usage sensor to v0.5.2-beta.3. Very untested, but I'm testing it tonight!

Amazing! I’ve upgraded but missed the boat so will have to wait for the next time I plug in. Did you get anywhere with figuring out why SOC shows 0% for me but a % for you?

For non API connected cars it will start at 0 (and reset when you start a charge) and show the percentage it thinks it's added to the car

I've reverted the accumulative sensor to only update after the session ends as it wasnt reliable enough and didnt match up enough, but I've made some tweaks to the session energy sensor that I'm going to try tonight (v0.5.2-beta.4).

Closing this with release of v0.6.1 for now, feel free to re-open if you have any issues!