Erroneous data in Home Assistant, or data in completely the wrong place
I charge my car at 23:30 (due to cheap electricity from Octopus), and it charges until 03:30 - 05:00 depending on amount of charge needed. The data from Octopus shows this usage.
The data from Ohme may show the charge all took place within one hour at 09:00! Or, like last night, might show the charge correctly, but then give me an erroneous entry at 08:00. This makes my daily chart incorrect, and the individual devices part has an incorrect number.
This happens every time. With the first scenario I thought maybe the connection wasn't working and it was picking it all up on the connection refreshing. But with the second scenario I'm at a loss. It's reporting something that didn't happen.
Here's some pictures:
This was last night's charge
And this is what it looks like in HA
This was on Friday
And this was HA. This one has the Octopus data too.
Any help appreciated. This is really messing up my energy dashboard.
What do your home assistant logs show?
For my charge last night the energy sensor and Ohme app line up, so my money is on a comms issue, either between Home Assistant and Ohme or between your Ohme charger and Ohme.
The only Ohme error in HA is:
This error originated from a custom integration.
Logger: custom_components.ohme.coordinator Source: helpers/update_coordinator.py:386 integration: Ohme (documentation, issues) First occurred: 5 October 2024 at 12:03:51 (3 occurrences) Last logged: 6 October 2024 at 23:53:45
Error fetching Ohme Advanced Settings data: Error communicating with API
The last logged time is not long after I plugged the car in. Nothing in the logs for today.
What about the Ohme 'Connected' sensor in Home Assistant? The app may play 'catch-up' if the charger is offline but the Home Assistant integration relies on the energy data coming in close to 'real time'.
Is that the "charger online" sensor?
Did another charge last night. Started at 00:33, finished at 05:36:
The current Draw is correct:
But the session energy is completely wrong:
and it's the session energy sensor.ohme_session_energy which is used by my energy dashboard. As a result, my energy usage is in the wrong places:
and shows the wrong amount:
The power draw reported by Ohme is a solid 7.5KW for the charge period
I don't know what, if anything, I'm doing wrong. But all the sensors apart from the one the energy dashboard uses seem correct. How can I get sensor.ohme_session_energy to report correctly?
What version of the integration are you running?
1.0.0
+1 for having the same issues and errors in HA log also on 1.0.0
The sensor you're using to track the session energy appears to be cumulative. The charging session begins with the sensor already at about 30kwh.
That's the only OHME sensor that the energy dashboard will let me use. Cumulative isn't an issue as long as the amount of energy used and the time it was used is correct. The sensor in question is way off for both
Is the energy track for that day
I can't speak to the times being wrong as I'm still quite new to Home assistant and this integration. All I know is that my sensor of the same name resets to 0 every time I plug the car in.
Hopefully Dan is able to help. In the meantime have you tried to remove the integration from home assistant and configure again from scratch?
This is the entire track for that sensor
I can certainly try removing it and reinstalling before I next charge the car (probably Thursday night)
So this behaviour may be related to some logic around the energy sensor. Basically readings are ignored if they go backwards unless they go to 0, because for some reason the figures from Ohme sometimes go down then up again.
This seemed to really upset the Home Assistant energy dashboard and gave some negative readings, hence the logic.
I've added some debug logging to the relevant section, would you mind doing the following please:
-
Update to v1.0.1-beta.1
-
Enable debug logging for the Ohme integration
-
Provide the logs here. I only really need the lines containing
EnergyUsageSensor, but can filter them.
I updated to 1.0.1 as requested on Thursday and charged the car on Thursday night / Friday morning. As per the bug above, the used energy was not reported by Ohme during the charge. All of the charge utilisation was triggered when I unplugged the charger later on Friday morning
I had debugging enabled, and filtered the log output to bring up EnergyUsageSensor. The filtered log is attached
I appreciate your efforts Dan! Many thanks
Thanks for sending that through, looks like it is happening for the reason I thought it was. The Wh value never resets to 0, in your case it drops to 18 and the integration subsequently ignores all the readings - I can fix this.
2024-10-24 22:28:18.134 DEBUG (MainThread) [custom_components.ohme.sensor] EnergyUsageSensor: Raw Wh reading 38617
2024-10-24 22:28:18.134 DEBUG (MainThread) [custom_components.ohme.sensor] EnergyUsageSensor: New state is 38617
2024-10-24 22:28:48.171 DEBUG (MainThread) [custom_components.ohme.sensor] EnergyUsageSensor: Raw Wh reading 38617
2024-10-24 22:28:48.172 DEBUG (MainThread) [custom_components.ohme.sensor] EnergyUsageSensor: New state is 38617
2024-10-24 22:29:17.929 DEBUG (MainThread) [custom_components.ohme.sensor] EnergyUsageSensor: Raw Wh reading 18
2024-10-24 22:29:17.929 DEBUG (MainThread) [custom_components.ohme.sensor] EnergyUsageSensor: New state is 38617
2024-10-24 22:29:48.491 DEBUG (MainThread) [custom_components.ohme.sensor] EnergyUsageSensor: Raw Wh reading 60
2024-10-24 22:29:48.491 DEBUG (MainThread) [custom_components.ohme.sensor] EnergyUsageSensor: New state is 38617
2024-10-24 22:30:17.921 DEBUG (MainThread) [custom_components.ohme.sensor] EnergyUsageSensor: Raw Wh reading 117
2024-10-24 22:30:17.921 DEBUG (MainThread) [custom_components.ohme.sensor] EnergyUsageSensor: New state is 38617
But whats really strange is that at 8am, the Wh value jumps to 66000. Was this when you unplugged?
2024-10-25 08:00:20.923 DEBUG (MainThread) [custom_components.ohme.sensor] EnergyUsageSensor: Raw Wh reading 16899
2024-10-25 08:00:20.924 DEBUG (MainThread) [custom_components.ohme.sensor] EnergyUsageSensor: New state is 38617
2024-10-25 08:00:51.011 DEBUG (MainThread) [custom_components.ohme.sensor] EnergyUsageSensor: Raw Wh reading 16957
2024-10-25 08:00:51.011 DEBUG (MainThread) [custom_components.ohme.sensor] EnergyUsageSensor: New state is 38617
2024-10-25 08:01:20.927 DEBUG (MainThread) [custom_components.ohme.sensor] EnergyUsageSensor: Raw Wh reading 17014
2024-10-25 08:01:20.928 DEBUG (MainThread) [custom_components.ohme.sensor] EnergyUsageSensor: New state is 38617
2024-10-25 08:01:51.172 DEBUG (MainThread) [custom_components.ohme.sensor] EnergyUsageSensor: Raw Wh reading 66025
2024-10-25 08:01:51.172 DEBUG (MainThread) [custom_components.ohme.sensor] EnergyUsageSensor: New state is 66025
2024-10-25 08:02:21.087 DEBUG (MainThread) [custom_components.ohme.sensor] EnergyUsageSensor: Raw Wh reading 66025
2024-10-25 08:02:21.087 DEBUG (MainThread) [custom_components.ohme.sensor] EnergyUsageSensor: New state is 66025
That's it exactly. The second I unplugged the car I got a spike for all(?) the energy the charge had taken.
How big is your battery/how much would you expect to have delivered in the charge?
So there's actually 4 different watt-hour readings that come back from the chargeSessions API call. I've added debug logging in v1.0.1-beta.3 to print out all of these. Would you mind testing this version out on your next charge with debug logging on? I only need the lines that look like this:
2024-10-27 19:49:28.657 DEBUG (MainThread) [custom_components.ohme.sensor] EnergyUsageSensor: CG: 919.0, BS: 909, CB: 929, CV: 909
I need to charge tonight so will also test it out. For the record, I don't have my car 'API connected' to Ohme, so that might be why its working differently for you (assuming yours is). Of course the aim is to make it work equally for either route!
Thanks for your patience with this, its one of the many joys of working with undocumented APIs :)
My next charge is Tuesday night / Wed morning. I'll have beta 3 in place before that.
I checked the charge, and the Ohme service in HA reported 27.41KW at the point I unplugged it, but the charge was only 22.5KW. I've seen discrepancies like that on other charges too.
I charged overnight. I turned on debugging just before I went out and plugged the car in. The log is attached (filtered on the lines you wanted): Ohme.log
In my energy log I have no data for last night's charge. Neither when it happened, nor when I unplugged it. I've left it for 2 hours just in case it reported late, but no, I've got nothing from Ohme for that charge. When I look at sensor.ohme_session_energy the value hasn't changed since the last charge. It's just a flat line at 66.0 kWh for 5 days.
@bodger-uk thank you for sending the logs through and apologies for the delay - I haven't had much of a chance to work on this.
I've changed the source of the data used for the energy sensor in v1.0.1-beta.4, would you mind testing this out?
Sure, I will be charging the car tonight or tomorrow night, so I'll have everything in place by then.
Thanks, again, for all your help on this.
I charged the car last night, and put Ohme 1.0.1-beta4 into debug mode a few seconds before I plugged it in. I disconnected this morning, and closed the log. I lost my internet and some of my home network for around 25 minutes not long after I plugged the car in, so the log may have a gap between 00:00 and 00:30.
I've attached the whole thing this time because I can't see anything of use in it.
Ah my bad - silly error in that version. I'll put a new beta out later and hopefully test it tonight or tomorrow.
I appreciate its difficult to test when you don't charge every day!
Right so I've released v1.0.1-beta.5, which seems to work well for me with the energy dashboard. Would you mind testing it with your next charge?
Sure, no problems. It'll be Thursday or Saturday night depending on charge levels, but I'll make sure to grab the logs when it charges
Just a quick LOL moment. I updated to 1.0.1-beta.5 and the ohme suddenly updated my dashboard with the entire charge from the other night when I had beta 4! 21.37 KW just dumped right in the middle of the day! :-D
I charged the car last night, and the entries are in the correct place and have the correct values on the dashboard. I do have the log, are there any particular lines you'd like?
Initial thoughts (after 1 data point!): much improved. Thanks for working this through. I'm likely to do another charge on Sunday night, so I can check again then (and log if required)
Nothing I need to see from the logs - I'm just keeping an eye on the numbers over a few charges and it'd be great if you could do the same!
A (maybe) final update. I have now charged the car 3 times using 1.0.1-beta 5 twice, and the official 1.0.1 once. In all three charges the data is correct and in the correct place. Matches up nicely with my Octopus data.
Thanks, again, for all your efforts on this, it's really appreciated.
I'm happy to mark this as closed if you are.
One little thing, the integration still says 1.0.0
definitely not important!