Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Linky Integration: cannot connect with my valid credentials #33634

Closed
mixoum opened this issue Apr 4, 2020 · 79 comments
Closed

Linky Integration: cannot connect with my valid credentials #33634

mixoum opened this issue Apr 4, 2020 · 79 comments
Assignees

Comments

@mixoum
Copy link

mixoum commented Apr 4, 2020

The problem

Cannot connect on linky integration with my valid credentials (but working on https://mon-compte-particulier.enedis.fr/).
I have the issue: " Erreur inconnue: merci de réessayer plus tard (pas entre 23h et 2h)". I try to add it since since few weeks.
It works fine on Enedis and EDF website.
it does not work either with the intergation in configuration.yaml file or directly in the lovelace UI.

Environment

  • Home Assistant Core release with the issue: 107.1
  • Last working Home Assistant Core release (if known): NA
  • Operating environment (Home Assistant/Supervised/Docker/venv): Docker On Asustor NAS
  • Integration causing this issue: Linky
  • Link to integration documentation on our website: https://www.home-assistant.io/integrations/linky/

Problem-relevant configuration.yaml

linky:
  - username: 'xxx'
    password: 'xxx'

Traceback/Error logs

 Logger: homeassistant.components.linky.config_flow

No Data
Source: components/linky/config_flow.py:82
Integration: linky (documentation, issues)
First occurred: 11:20:41 (2 occurrences)
Last logged: 11:39:41

Additional information

@probot-home-assistant
Copy link

Hey there @Quentame, mind taking a look at this issue as its been labeled with a integration (linky) you are listed as a codeowner for? Thanks!

@Quentame
Copy link
Member

Quentame commented Apr 4, 2020

Hi !

Are you using a personal or professional account ?

At which time of day are you trying to add the integration ?

Thanks

@mixoum
Copy link
Author

mixoum commented Apr 5, 2020

Hi,

I use a personnal account. Whatever the time of the day I try to connect I have the same message.

Rgds

@Antexa
Copy link

Antexa commented Apr 5, 2020

Hi,

Same behavior for me aswell (personnal account)

👍

@Quentame
Copy link
Member

Quentame commented Apr 5, 2020

Can you try to set the timeout to 30 ?

Do you have special network going on over your NAS ?
Special DSN resolver ? AdGuard/Pi-hole ?
Sub network ?

@Antexa may you specify your operating environment ?

I've just set up my Linky on a HA testing set up, working perfectly.

Thanks

@Quentame
Copy link
Member

Quentame commented Apr 5, 2020

Are your accounts new ?

There is an issue on the underlying library side that may be linked to your issue : Pirionfr/pyLinky#28

The maintainer seems to be very responsive, you may check this and help him.

@mixoum
Copy link
Author

mixoum commented Apr 6, 2020

I have access to enedis account since 6 months but I have my data since 1 or 2 months maximum.
I tried to connect through the configuartion.yaml file and to add timeout: 30. Unfortunately, it changed nothing. The lovelace integration UI says " New devices discovered. We have discovered new devices on your network. Check it out". But no sensor has been created. I have to add my credentials and I still have the error message.

let us know if you find a solution to this. You are right, it's probably link to the issue you mentionned in the above message.

@nephthys
Copy link

nephthys commented Apr 8, 2020

I have the same problem with incorrect credentials (new personal account).

If I try the dependency pylinky with the command pylinky -u USERNAME -p PASSWORD, I get the same error: "Login error: Please check your username / password".

Looking in the pylinky/client.py file, there is this variable LOGIN_URL = "https://espace-client-connexion.enedis.fr/auth/UI/Login"

This URL no longer exists so there is a (logical) error. Hopefully the dependency (pyLinky) can be fixed in the future ;)

@Quentame
Copy link
Member

Quentame commented Apr 8, 2020

Okay so the issue is comming from the underlying library.

So we should all follow this issue Pirionfr/pyLinky#28
The maintainer is responsive and I hope a solution to come soon.

Closing this issue.

@Quentame Quentame closed this as completed Apr 8, 2020
@Chuckame
Copy link

Why closing this issue because, even if the maintainer is responsive, the pylinky will be updated when the bug will be fixed, so we can keep this issue open to avoid multiple issues reported for the same problem???

