You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Background
The private alarm system business of Securitas Direct in Sweden is since some time (years) transferred to Verisure. AFAIK Securitas Direct is a part of the Verisure corporate group. Securitas Direct is still used in Sweden as a brand but not for the consumer market.
I had Home Assistant working with Verisure's system some 1-2 years ago, though I don't remember the details of how I set it up. I was only trying out Home Assistant for a short time then and have not used it anymore until I bought a HA Green a couple of days ago and have now set up HA to work nicely with everything I want except Verisure.
Issue
So it seemed this repository/integration was my best bet (or?!) and I have set things up but I can't get it to log in and connect to my Verisure account.
Documentation reference:
Country Code. One of BR (Brasil), CL (Chile), ES (Spain), FR (France), GB (Great Britain), IE (Ireland), IT (Italy). If you are outside of those countries, try entering "default" and if that doesn't work open an issue to see if we can expand.
Since I am in Sweden I have tried with "default" country code but immediately after submitting the login information I get "Unknown error occurred". It does not matter if I have checked "Use 2FA" or not.
The errors I see in HA logs make me wonder if the "default" thing could be working for anyone at all?
Judging from the logs it seems that the problem that happens now is that it tries to connect to the address customers.securitasdirect.default which I can't imagine is expected to resolve.
Also noteworthy is that for Sweden the web access pages are now based at https://mypages.verisure.com/.
Logs included below. I redacted some information that did not seem wise to post publicly.
Logger: aiohttp.server
Source: /usr/local/lib/python3.13/site-packages/aiohttp/web_protocol.py:451
First occurred: 5:48:09 PM (3 occurrences)
Last logged: 5:52:27 PM
Error handling request
Traceback (most recent call last):
File "/usr/local/lib/python3.13/site-packages/aiohttp/resolver.py", line 103, in resolve
resp = await self._resolver.getaddrinfo(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
...<5 lines>...
)
^
aiodns.error.DNSError: (11, 'Could not contact DNS servers')
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/usr/local/lib/python3.13/site-packages/aiohttp/connector.py", line 1351, in _create_direct_connection
hosts = await self._resolve_host(host, port, traces=traces)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.13/site-packages/aiohttp/connector.py", line 995, in _resolve_host
return await asyncio.shield(resolved_host_task)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.13/site-packages/aiohttp/connector.py", line 1026, in _resolve_host_with_throttle
addrs = await self._resolver.resolve(host, port, family=self._family)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.13/site-packages/aiohttp/resolver.py", line 112, in resolve
raise OSError(None, msg) from exc
OSError: [Errno None] Could not contact DNS servers
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/config/custom_components/securitas/securitas_direct_new_api/apimanager.py", line 152, in _execute_request
async with self.http_client.post(
~~~~~~~~~~~~~~~~~~~~~^
self.api_url, headers=headers, json=content
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
) as response:
^
File "/usr/local/lib/python3.13/site-packages/aiohttp/client.py", line 1425, in aenter
self._resp: _RetType = await self._coro
^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.13/site-packages/aiohttp/client.py", line 703, in _request
conn = await self._connector.connect(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
req, traces=traces, timeout=real_timeout
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
)
^
File "/usr/local/lib/python3.13/site-packages/aiohttp/connector.py", line 548, in connect
proto = await self._create_connection(req, traces, timeout)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.13/site-packages/aiohttp/connector.py", line 1056, in _create_connection
_, proto = await self._create_direct_connection(req, traces, timeout)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.13/site-packages/aiohttp/connector.py", line 1357, in _create_direct_connection
raise ClientConnectorDNSError(req.connection_key, exc) from exc
aiohttp.client_exceptions.ClientConnectorDNSError: Cannot connect to host customers.securitasdirect.default:443 ssl:default [Could not contact DNS servers]
The above exception was the direct cause of the following exception:
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/local/lib/python3.13/site-packages/aiohttp/web_protocol.py", line 480, in _handle_request
resp = await request_handler(request)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.13/site-packages/aiohttp/web_app.py", line 569, in _handle
return await handler(request)
^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.13/site-packages/aiohttp/web_middlewares.py", line 117, in impl
return await handler(request)
^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/http/security_filter.py", line 92, in security_filter_middleware
return await handler(request)
^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/http/forwarded.py", line 83, in forwarded_middleware
return await handler(request)
^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/http/request_context.py", line 26, in request_context_middleware
return await handler(request)
^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/http/ban.py", line 86, in ban_middleware
return await handler(request)
^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/http/auth.py", line 242, in auth_middleware
return await handler(request)
^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/http/headers.py", line 32, in headers_middleware
response = await handler(request)
^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/helpers/http.py", line 73, in handle
result = await handler(request, **request.match_info)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/http/decorators.py", line 81, in with_admin
return await func(self, request, *args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/config/config_entries.py", line 222, in post
return await super().post(request, flow_id)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/http/data_validator.py", line 74, in wrapper
return await method(view, request, data, *args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/helpers/data_entry_flow.py", line 122, in post
result = await self._flow_mgr.async_configure(flow_id, data)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 367, in async_configure
result = await self._async_configure(flow_id, user_input)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 414, in _async_configure
result = await self._async_handle_step(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
flow, cur_step["step_id"], user_input
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
)
^
File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 517, in _async_handle_step
result: _FlowResultT = await getattr(flow, method)(user_input)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/config/custom_components/securitas/config_flow.py", line 157, in async_step_user
] = await self.securitas.validate_device()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/config/custom_components/securitas/init.py", line 357, in validate_device
return await self.session.validate_device(False, None, None)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/config/custom_components/securitas/securitas_direct_new_api/apimanager.py", line 289, in validate_device
data = err.args[1]["errors"][0]["data"]
~~~~~~~~~~~^^^^^^^^^^
TypeError: 'NoneType' object is not subscriptable
The text was updated successfully, but these errors were encountered:
Hey @kribjo, thanks for sharing this detailed investigation. As you mention in your post, this is the repository for the new API and I don't know if the same API/Operations are being used.
I actually just got this to work with the core Verisure integration, thanks to a hint from another user in my country that the password cannot be too long... I guess that probably indicates that all Verisure users who log in through https://mypages.verisure.com/ should use the core Verisure integration.
The fix for me was to change my long and secure password to just using a-zA-Z0-9 and shorten it a bit.
Sorry for wasting your time here. I hope my tale can be of use for others in the future.
Background
The private alarm system business of Securitas Direct in Sweden is since some time (years) transferred to Verisure. AFAIK Securitas Direct is a part of the Verisure corporate group. Securitas Direct is still used in Sweden as a brand but not for the consumer market.
I had Home Assistant working with Verisure's system some 1-2 years ago, though I don't remember the details of how I set it up. I was only trying out Home Assistant for a short time then and have not used it anymore until I bought a HA Green a couple of days ago and have now set up HA to work nicely with everything I want except Verisure.
Issue
So it seemed this repository/integration was my best bet (or?!) and I have set things up but I can't get it to log in and connect to my Verisure account.
Documentation reference:
Since I am in Sweden I have tried with "default" country code but immediately after submitting the login information I get "Unknown error occurred". It does not matter if I have checked "Use 2FA" or not.
The errors I see in HA logs make me wonder if the "default" thing could be working for anyone at all?
Judging from the logs it seems that the problem that happens now is that it tries to connect to the address customers.securitasdirect.default which I can't imagine is expected to resolve.
Also noteworthy is that for Sweden the web access pages are now based at https://mypages.verisure.com/.
I also note that based on the page https://mypages.verisure.com/ it seems that all countries other than SE/FI/DK/NL/DE/NO/FR/BE/UK are sent to https://customers.securitasdirect.es/owa-static/login , while those mentioned are sent to https://mypages.verisure.com/login . Would this imply that the same solution should work, or perhaps not work, for all the mentioned countries?
Logs included below. I redacted some information that did not seem wise to post publicly.
The text was updated successfully, but these errors were encountered: