segalion / securitasdirect

Home Assistant integration with Securitas Direct (AKA Verisure EU) and command line tool to interact with.
40 stars 17 forks source link

Issue after update - running 107.7 #13

Closed bal0o closed 4 years ago

bal0o commented 4 years ago

Updated HA from a working config and now get the following error upon restart of HA;

Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/setup.py", line 174, in _async_setup_component component.setup, hass, processed_config # type: ignore File "/usr/local/lib/python3.7/concurrent/futures/thread.py", line 57, in run result = self.fn(*self.args, *self.kwargs) File "/config/custom_components/securitas_direct/init.py", line 64, in setup HUB.update_overview() File "/usr/src/homeassistant/homeassistant/util/init.py", line 240, in wrapper result = method(args, **kwargs) File "/config/custom_components/securitas_direct/init.py", line 107, in update_overview self.overview = self.session.last_state() File "/config/custom_components/securitas_direct/securitas.py", line 111, in last_state regs= res['PET']['LIST']['REG'] KeyError: 'REG'

bazwilliams commented 4 years ago

I've run into this, but when I print out the response of the login request I get the following:

{"PET": {"RES": "OK", "LIST": {"@totalreg": "0", "@costtotal": "0"}, "BLOQ": {"@remotereqactive": "1", "#text": "We have a problem right now, try later"}}}

Yet I can login using my phone - perhaps they're blocking requests from this integration?

bigramonk commented 4 years ago

The integration is no longer working for me too but calling the python script from the command line actually does work: $ python ~/securitasdirect/custom_components/securitas_direct/securitas.py 1234567 mysecretpassword EST ES es { "PET": { "RES": "OK", "STATUS": "0", "MSG": "Tu Alarma est\u00e1 desconectada", "NUMINST": "7654321" } }