@Oscar7601
Copy link

Hello I am facing the same problem with valid credentials not being accepted to connect.
Home Assistant is running in Docker on an Unraid server. No noticeable difference if I remove my PiHole from the network.

@Chuckame
Copy link

@Quentame please reopen to track the pylinky upgrade

@Th0mC
Copy link

Th0mC commented Jun 4, 2020

The issue seems to have been corrected (pyLinky v0.5.0) but the way to get credentials is a bit more complex :
"In order to use the library, you need an account on https://datahub-enedis.fr/. You need to create a Data Connect Application and as of May 2020 you will get your client_id by mail and your client_secret by SMS after a week or so... With these credentials, you can only access the Sandbox environment... You need to sign a contract and probably wait more to get Production credentials..."

@peioe
Copy link

peioe commented Jun 7, 2020

Has anyone tried it with this method ?
Does it work for you @Th0mC ?

@jluc2808
Copy link

jluc2808 commented Jun 7, 2020

hello, i'm not a HA user but i could give you some info which is similar with other integration or other box.
Enedis have implemented the API to let everyone play with the sandbox environment, but only professionnal could access to the production environment.
i will explain: end-user needs to give acknowledge (in french consentement) directly inside his own enedis accompt, this acknowledge is converted in a code send to a professionnal entity which have already signed a contract with Enedis. This contract is needed to allow the professionnal structure to recieve the client_id and client_secret for the real environment (the production one).

So no end-user could use the API authorization (Oauth2), only company is allowed to perform the complete job to recieve access_token and refresh_token.

i did that way for lifedomus box.

I have my own company, i have signed a contract with enedis, publish a web server to establish the dialog with end-user, gave enedis access to test the mecanism, then recieve the 2 client_id and client_secret.
I have published a little Html page which forward the user into enedis step (consentement), store on a public server an application to recieve the code generated by enedis (on uri_redirect URL), this URL finalize and use this code to get the token (access_token and refresh_token), then forward the 2 token to the end-user application.

Then and only then end-user application could call enedis API with access_token to request for linky data.

@peioe
Copy link

peioe commented Jun 7, 2020

Quelle bande de pénibles ...

@Th0mC
Copy link

Th0mC commented Jun 7, 2020

@jluc2808 Any opportunity to use your html page to get our credentials?

@jluc2808
Copy link

jluc2808 commented Jun 7, 2020

yes that need to be tested and surely adapted to send token to HA , as i don't know what is the standard dialog to send to HA , i need some help , perhaps it's easier to gon this discussion with my direct email.
jean-luc.berno@wanadoo.fr

@jluc2808
Copy link

jluc2808 commented Jun 8, 2020

just to say , my program is free (and will stay free), it could be used to dialog with any box, with a little modification according to the way of incoming info for the box.
I think that will not be a big change, but as i said i not familiar with HA and don't know how to send HTTP or ? info to the right devices in HA. (I know how to do that with domoticz, lifedomus, but not HA )

so if @Th0mC or @peioe or anybody else could give me some help for this part i'm open to make the modification and publish the new page for HA.

@peioe
Copy link

peioe commented Jun 8, 2020

To be honest, if Enedis requires an outside service ran by a company to integrate into HA, I think I'm just going to give up and not do it. Maybe I will reconsider in the future if someone gets it working but right now I think what they are doing is not ok and I'd rather not use it at all.

Hopefully you can find someone else to test it, good luck.

@Th0mC
Copy link

Th0mC commented Jun 8, 2020

Just received my clientID and my clientSecret for the sandbox.
@jluc2808 I'm ready to help but honestly I don't really know how?
I'm a newbie on HA (have juste installed one instance locally).
What I understood is that HA is using pyLinky to get info from Enedis. The previous version, with email/password.
So first thing would be to make evolve HA to be compatible with the new version of pyLinky.
Then get your help to get cientid/clientsecret for my own "prod" data ;).
Right?

@Pirionfr
Copy link

Pirionfr commented Jun 9, 2020

maybe @NabuCasa can help us on this.

@jluc2808
Copy link

jluc2808 commented Jun 9, 2020

thanks for the reply , how could contact @NabuCasa ?

@Pirionfr
Copy link

Pirionfr commented Jun 9, 2020

