Solved

Can we get access to the live usage API?



Show first post

204 replies

Userlevel 3
@SianiAnni At the moment, I cludged this by running the query in my browser after creating my session interactively and then using a small perl script to upload this into my nodered db.

I haven' bother to retro-engineer the sequence of POST requests to establish fresh set of session cookies for each AJAX callback to work as retro-engineering this is all a bit of a dog, and iIt could take me a day to do this so there isn't the payback: one day's work to save a minute or so every month.

Which is why we really need to wait for the proper API if you want to automate this fully.
Userlevel 4
Badge
Thanks for the url @TerryE. It works a treat! And I have retrieved usage for both electricity and gas.
Given that I check MyUsage on the website several times each day anyway, running this daily shouldn't cause Ovo any additional overheads. However, I run nodeRed on my raspberry pi, so I will have to figure out how to set up a session in order to fully automate this.
Userlevel 3
You already have an internal RESTful API that your node.js framework uses for callbacks withing the Usage page et al. And this JSON return is all that you need for a Node RED flow.

Just in case anyone is interested in doing this, the JS code in the graphics display package running on your browser does a callback to retrieve the JSON data which it uses to draw the pretty usage graphs. For this to work your session must have been properly authenticated with your account and passwork because the API does a security check to ensure that any request for your data has the correct session cookies so that only you can see your data. Notwithstanding this, once your browser has established a session, then you can execute a query of the following format in your browser to pull this data down. You can then open this in your favourite spreadsheet application and manipulate / store the data as your see fit.
code:
https://live.ovoenergy.com/api/live/meters/MPAN/consumptions/aggregated?from=FROM&to=TO&granularity=HH

where the MPAN comes from your profile and the FROM and TO fields are of the format YYYY-MM-DDTHH:00:00.000Z.
The API does not seem to limited the range size, so I do this once a month and use a script to load the data into my Home Automation MySQL database. Please don't abuse this or I am sure that the developers will apply extra validation. I personally think that 1 query a month is better than going on a couple of times a day as I was doing previously.

Advanced programmers could no doubt script the whole session connection to recover the session cookies. I am one, but I haven't bothered.
Hey @VibroAxe

If you can send @Tim_OVO a PM with your account number, name and DoB - he'll add you to a list for any future API trials we might do!

Cheers,
Emily
Hey guys

@Tim_OVO I'm a smarthome developer and log term ovo customer. It would be great to get involved in this trial!
Userlevel 3
You already have an internal RESTful API that your node.js framework uses for callbacks withing the Usage page et al. And this JSON return is all that you need for a Node RED flow.

However doing the page request to establish a valid session token is a bit of a PITA. It's a pity that you don;t faciliate direct access to your /api/live/meters/NNNNN/consumptions/aggregate read functions using a secret api key approach that many such system use.

Nonetheless, I'd rare do this the "approved " way, so can you sign me up for trials? Thanks.
Userlevel 4
Badge
@ErTnEc, this is exactly what I want to be able to do. I use NodeRED to poll darksky.net for current weather readings. Can you send me your python script to play with?
Userlevel 7
Would I be able to download the readings which had been sent....... Can this feature (which surely must be in the pipeline otherwise I would not have been told it was possible) be implenmented as soon as possible.

Can I also get trial access to the raw data API.

Hi @blakedrayson @MikeWilliams

At the moment, we only make available the monthly meter readings that are sent for your statement. This are available via My OVO here: http://ovoener.gy/myovo.

To be part of possible future trials which makes available your smart meter data (a trial is already in progress), send me a PM with your name, account number and DoB. I can't promise anything at the moment so I'm sorry if you were promised this feature as standard.

Tim
Userlevel 1
Can I also get trial access to the raw data API.
During the coneversations with rep when I was enquiring about a SMART meter I asked if I would be able to download the readings which had been sent.

It is now six plus months further on and there is no sight of this on the main web site.

THEREFORE I WAS LIED TO.

