Solved

Can we get access to the OVO energy online account API to download our smart meter usage data?



Show first post

142 replies

Userlevel 7
Badge

… did you click on the “Read” button after logging on?
 

Yes!

  

For a first time run it is recomended to select “All Time”, then click on “Read”

 

Done that, but the DB is still empty. Could there be a Windows problem with storing data from an unsigned application to ProgramData? Perhaps change that to LocalAppData? I do have full control of ProgramData as an administrator, and I own the OvoData folder, but still ...

Userlevel 7
Badge

The highlighted part of the screen shows what data has been read.

 

[The image went away, presumably to be edited by a mod to obfuscate the username. It’s back now 🙂]

 

When I click read, there’s a brief delay with a status message Checking 2024, then the dialogue disappears (and the app closes, apparently). I’ve not seen anything in the box you highlighted.

There’s plenty of data available to download: I can see my own half-hourly data back to March 2017.

Userlevel 7
Badge

Would you prefer to continue this troubleshooting backstage? You could PM me

With the aid of @Firedog I have managed to work out why the program kept crashing.

I will be deploying a new version to GitHub later, watch this space.

Userlevel 7
Badge

I have managed to work out why the program kept crashing.

 

Mea culpa: it looks as if the app was choking when it found no gas data for me. Mike was quick to spot the hurdle and remove it, so now I’ve run out of ways to break it.

I can really recommend Mike’s solution to anyone happy to work from an SQLite database.

 

I have managed to work out why the program kept crashing.

 

Mea culpa: it looks as if the app was choking when it found no gas data for me. Mike was quick to spot the hurdle and remove it, so now I’ve run out of ways to break it.

I can really recommend Mike’s solution to anyone happy to work from an SQLite database.

 

I was tempted to say why, but I considered that your choice @Firedog to do so, for privicy reasons.

As I said earlier I intend to release the fixed version to GitHub shortly (hopefully tomorrow).

For those of you on a single fuel deal, please wait until I announce it’s release.

My solution also allows you to export the data to either CSV or Excel files.

/Mike

I have just release V1.0.1 to GitHub, this fixes the issue found by @Firedog when you only have electricity supplied by OVO.

Just download the zip file from https://github.com/MikeWilliams-UK/My-Ovo-Data/releases/tag/V1.0.1 and unzip it’s contents to any folder, then run OvoData.exe

 

/Mike

Userlevel 4
Badge

I have just published my application which fetches your data and stores it in a local SQLite database on your PC.

It can also export the data to CSV and Excel files, to allow easy anaylsis.

 

I know this is greedy of me but I don’t suppose you would consider making that into something embeddable in Node.js? If you did, it could be made available to Node-RED and Home Assistant users quite easily.

 

It's a WPF application written in C# so I am pretty sure it won't be an easy port to node.js, also I don't know node.js

The full source code is on GitHub, so you can go "fill your boots" there …

It also directly accesses the file system, which is prohibited in all browsers.

Just tried to update my useage data today and the fetching of my account id(s) is being blocked

Using postman after logging in and trying to get the data from https://smartpaym.ovoenergy.com/api/customer-and-account-ids

I get this in the html comming back

“Sorry, you have been blocked”
“This website is using a security service to protect itself from online attacks. The action you just performed triggered the security solution.
There are several actions that could trigger this block including submitting a certain word or phrase, a SQL command or malformed data.”
 
What can I do to resolve this?
“You can email the site owner to let them know you were blocked.
Please include what you were doing when this page came up and the Cloudflare Ray ID found at the bottom of this page.”
 
Looks like something that Cloudflare are doing :-(
 
/Mike

I have been using the HA Ovo add-on and it has now got me band from the  “smartpaym.ovoenergy.com/api/customer-and-account-ids” url it uses or it has been turned off, so the add-on no longer works in HA. Has any one else come a cross this?

Just fixed a bug in my Ovo data fetching program, one of the OVO api’s I was using has been deprecated.

You can find release 1.0.2 at https://github.com/MikeWilliams-UK/My-Ovo-Data/releases/tag/V1.0.2
 

I have been using the HA Ovo add-on and it has now got me band from the  “smartpaym.ovoenergy.com/api/customer-and-account-ids” url it uses or it has been turned off, so the add-on no longer works in HA. Has any one else come a cross this?

The url has been blocked by Cloudflare, my app has suffered from it since Friday (19th April) presumably the old API has now been turned off.

There is a new API with a new ul which returns the same data, can the app that you are using have the url changed?

/Mike

Userlevel 7
Badge

 

… release 1.0.2 ...
 

… working fine here. Thanks!

Userlevel 4
Badge

It's a WPF application written in C# so I am pretty sure it won't be an easy port to node.js, also I don't know node.js

The full source code is on GitHub, so you can go "fill your boots" there …

It also directly accesses the file system, which is prohibited in all browsers.

I’ll have a look, thanks.

File system access is not an issue for Node.js and can be worked around even for a browser.


Update: Took me about 25 minutes with Node-RED to get a successful login, most of which was decoding your C# code (which I don’t write!). This is the login flow: 

Node-RED Ovo API Login Flow

Should easily now be able to get the rest of the data, I can already see that I can get my monthly data even though I don’t have a Smart Meter.

Nice work Ovo, easy enough to use the API. Excellent work Mike.

Userlevel 4
Badge

Update 2: I split the flow in 2 - the main reason is that I don’t have to keep logging in and querying the account data when testing. I have made the last part of the flow a JavaScript function node that will let me better reformat the data into something easier to show.

 

So next step is to finish that formatting and then produce a web page to show the data.

This is, of course, fully cross-platform and you can run it on anything from a Raspberry Pi to Azure or AWS and everything in between whether desktop or server.

Once I’ve got it to a better place, I will be posting to the Node-RED forum. I will add a link to that here.

Userlevel 4
Badge

Here is the link to the post in the Node-RED forum which also contains the flow for anyone to use.

https://discourse.nodered.org/t/ovo-energy-api-get-your-energy-data-from-ovo/87440

Reply