bokub / linky

🔌 CLI tool to retrieve Linky smart meters data
GNU General Public License v3.0
225 stars 21 forks source link

Can’t login (have URI changed ?) #5

Closed paulgreg closed 4 years ago

paulgreg commented 4 years ago

Hello, I’m not able to login, I’m getting « Error: The email or the password is incorrect ».

When looking at the source code, I’m not sure uri defined line 17 is valid anymore.

When trying a GET via CURL, I received a 302 redirect to "messages/inexistant.html".

curl -XGET -I https://espace-client-connexion.enedis.fr/auth/UI/Login
HTTP/1.1 302 Found
Location: /messages/inexistant.html

Does it still work with your credentials ? What do you think ?

bokub commented 4 years ago

The 302 redirect is expected, as you can see in line 24. The goal is just to retrieve the cookie.

I just tried with my credentials and everything is working great

Can you show me what you were trying to do? (Don't forget to hide your real password)

paulgreg commented 4 years ago

Ok. Thanks for your quick reply. I tried linky-cli without any success so I tried to use linky module directly. I made a very simple script :

const linky = require('@bokub/linky');

linky.login("my-enedis-email", "my-enedis-password".then(session => {
    session.getMonthlyData().then(data => {
        console.log(data);
    });
});

My enedis password contains a bunch of special characters (via a password generator). Maybe that’s the problem, I will try to change for a simple one to see if I’m able to use linky. I’ll keep you in touch.

paulgreg commented 4 years ago

Enedis seems to force at least one punctuation character. Even with a simple password (alpha + num + 1 punctuation sign), I wasn’t able to login via linky or linky-cli.

I’ve got that message via linky-cli : npx linky-cli month -u "my-email@free.fr" -p "my-enedis-password" npx: installed 102 in 3.666s ✖ Cannot retrieve consumption Error: The email or the password is incorrect

It is the same email and password that I use to login into https://mon-compte-particulier.enedis.fr/

Looking more closely on enedis website, I saw that I’m not « completely connected ». I’m on step 2 « Premiers services », not on step 3 « Tous les services Linky » (see screenshot on https://i.ibb.co/9grMGNK/linky.png). So maybe that’s the problem !

bokub commented 4 years ago

I just tried again with my creds, with the exact same command (npx linky-cli month -u "my-email@free.fr" -p "my-enedis-password") and I have no issue..

I don't know what to say, except "wait a few days/weeks and try again" !

paulgreg commented 4 years ago

Yes. I think the issue is about my account. I think we can close the issue. Thanks again for your work and your time.

My goal is to build an IoT, based on an ESP8266 and a LCD screen to display energy consumption. The first step is to be able to access my data.

opebayle commented 4 years ago

Hello,

I'm trying to do the same, and I've the same result as paulgreg.

× Cannot retrieve consumption Error: The email or the password is incorrect

my login/password work fine on https://mon-compte-particulier.enedis.fr/

Any idea ?

bokub commented 4 years ago

Hi @opebayle How old is your account ?

opebayle commented 4 years ago

I just created it today

bokub commented 4 years ago

As said above, you should wait a few days / weeks and try again...

Everything is still working for me today

image

opebayle commented 4 years ago

Ok thx, I'll wait 👍

psa-jforestier commented 4 years ago

Same error here. Account created yesterday. It seems ENEDIS change the way they log user, now they use re-Captcha. If you go to https://espace-client-connexion.enedis.fr/auth/UI/Login in a private navigation, you'll be redirerected to a kind of 404 page.

WoodySlum commented 4 years ago

Hi, does not work for me since 09 jul. Before, no pb.

Skuair commented 4 years ago

Hi, does not work for me since 09 jul. Before, no pb.

Same for me.

bokub commented 4 years ago

Hello :wave:

I have the same problem myself, I will try to fix it but I don't guarantee anything

bokub commented 4 years ago

Bonjour tout le monde

Suite à des suppressions d'endpoints legacy du côté d'Enedis, le module tel qu'il était codé ne pouvait plus fonctionner.

J'ai décidé de tout réécrire from scratch, avec un mécanisme complètement différent.

Je vous invite à désinstaller l'ancienne version de linky-cli (npm uninstall -g linky-cli) et à lire le README pour tous les détails d'installation et d'utilisation

WoodySlum commented 4 years ago

Merci pour le taf ! Effectivement l'approche semble plus adaptée.

Par contre ça fait un moment que j'essaye de générer les tokens, et leur API semble complètement buggée - ce soir j'ai une 404.

bokub commented 4 years ago

Je viens de tester le workflow complet (génération de tokens + récupération de la conso) et tout fonctionne bien:

image

Je ferme l'issue

opebayle commented 4 years ago

Bonjour,

Je viens de tester aussi ça fonctionne ! Merci pour ce super travail !