Can we get access to the OVO energy online account API to download our smart meter usage data?
Hi Ovo,
I wondered whether the API that powers your live and historical usage page in the account menu is something you could look into opening up a bit so we can freely access our raw data and also perhaps it may stimulate some interesting community projects?
For instance (more sport related), Strava and Fitbit.
Page 7 / 7
I was never bashing OVO for blocking hackers, I had mistakenly believed that Timmo was an OVO employee.
Me fixing Timmo’s code is a stretch as being a typical DevOps I tend to dip in and out of python, Go, terraform, cloudformation, helm charts and ansible. I’m going to try and add an exception to it
I can see there are two similar topics, I wonder if this thread has any helpful advice:
Thanks for the app @MikeWilliams . I’ve downloaded V1.0.2.
I found I had to run the program as admin otherwise it wouldn’t work. This may be a “feature” of my current W11 setup, but I just wondered whether it might be worth mentioning in your README?
Also, when running for the first time, an exception was raised; here is the data from the log:
System.NullReferenceException: Object reference not set to an instance of an object. at OvoData.Helpers.SqliteHelper.UpsertMonthly(String fuelType, List`1 items) in C:\Dev\Mike\GitHub\My-Ovo-Data\Helpers\SqliteHelper.cs:line 114 at OvoData.MainWindow.OnClick_Read(Object sender, RoutedEventArgs e) in C:\Dev\Mike\GitHub\My-Ovo-Data\MainWindow.xaml.cs:line 189
Thanks for the app @MikeWilliams . I’ve downloaded V1.0.2.
I found I had to run the program as admin otherwise it wouldn’t work. This may be a “feature” of my current W11 setup, but I just wondered whether it might be worth mentioning in your README?
Also, when running for the first time, an exception was raised; here is the data from the log:
System.NullReferenceException: Object reference not set to an instance of an object. at OvoData.Helpers.SqliteHelper.UpsertMonthly(String fuelType, List`1 items) in C:\Dev\Mike\GitHub\My-Ovo-Data\Helpers\SqliteHelper.cs:line 114 at OvoData.MainWindow.OnClick_Read(Object sender, RoutedEventArgs e) in C:\Dev\Mike\GitHub\My-Ovo-Data\MainWindow.xaml.cs:line 189
I suspect that Windows 11 is not allowing the program to create the folder C:\ProgramData\OvoData Please use admin account to create it and assign full permissions to all users
I had already created the folder, but the permissions weren’t set to the full control (although the logs folder and the .db file had been created).
So, I cleared out the contents of the OvoData folder, changed the permissions to allow Full Control and Modify, and reran your app. But got exactly the same exception. Again the Logs folder and the .db file have been created.
Anything else I can check for you?
Are you a Gas only customer?
I already fixed an issue for Electricity Only customers last with the aid of @Firedog
/Mike
Mike: Electricity only. Economy 7 also, but that probably isn’t relevant. Thanks.
I had already created the folder, but the permissions weren’t set to the full control (although the logs folder and the .db file had been created).
So, I cleared out the contents of the OvoData folder, changed the permissions to allow Full Control and Modify, and reran your app. But got exactly the same exception. Again the Logs folder and the .db file have been created.
Anything else I can check for you?
Can you post all the log file lines from the last beginning “Uri:” until the exception? Be careful to mask out your account number with *****
/Mike
Log file lines from last Uri are as follows:
2024-11-06 17:20:52 - Uri: https://smartpaymapi.ovoenergy.com/usage/api/monthly/nnnnnnn?date=2020 2024-11-06 17:20:52 - System.NullReferenceException: Object reference not set to an instance of an object. at OvoData.Helpers.SqliteHelper.UpsertMonthly(String fuelType, List`1 items) in C:\Dev\Mike\GitHub\My-Ovo-Data\Helpers\SqliteHelper.cs:line 114 at OvoData.MainWindow.OnClick_Read(Object sender, RoutedEventArgs e) in C:\Dev\Mike\GitHub\My-Ovo-Data\MainWindow.xaml.cs:line 189
Let me know if you need more.
Posted the requested information but apparently it needs to be revewed by the moderators. In case that takes time, the exception line was:
2024-11-06 17:20:52 - System.NullReferenceException: Object reference not set to an instance of an object. at OvoData.Helpers.SqliteHelper.UpsertMonthly(String fuelType, List`1 items) in C:\Dev\Mike\GitHub\My-Ovo-Data\Helpers\SqliteHelper.cs:line 114 at OvoData.MainWindow.OnClick_Read(Object sender, RoutedEventArgs e) in C:\Dev\Mike\GitHub\My-Ovo-Data\MainWindow.xaml.cs:line 189
That was preceded in the log by the Uri line which was https: slash slash smartpaymapi.ovoenergy.com slash usage slash api slash monthly slash accountNo?date=2020
No other lines in the log between those two entries. Let me know if you need more.
That is interesting in that the URL ends 2020.
Is that year significant?
Can you PM me the whole log file please?
The year isn’t significant to me, as far as I can see. The whole log file (4554 lines, 342k) is being sent to you in a PM, but it seems to be taking a while … having clicked “send” the button is just being highlighted continually with three white dots. This is the first time I’ve used PM so I may have done something wrong?
Edit: Just checked my online account. The last bill I can see online is for May-Jun 2020. I have been an OVO customer since 2013. Interestingly, I can see Usage data going back to 2013, but not the bills!
With the kind assistance of @HexhamUser I have been able to solve the issue with his data for 2020.
My code could not cope with him having “free” electricity prior to May.
The data segments were missing, causing my code to error.
This is now fixed and I intend to release this later this week.
/Mike Williams
I have just released V1.0.3 of my app to GitHub, this fixes the issue found by @HexhamUser when you have electricity with missing cost data.