Can this feature (which surely must be in the pipeline otherwise I would not have been told it was possible) be implenmented as soon as possible.
Userlevel 3
Sorry, I know I'm jumping the gun... but I'm:

a) Impatient
b) Curious

I've spent about an hour messing about to try and aggregate the realtime metrics for my Smartmeter usage, and although somewhat inconclusive (due to gaps in data going back to ovo it seems). I've done some reading up on how the SmartThings integration points work, and between that and some trial and error, got a small python script up & running which will log in, poll for active smartmeters on the account, and check the instant usage data against them (if present):

vagrant@vagrant:~/Scripts# ./ovo.py
Getting readings for GAS meter with mpan 7********4:
Estimated Annual Usage is 7144 M3
Demand : 11.693 KW
Cost/Hour: 0.3776839
Getting readings for ELECTRICITY meter with mpan 1********3:
Estimated Annual Usage is 7091.1 KWH
Demand : 2.564 KW
Cost/Hour: 0.3610112

I'm looking now at doing historical polling, so aggregating data over a set period of time, which seems easy enough to do as it's just serialised JSON in the results for example:

{"power":[{"startTime":1513036800000,"instantPower":0.8766,"tariff":0.1408,"price":0.12342528},{"startTime":1513036860000,"instantPower":0.8114,"tariff":0.1408,"price":0.11424512},{"startTime":1513036920000,"instantPower":0.8276,"tariff":0.1408,"price":0.11652608},{"startTime":1513036980000,"instantPower":0.8102,"tariff":0.1408,"price":0.11407616},{"startTime":1513037040000,"instantPower":1.6943,"tariff":0.1408,"price":0.23855744},{"startTime":1513037100000,"dataError":"NotFound"},{"startTime":1513037160000,"dataError":"NotFound"},{"startTime":1513037220000,"dataError":"NotFound"},{"startTime":1513037280000,"dataError":"NotFound"},{"startTime":1513037340000,"instantPower":1.6696,"tariff":0.1408,"price":0.23507968},{"startTime":1513037400000,"instantPower":1.7693,"tariff":0.1408,"price":0.24911744},{"startTime":1513037460000,"instantPower":1.8,"tariff":0.1408,"price":0.25344},{"startTime":1513037520000,"instantPower":1.9155,"tariff":0.1408,"price":0.26970240},{"startTime":1513037580000,"dataError":"NotFound"},{"startTime":1513037640000,"dataError":"NotFound"},{"startTime":1513037700000,"instantPower":0.7824,"tariff":0.1408,"price":0.11016192},{"startTime":1513037760000,"instantPower":0.7688,"tariff":0.1408,"price":0.10824704},{"startTime":1513037820000,"dataError":"NotFound"},{"startTime":1513037880000,"dataError":"NotFound"},{"startTime":1513037940000,"instantPower":0.8776,"tariff":0.1408,"price":0.12356608},{"startTime":1513038000000,"instantPower":0.7783,"tariff":0.1408,"price":0.10958464},{"startTime":1513038060000,"dataError":"NotFound"},{"startTime":1513038120000,"dataError":"NotFound"},{"startTime":1513038180000,"dataError":"NotFound"},{"startTime":1513038240000,"dataError":"NotFound"},{"startTime":1513038300000,"instantPower":0.8985,"tariff":0.1408,"price":0.12650880},{"startTime":1513038360000,"instantPower":0.833,"tariff":0.1408,"price":0.1172864},{"startTime":1513038420000,"instantPower":0.8089,"tariff":0.1408,"price":0.11389312},{"startTime":1513038480000,"instantPower":0.7962,"tariff":0.1408,"price":0.11210496}]}

I just wish that the signal from the meter was more reliable so not to have gaps in the metrics... (hence the NotFound events)
Userlevel 7
@Simonfea @obiwanzamora @AdamJ @dorinho @Ross2411 @Chrherms

If you haven't already, I'll need a PM with your account number, name and DoB to add you to a list for any future API trials we might do! :$