@Quentame
Copy link
Member

Quentame commented Jun 9, 2020

Wait wait wait, Nabu-casa does not provide support at all.

See https://www.home-assistant.io/ in the footer Contact (no support!)

Only support here are volunteer, code mainteners or the Discord https://discord.gg/NAKujAp

@frenck frenck closed this as completed Aug 9, 2020
@Quentame
Copy link
Member

Quentame commented Aug 9, 2020

Linky integration will be removed in 0.114.0, and Enedis integration will come next.

It' longer than expected and first time for me dealing with OAuth2.

I'll tell you when you can test the next integration.

Sorry for the delay.

@flemzord
Copy link

flemzord commented Aug 9, 2020

I can't find a way to integrate Enedis? @Quentame

@Quentame
Copy link
Member

Quentame commented Aug 9, 2020

It's not available.
Actually coding it right now.

@big-muscle
Copy link

big-muscle commented Aug 9, 2020

Linky integration will be removed in 0.114.0, and Enedis integration will come next.

It' longer than expected and first time for me dealing with OAuth2.

I'll tell you when you can test the next integration.

Sorry for the delay.

Hi @Quentame !

Thanks a lot for your work ;)
I'm available if you have any questions about OAuth2 (i have already implemented OAuth2 on Facebook, Instagram, VKontact, Weibo)
I would be happy to work on the Enedis implementation ;)

Giom-V added a commit to Giom-V/Home-assistant that referenced this issue Aug 13, 2020
Component has been disabled while Enedis integration is being worked on as detailed on this issue: home-assistant/core#33634
Giom-V added a commit to Giom-V/Home-assistant that referenced this issue Aug 14, 2020
Component has been disabled while Enedis integration is being worked on as detailed on this issue: home-assistant/core#33634
@urbatecte
Copy link

Hi @Quentame ,

It seems that both ENEDIS and GRDF share the same API ?
ENEDIS https://data.enedis.fr/api/v1/console/datasets/1.0/search/
GRDF https://opendata.grdf.fr/api/v1/console/datasets/1.0/search/

If so, do you think your upcoming code will be OK for both Link and Gazpar ?

By the way, thanks a lot for your job on HA integration ;o)

@alexis-via
Copy link

@urbatecte No, the 2 links you give for ENEDIS and GRDF APIs are not designed to get the individual gaz or electricity index ; they give some global information for France or for a specific geographic area.

The API for GRDF is here:
https://www.developers.pprd.api.grdf.fr/
Anyone can open an account. Once logged, you can download a functional documentation which explains clearly that this API allows to get the daily gaz consumption. You can create an application, get an API key and/or an oauth client ID and secret. But I couldn't select any API ; the list of API is always empty.

@grea09
Copy link
Contributor

grea09 commented Aug 30, 2020

I wanted to get in that discussion about the possible utility meter integration. Indeed the old component was only getting raw data into home assistant. Since then we got a new tool to represent utility meters. I would like to help in development if needed to make it more user friendly. The main issue was that the data wasn't real-time and HA doesn't really handle history data. I tried discussing the matter with the core team without success. The issue lies in the recorder and we would need a API or something to add old data into it, which isn't possible so far.

It would be nice to have a country wide available utility meter display something like the cost of the last or current day based on data asked by the integration about the characteristics of the billing (like high hours rates and the such).

Is there a repo to follow the development of this feature ? Thanks again for the good work !

@utkiupe
Copy link

utkiupe commented Aug 31, 2020

isn't that how the utility meter works already?
you can set it up with tariffs and find a way to display informations in Lovelace. I personally use the mini card card extension to display nice daily bar charts.
But maybe this is not what you are talking about :)

@Quentame
Copy link
Member

I was 2 weeks in vacation.

Will be back to work in 1-2 weeks.

When I left, I saw an issue in the @jluc2808 wrapper API that needs changes.
I contacted him.

@grea09
Copy link
Contributor

grea09 commented Sep 1, 2020

isn't that how the utility meter works already?
you can set it up with tariffs and find a way to display informations in Lovelace. I personally use the mini card card extension to display nice daily bar charts.
But maybe this is not what you are talking about :)

The issue is that the data is from yesterday at least meaning that you can't compare it to other sensors without time trickery. The solution would be to tweak or hack the recorder but that's quite messy if not adressed properly.

