Read current energy price from Engie Electrabel

Hi,

I’m looking for a way to import the current energy price from Engie Electrabel
I’ve seen on their website they’re using a sort of API to retrieve the data:
https://www.engie.be/api/engie/be/ms/billing/customer/v1/business-agreements/xxxxxxxxxx/energy-prices?maxGranularity=MONTHLY
But it also require an authentication.

Did anyone already made an integration for this? Or did someone started this already?

hi @ewoudsmets any news on this? i’m in the same position to scrape the data from this page for dynamic prices, but unfortunetly, won’t work.

DId you found a solution ?

Hi,

I’ve been looking at this too.
Unfortunately you need a Bearer token (only valid for temporarily), which you can get with a request to:

https://account.engie.be/auth/realms/BE_MS_Customers/protocol/openid-connect/token

The request is using following parameters: (and I can’t figure out where they are from) - they are not my username and password.

The reply will contain the token. With that token you can call the energy_prices-API

Any help is much appreciated!

Best regards,
Ruben

This is a screenshot of the reply:

Hello @rubendewasch, @ewoudsmets,

Engie belgium seem to be using Auth0 as a identity provider. You can find more information about the authentication flow in their documentation. Based on your screenshots, it seems that they use a “Authorization Code Flow”. The doc is here: Authorization Code Flow Documentation

In the meantime, you can see that there is a “refresh-token” in the screenshot. You can use that refresh-token to get a new access-token once this one expires.

I am interested in finding out how to scrape that data and inject it in Home Assistant. If more people are interested, I can work on a python package to do so which could then be transformed into an integration.

Hope this helped!

Kind regards,
Guillaume

2 Likes