Tim
I'd also be interested in this. Was planning to create a https://homeassistant.io component as soon as the API is available. @Tim_OVO I'll be sending you a pm shortly.
Can you stick me on that list to? Quite fancy getting my Alexa in on the action 😉
I would also like to sign up for trial access to raw data.
Hi,

I too would be interested in being part of the trial and accessing my raw data via the API. How do I sign up?

Adam
I’d be keen to get involved with any early access program. I specifically am interested in writing a Skill for Amazon Alexa to retrieve my usage data. For example being able to verbally ask how much I spent on energy and/or am currently spending would be really useful.
Userlevel 1
Hi,

I’d be really interested in getting access to the data via your API. Could you please add me to this?

Many thanks,

Simon
Userlevel 7
Hi all,

It's great to see so much engagement and I can tell there's a lot of interest in live usage data and all the possibilities that go with it! There's a good few queries which I'll try my best to answer, but make sure to help each other out - that's what the forum's for!

Would it be possible to add a feature to analyse the gas smart meter data against the degree day data for my area.

This is a widely used tool to analyse the energy efficiency of building heating, as it allows usage to be normalised against the weather.


Well, @jadam, overlaying weather data over gas consumption data is something we've thought about and we may consider it in the future, as the benefits are obvious!

I like the 'Your Energy Breakdown' not sure how much I trust the breakdown.

Since January 2017 we have plugged our Audi e-tron PHEV into our home electricity and since mid January we have used a POD Point charger. Neither have ever showed in the counts of 'Electric Vehicle'.


Sp @DaveJenYearsley for an electric vehicle usage to show,you will need to create an appliance profile. For your info, here is a screen recording of how this works:



Hope this helps,
Tim
+1 for this – or at least being able to download your raw data to be able to analyse and explore ourselves. Would be really useful and interesting.
Userlevel 3
The loopenergy devices are a good approximation of usage but not 100% accurate I find (gas isn't far off, electricity cost estimates are around £10 to £15 off each month though). Plus with moving to a smart meter, the gasloop device will no longer be compatible with it.

Having access directly to the usage data the smart meters are recording would give much greater accuracy on my usage, which will give me much greater visibility on patterns of usage. This would be especially true with the gas usage, as at present Loopenergy only gives usage data every 15 minutes.
Hi, Your use of Loopenergy and Evo is very impressive. I would like to understand why access to a OVO API would bring advantage over your current setup. Surely that will only give you the same data as you have now?
Userlevel 3
I'm also interested in joining the early access program for the API. At present I'm using Loopenergy to monitor my gas and electric usage, and couple that with my Honeywell Evohome heating controller, I've got a fairly good monitor of overall usage and trends. At present I've a series of python scripts collecting data from both platforms and storing the metrics in an influxdb setup which I query and visualise graphically using grafana. I've also developed custom methods for adapting the overall control of the central heating system beyond what the controller already performs, adapting dynamically to usage patterns, weather, and overall energy consumption, for example, if gas usage increases without heat being called across any zone of the heating system, then the assumption is that the cooker is on and the heating then scales back on the upper floors to allow the increase in ambient temperature from the cooker to be taken into account. Plus I just like seeing what's going on (In work with some fairly big data platforms with work so it's kind of second nature really)

So yes, I'm hoping I can continue to collect data from the new smart meter and continue to use it how I do!
Hi

I like the 'Your Energy Breakdown' not sure how much I trust the breakdown.

Since January 2017 we have plugged our Audi e-tron PHEV into our home electricity and since mid January we have used a POD Point charger. Neither have ever showed in the counts of 'Electric Vehicle'.

At the end of September, I let OVO know. But as yet the only response has been an email saying 'have a lovely Sunday' . And a follow up email saying 'How did we do' - I gave prompt feedback but did not get an acknowledgement.

Anyway, are you certain that 'Electric Vehicle' in 'Your Energy Breakdown' works.

Regards
Dave
Would it be possible to add a feature to analyse the gas smart meter data against the degree day data for my area.

This is a widely used tool to analyse the energy efficiency of building heating, as it allows usage to be normalised against the weather.

Reply