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

French compatibility ? #104

Closed Toukassay closed 5 years ago

Toukassay commented 6 years ago

Hi !

Thanks for your work about Home Assistant integration.

Unfortunatly, I think that french "how to connect" seems to be different than elsewhere, maybe I'm wrong. Verisure is deployed here by Securitas, and we log in with : https://customers.securitasdirect.fr/fr/login/FR

Then when I try to add the Home Assistant component, wich use your library, I've got this error :

Error during setup of component verisure
Traceback (most recent call last):
  File "/usr/local/lib/python3.6/site-packages/homeassistant/setup.py", line 148, in _async_setup_component
    component.setup, hass, processed_config)  # type: ignore
  File "/usr/local/lib/python3.6/concurrent/futures/thread.py", line 56, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/usr/local/lib/python3.6/site-packages/homeassistant/components/verisure.py", line 69, in setup
    if not HUB.login():
  File "/usr/local/lib/python3.6/site-packages/homeassistant/components/verisure.py", line 117, in login
    self.session.login()
  File "/usr/local/lib/python3.6/site-packages/verisure/session.py", line 90, in login
    self._vid = json.loads(response.text)['cookie']
KeyError: 'cookie'

I suspected a different way to connect because of this comment : https://community.home-assistant.io/t/question-about-verisure-integration-which-alarms-work/40748/2

Can you confirm my theory ? Is the French integration a plan ?

Thanks for your work, really appreciate.

Toukassay commented 6 years ago

See this topic too : https://community.home-assistant.io/t/verisure-not-working-with-home-assistant-on-new-verisure-install-in-france-and-spain/23207

krambriw commented 6 years ago

Are you sure this is the same provider? Securitas Direct is not the same as Verisure Try this link, and you will see the picture below for France https://mypages.verisure.com/

image

Toukassay commented 6 years ago

Oh. Ok. I'll try to create an account there, link it to my installation (made by Securitas Direct) ans see how it goes then.

Toukassay commented 6 years ago

Well, I can't link my installation as expected..

But yeah, I guess it's exactly what's said in the link above :

"I guess is because they have changed the architecture, now is not connecting to 'https://mypages.verisure.com/login.html 12’ - here in France it connects trough: 'https://customers.securitasdirect.fr/fr/login/FR’"

This library probably was working with the old URL but not anymore. That's why I was asking if the French integration is planned.

persandstrom commented 6 years ago

Hi @Toukassay Sadly I have no possibility to add FR support myself. I would accept a pull request if the difference only is in the login procedure, but if the systems are very different it would probably be best to create a new lib instead. I would happily answer questions on how the reverse engineering was done to a developer with FR login.

krambriw commented 6 years ago

You can contact them in French and ask if it is really the same supplier. Why did they otherwise keep the French alternative in the link I gave you if it is not valid?? You can call them to see if they did installation in your house, you have the phone number there in the link/picture. I mean, not to waste time on something that shows to be totally different