0

HTTP read energy prices from homepage

Tanel Matsi 11 months ago in Devices / Http updated by Jürgen Jürgenson 3 months ago 12

Since the energy prices have gone up I would like to import energy prices to bOS so I could make some desicions according to energy prices. I have read the manual about http driver but I am not a http and api expert and I am not able to understand the manual. Has anybody done such a thing and could explane or share demo how to read values from homepage or api. I understand that reading is different in different pages but maybe with some example I would understand the idea how to GET value to bOS.

For example is it possible to read values from this page:

https://electrify.stiigo.com/?page=conf#price

Hey Tanel,

I've made a API template for Entso-e. For Estonian market, I could share it but you need to make your own Entso-e account https://transparency.entsoe.eu
, as they limit the max connected accounts and you will receive your account token that you must use for polling. 

Template may have some problems, i haven't had the time to think a better way to calculate dates, but its doable - problem with the end of the month dates - as it needs to calculate them and if the month has less than 31 days it will mess last days readings up, but should return to normal if the month start fresh again. Their API manual is actually the best ive seen.

I believe eesti energia has done the same thing by using same API. But they have also made their own api and manual for it. I havent tested it though.
 

Http ELERING API.bos
I made this. It's an super simple dashboard and doesn't need any special tokens or registration. Works for country's EE, FI, LT, LV shows only the current price and logs it - not the full 24h. Info comes from here: LINK So if anyone wants they can add to it.

Http ELERING API v2.bos
Updated with 21hours table and min-max-avg values. I'm not sure why Elering API only gives me 21hours when from entso-e I get the full 24h response. 21H log opens if pressed on the current price button for each region. 

+1

Your demo is also linked to another HTTP  driver named HTTP ENTSO-E. "Command current price" gives bad request.

Http ELERING API v2.bos

Thanks for noticing the error, it should be fixed now. As I had recycled some programs from Ensto-e I didn't even notice it myself.

NB! If after the import, it still doesn't work, you can reload the server or run the programs manually. They need to run once to get the dates updated.

You still have small bug that request info from ENTSO "Calculation +1päev"

Also bad request to ELERING to 24H values.

Http ELERING API v2.bos

Umm Thanks again. Day calculator's error is also fixed. 
That bad request comes when %3 is missing form the string - there is a program for it, that had an error. It should now update its value automatically when server is reloaded...

Edit: Try running the programs manually if it gives you bad request.

Http ELERING API v2.bos


Seems like there could be some import bugs. I get two problems when importing this template to a empty/new server. 1)The calculator is "broken" and needs to be cut&pasted back otherwise it wont calculate the +1 day value. 

2) %3 value wont update after the import - if I open the programs %3 line again it will work again.

On my home server I dont get these problems. After service reload it gets all the values. Will have to talk to the support guys.

Kodu-Http ELERING API.bos

I made some fixes - It now shows the full 24h log - still has trouble with some programs and calculator - cut&paste should fix it though.

+1

Thanks for sharing Jürgen, even though I'm not using the example (not applicable to my country).

But I'm glad for the help and sharing spirit.


This forum should have a "Thank you" button / helping reputation scale :-D

Best regards 

+1

Thanks!
Yeah this open API only supports EE,FI,LV and LT as of now. But I've made one for EntsoE too - this should work with other regions. Only problem is that it needs user account and tokens to work. If i get more time to play with it, i'll try to simplify it. Then i could share it. 

Sharing is caring :D