Securitas Direct (Verisure EU) Custom Component [TESTERS WANTED]

With the new version there’s new configurations that need to be added.

  • lang: which defaults to “es”
  • installation: installation number that can be retrieved on your securitas profile

Meanwhile if you have log access please share more details.

where to add those values?

I download the package and install it on custom components as always, you can tell me which file and line I need to modify

Thank you

An example of configuration:

securitas_direct:
  username: your_securitas_username
  password: your_securitas_password
  installation: your_securitas_installation
  code: 1234
  country: ES
  lang: es

This can be added on configuration.yaml of your home assistant installation

Dont work:

Invalid config for [securitas_direct]: [installation] is an invalid option for [securitas_direct]. Check: securitas_direct->securitas_direct->installation. (See /config/configuration.yaml, line 64).

I have the same issue and also tried this workaround and says installation is an invalid option.

For the initial error, when accessing the log file, according to the error shown it seems HA is trying to access the old version of the App:

Logger: custom_components.securitas_direct.securitas
Source: custom_components/securitas_direct/securitas.py:126
Integration: securitas_direct (documentation, issues)
First occurred: December 18, 2020, 8:35:17 PM (1 occurrences)
Last logged: December 18, 2020, 8:35:17 PM

Ahora mismo solo tienes acceso a la nueva versión de My Verisure, haz clic en aceptar para acceder a la nueva versión.

Are you using this version? https://github.com/nragon/securitasdirect

The one at original repo ia still not updated.

1 Like

I have manually updated the files and now it works, it has downloaded the data from the .zip file and that is why I had problems. Thank you very much for your help

No problem, until the main author updates the repo with latest change please use that repo I’ve mentioned above. Meanwhile I’ll purpose this to be integrated on HA.

1 Like

Now it works!! wow, amazing work, thank you so much nragon!

Hi @nragon. Thanks for continuing the work on this. I can see your fork does not include the securitas_py file. Is this to be removed from custom components/securitas_direct folder or should the original version remain here?

I have updated manually the other files and home assistant will not restart (indicating a config error).
Leaving this file in the folder, no alarm entities are discovered.

Hi, idea is to use pysecuritas lib which can be found here.
If you’ve updated each file then probably homeassistant is using python compiled version (__pycache__ folder inside securitas_direct folder). Try to delete it a restart HA.
Only __init__.py, alarm_control_panel.py and manifest.json are needed.

Hi

I’m getting this log error.

Logger: homeassistant.components.hassio
Source: components/hassio/init.py:420
Integration: Hass.io (documentation, issues)
First occurred: 20:43:25 (3 occurrences)
Last logged: 20:51:48

Invalid config for [securitas_direct]: [installation] is an invalid option for [securitas_direct]. Check: securitas_direct->securitas_direct->installation. (See /config/configuration.yaml, line 47).

I’ve followed this tutorial https://github.com/nragon/securitasdirect and also your instructions to put the instalation number and language.

Hi @tneves

I believe README on both repos are outdated. They are misleading into configuring using the old version. I’ll be updating the repo soon.
You can download custom_components folder (not the zip) and replace it on your installation (ha)

This was the issue, many thanks. Deleting the securitas_py file and pycache folders followed by a restart and all is now working. Thanks again.

FYI: Pull request for integration ongoing

I managed to install it correctly, at least i hope. When I update the alarm via securitas app, after +/- 1min it gets the state updated on HA. But when I try to armed or disarmed it via HA, i get this error.

Logger: homeassistant.helpers.entity
Source: custom_components/securitas_direct/init.py:108
First occurred: 12:35:17 (2 occurrences)
Last logged: 12:35:23

Update for alarm_control_panel.securitas_************** fails*
Traceback (most recent call last):

  • File “/usr/local/lib/python3.8/site-packages/urllib3/connection.py”, line 169, in _new_conn*
  • conn = connection.create_connection(*
  • File “/usr/local/lib/python3.8/site-packages/urllib3/util/connection.py”, line 73, in create_connection*
  • for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM):*
  • File “/usr/local/lib/python3.8/socket.py”, line 918, in getaddrinfo*
  • for res in _socket.getaddrinfo(host, port, family, type, proto, flags):*
    socket.gaierror: [Errno -2] Name does not resolve

During handling of the above exception, another exception occurred:

Traceback (most recent call last):

  • File “/usr/local/lib/python3.8/site-packages/urllib3/connectionpool.py”, line 699, in urlopen*
  • httplib_response = self._make_request(*
  • File “/usr/local/lib/python3.8/site-packages/urllib3/connectionpool.py”, line 382, in _make_request*
  • self._validate_conn(conn)*
  • File “/usr/local/lib/python3.8/site-packages/urllib3/connectionpool.py”, line 1010, in _validate_conn*
  • conn.connect()*
  • File “/usr/local/lib/python3.8/site-packages/urllib3/connection.py”, line 353, in connect*
  • conn = self._new_conn()*
  • File “/usr/local/lib/python3.8/site-packages/urllib3/connection.py”, line 181, in _new_conn*
  • raise NewConnectionError(*
    urllib3.exceptions.NewConnectionError: <urllib3.connection.HTTPSConnection object at 0x7f966a8040>: Failed to establish a new connection: [Errno -2] Name does not resolve

During handling of the above exception, another exception occurred:

Traceback (most recent call last):

  • File “/usr/local/lib/python3.8/site-packages/requests/adapters.py”, line 439, in send*
  • resp = conn.urlopen(*
  • File “/usr/local/lib/python3.8/site-packages/urllib3/connectionpool.py”, line 783, in urlopen*
  • return self.urlopen(*
  • File “/usr/local/lib/python3.8/site-packages/urllib3/connectionpool.py”, line 783, in urlopen*
  • return self.urlopen(*
  • File “/usr/local/lib/python3.8/site-packages/urllib3/connectionpool.py”, line 783, in urlopen*
  • return self.urlopen(*
  • File “/usr/local/lib/python3.8/site-packages/urllib3/connectionpool.py”, line 755, in urlopen*
  • retries = retries.increment(*
  • File “/usr/local/lib/python3.8/site-packages/urllib3/util/retry.py”, line 573, in increment*
  • raise MaxRetryError(pool, url, error or ResponseError(cause))*
    urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host=‘mob2217.securitasdirect.es’, port=12010): Max retries exceeded with url: /WebService/ws.do?Country=PT&user=&pwd=&lang=pt&hash=*******&callby=AND_61&numinst=********&panel=SDVFAST&request=ACT_V2&ID=AND
    ________________________*******20201223123509&timefilter=3&activityfilter=0 (Caused by NewConnectionError(’<urllib3.connection.HTTPSConnection object at 0x7f966a8040>: Failed to establish a new connection: [Errno -2] Name does not resolve’))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):

  • File “/usr/src/homeassistant/homeassistant/helpers/entity.py”, line 278, in async_update_ha_state*
  • await self.async_device_update()*
  • File “/usr/src/homeassistant/homeassistant/helpers/entity.py”, line 474, in async_device_update*
  • raise exc*
  • File “/usr/local/lib/python3.8/concurrent/futures/thread.py”, line 57, in run*
  • result = self.fn(*self.args, *self.kwargs)
  • File “/config/custom_components/securitas_direct/alarm_control_panel.py”, line 101, in update*
  • hub.update_overview()*
  • File “/usr/src/homeassistant/homeassistant/util/init.py”, line 239, in wrapper*
  • result = method(*args, *kwargs)
  • File “/config/custom_components/securitas_direct/init.py”, line 108, in update_overview*
  • res = self.installation.get_activity_log()*
  • File “/usr/local/lib/python3.8/site-packages/pysecuritas/api/installation.py”, line 87, in get_activity_log*
  • return self.sync_request(“ACT_V2”, request_id, timefilter=TIME_FILTER, activityfilter=ACTIVITY_FILTER)*
  • File “/usr/local/lib/python3.8/site-packages/pysecuritas/api/installation.py”, line 171, in sync_request*
  • return self.request(payload)*
  • File “/usr/local/lib/python3.8/site-packages/pysecuritas/api/installation.py”, line 182, in request*
  • result = self.session.get(payload)*
  • File “/usr/local/lib/python3.8/site-packages/pysecuritas/core/session.py”, line 137, in get*
  • result = _get()*
  • File “/usr/local/lib/python3.8/site-packages/pysecuritas/core/session.py”, line 135, in _get*
  • return handle_response(self.get_or_create_session().get(BASE_URL, params=payload, timeout=self.timeout))*
  • File “/usr/local/lib/python3.8/site-packages/requests/sessions.py”, line 555, in get*
  • return self.request(‘GET’, url, *kwargs)
  • File “/usr/local/lib/python3.8/site-packages/requests/sessions.py”, line 542, in request*
  • resp = self.send(prep, *send_kwargs)
  • File “/usr/local/lib/python3.8/site-packages/requests/sessions.py”, line 655, in send*
  • r = adapter.send(request, *kwargs)
  • File “/usr/local/lib/python3.8/site-packages/requests/adapters.py”, line 516, in send*
  • raise ConnectionError(e, request=request)*
    requests.exceptions.ConnectionError: HTTPSConnectionPool(host=‘mob2217.securitasdirect.es’, port=12010): Max retries exceeded with url: /WebService/ws.do?Country=PT&user=&pwd=&lang=pt&hash=&callby=AND_61&numinst=*&panel=SDVFAST&request=ACT_V2&ID=AND_________________________*******20201223123509&timefilter=3&activityfilter=0 (Caused by NewConnectionError(’<urllib3.connection.HTTPSConnection object at 0x7f966a8040>: Failed to establish a new connection: [Errno -2] Name does not resolve’))

It seems to be a DNS error.
Are you able to perform a “telnet mob2217.securitasdirect.es 12010”
This should result in “Connected to mob2217.securitasdirect.es.akadns.net.” otherwise it’s a network issue and not from the component

How can I do that?

Thank you for your help

Open your terminal/command line and type it there

On my PC? It gives me this error.

C:\Users*****>telnet mob2217.securitasdirect.es 12010
‘telnet’ is not recognized as an internal or external command,
operable program or batch file.