persandstrom / python-verisure

A python module for reading and changing status of verisure devices through verisure app api.
MIT License
138 stars 42 forks source link

Verisure api is not working #160

Closed crackers81 closed 1 year ago

crackers81 commented 1 year ago

FB_IMG_1678864083342

persandstrom commented 1 year ago

Might be that verisure has closed down this api now. The solution would be to start using version-2 of python-verisure. This is homeassistant, right?

krambriw commented 1 year ago

version-2 ???

persandstrom commented 1 year ago

The branch version-2 (default branch). It uses the new graphql based API. Homeassistant still uses version-1, but @niro1987 is working on an updated plugin. More info in this discussion #138

krambriw commented 1 year ago

Alright, I had the older 1.8.1 version installed. Now with the 2.6.1 it is again able to login, also without mfa. BUT this newer version of sessions.py is unfortunately not backward compatible. In my home-made Python script (that is doing much more than just Verisure) I used get_overview() and this is not available anymore. I now have to make a rather huge re-design of my script :(

krambriw commented 1 year ago

Anyway, Per, thank you very much!! I have now sorted out things in my script, everything is back to normal in my case when using version-2 Best regards, Walter

krambriw commented 1 year ago

Just one more Q, I do experience an automatic logoff after approx 15 minutes. Is this expected?

krambriw commented 1 year ago

I guess I understand, the life time of the cookie is 15 minutes.... When this happen I just do a new login: session.login() This seems to work fine

persandstrom commented 1 year ago

Have you tried to do update_cookie()?

krambriw commented 1 year ago

Thanks, just tried that, it seems to be enough, is working fine, no need to do new login Maybe have a routin (in my case I consider a special thread) that updates the cookie let's say every ten minute, should let you be online all time Best regards, Walter

krambriw commented 1 year ago

Worked fine. Separate thread in my python script, updating the cookie every 10 minute. My feeling is also that the command and response when operating smart plugs is faster with this api. Is it just me?

Skärmavbild 2023-03-17 kl  09 20 26