@saniho
Copy link

saniho commented Sep 1, 2020

I have seen a plugin with Domoticz, perhaps this could help for development : https://github.com/guillaumezin/DomoticzLinky

@Conobi
Copy link

Conobi commented Sep 14, 2020

If you need any beta testers for Enedis new integration, I'm in ;)

@docteurzoidberg
Copy link

+1 beta tester available

@RobertLesgros
Copy link

me too 😉

@Bredin76
Copy link

Bredin76 commented Sep 25, 2020 via email

@Conobi
Copy link

Conobi commented Oct 12, 2020

I was 2 weeks in vacation.

Will be back to work in 1-2 weeks.

When I left, I saw an issue in the @jluc2808 wrapper API that needs changes.
I contacted him.

Anything new? Do you need help on something?

@Quentame
Copy link
Member

Quentame commented Oct 14, 2020

The Linky integration platform has been remove because the API has been discontinued.

A new Enedis integration will be created but other integrations that I maintain needs my attention now: iCloud, Synology DSM.

I'll let you know when the time comes.
During this time, you can join the HA French speaking Discord server, where we speak about the integration and workarounds : https://discord.gg/jGy9uMM

@max5962
Copy link

max5962 commented Oct 25, 2020

Hey @Quentame ,
The invite link has expired.

@Quentame
Copy link
Member

Hey @Quentame ,
The invite link has expired.

Link updated 😉

@df911
Copy link

df911 commented Nov 6, 2020

Why don't use : https://enedisgateway.tech/ ?

@sylvertom
Copy link

Why don't use : https://enedisgateway.tech/ ?

I like the concept but I'm not a fan of hosted services, also I can't find the code for this app anywhere, i doubt this is open source.

@Conobi
Copy link

Conobi commented Nov 6, 2020

Why don't use : enedisgateway.tech ?

I like the concept but I'm not a fan of hosted services, also I can't find the code for this app anywhere, i doubt this is open source.

Well, the issue is the fact that the API is now limited to company usage ; you can't have an API key if you don't have a business working with Enedis (or having a big project). This Enedis Gateway is right now the only way to use officially the API

@sylvertom
Copy link

Why don't use : enedisgateway.tech ?

I like the concept but I'm not a fan of hosted services, also I can't find the code for this app anywhere, i doubt this is open source.

Well, the issue is the fact that the API is now limited to company usage ; you can't have an API key if you don't have a business working with Enedis (or having a big project). This Enedis Gateway is right now the only way to use officially the API

Self employed developpers can't get credentials ? Does your app needs to be reviewed in order to qualify for an API key ?

@grea09
Copy link
Contributor

grea09 commented Nov 6, 2020

Why don't use : enedisgateway.tech ?

I like the concept but I'm not a fan of hosted services, also I can't find the code for this app anywhere, i doubt this is open source.

Well, the issue is the fact that the API is now limited to company usage ; you can't have an API key if you don't have a business working with Enedis (or having a big project). This Enedis Gateway is right now the only way to use officially the API

Self employed developpers can't get credentials ? Does your app needs to be reviewed in order to qualify for an API key ?

They ask for SIRET and such I'm guessing. For those the Home assistant team got NabuCasa to do the endorsement for the community. I think it should be asked if there's no other way.

@roncamma
Copy link

roncamma commented Nov 9, 2020

Hello,
If we can have an Linky and Gazpar integration, it would be amazing !
Have a nice day !

@SemiCroustii
Copy link

Maybe we can use this project : https://github.com/bokub/linky ?

@m4dm4rtig4n
Copy link

Why don't use : https://enedisgateway.tech/ ?

I like the concept but I'm not a fan of hosted services, also I can't find the code for this app anywhere, i doubt this is open source.

Initially this project was a POC to see the possibilities of NodeRED :p
I created the flow primarily for personal use, but when I first started talking about the project, a lot of people asked me to open it.
What I ended up doing :)

I could share the flow without problem, but as it is, it would be unusable without the signing of a legal contract with Enedis.
To use the flow, you need credentials provided by Enedis and respect a whole customer path for the assets.

Do not hesitate to go on my Discord dedicated to home automation:
https://discord.gg/DfVJZme

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests