selleronom / mittfortum

Home Assistant HACS Integration for energy monitoring from MittFortum
1 stars 0 forks source link

refresh_token used in config_flow.py #1

Open robertteir opened 5 months ago

robertteir commented 5 months ago

Hi,

First off awesome work and thank you!

I think the refresh_token is used in the test in config_flow.py, so it is already used and then the integration fails.

I was able to make it work by manually setting a new refresh_token in core.config_entries and then reloading HA.

selleronom commented 5 months ago

Thank you!

I am testing the approach of using refresh_tokens instead of the previous username / password login flow after MittFortum changed their login method. I will work on cleaning up the code for using refresh_token after a week of testing ;)

Jerra94 commented 3 months ago

Hi, I'm trying to add this integration but I having issues configuring it. How do I obtain the refresh token? How do I configure this integration, is the only way via the file /config/custom_components/mittfortum/strings.json?

selleronom commented 3 months ago

@Jerra94 You can find your refresh_token by using a browser:

  1. Open 'Networks' tab in 'Web developer tools'
  2. Login to MittFortum
  3. Search for 'access_token'
  4. Check the 'Response'
  5. Copy 'refresh_token'
  6. Use 'refresh_token' as the 'username' for the integration

image