Vattenfall intergration

On Google play store they have an app called Vattenfall Energie.

Is it possible to make an intergration?

Would depend entirely on the API they expose (and if it’s publicly accessible).

I tried to install the app to take a look, but it doesn’t let me log in. :man_facepalming:

Are you looking for a solution to monitor Vattenfall city heating (WarmteLink) with Home Assistant? Maybe you can try this: WarmteLink (stadsverwarming) WiFi Gateway voor Eneco, Nuon en Vattenfall - SmartGateways.nl

I’ve downloaded the app (apk-file) and it shows the api config in environments.json

https://businessspecificapimanglobal.azure-api.net/vattenfall-mobile-nl-api/api/

I’ve not yet discovered any way how to communicate with it but perhaps someone can check the apk-file for something I’ve missed (open as .zip)

They have got an API and I once made a script for this, but you have to login by hand daily, cause the token expires every day and the login-page has a captcha on it.

I retrieved the usage from the previous day via: https://api.vattenfall.nl/api/mijnnuonprd/v2/consumptions/consumptions/
It requires a Bearer-token and a ocp-apim-subscription-key. After that you’ll get a nice json-file with the usage per hour, day, what you want.

3 Likes

There is also an api available at https://api.portal.vattenfall.com I’ll have a look at this and see if I can make something useful

2 Likes

Have you looked at the file environments.json in /assets/settings ?
Its full with API keys, clientId’s, clientSecret’s and URLS

Assuming we manage to fetch the data (like @ErikWie is doing, but we solve the login issue) - what is the right way to get it into the Energy panel in the dashboard? Do we need to create a new Integration? Can we use the REST integration?

I’m working on skipping the login by seeing how the app works (I can login with a fingerprint there, meaning that there’s a way to generate a token without a captcha IIUC).

I can confirm that the token I got from logging into vattenfall.nl (and choosing “remember me”) lasts for more than a day. Don’t know when it will expire, but I suspect it might work for quite some time. It indeed allows receiving a JSON response with all this history of consumption and costs to a very detailed level.

4 Likes

Was there any progress since then?
I’m also interested in this and willing to help if I can

I’ll look into it this week with the suggestions made.

2 Likes

I’m also very interested into this, I can help with testing.

Apparently this is only for charging stations or have you already been able to create something that allows you to also collect variable / dynamic energy rates?
Maybe you can retrieve values that you can import again with Scrape?

https://www.home-assistant.io/integrations/scrape

Maybe not the fix that you want but you can read the values with a P1 / IR gateway.

https://smartgateways.nl/product/warmtenet-wifi-gateway-voor-stadsverwarming-van-eneco-nuon-en-vattenfall-met-warmtelink-p1/

A different fix could also be to use an esphome-p1reader (I have ordered parts and will try it out with S34U18 - Sanxing SX631 / Vattenfall)

Hi all,
Any progress on the Vattenfall Incharge API integration? Would be so good!
They installed the charging station here without laying the P1 and ethernet cables (because they want to be in charge), so I can’t get the information that way, so I’m relying on integrating it through the API to be able to know the usage in Home Assistant.

Thanks in advance!