segalion / securitasdirect

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

Broken after 107.4 update #12

Closed Vartkat closed 4 years ago

Vartkat commented 4 years ago

Here is the log :

2020-03-21 14:58:20 ERROR (MainThread) [homeassistant.setup] Error during setup of component securitas_direct
Traceback (most recent call last):
  File "/usr/local/lib/python3.7/site-packages/urllib3/connection.py", line 157, in _new_conn
    (self._dns_host, self.port), self.timeout, **extra_kw
  File "/usr/local/lib/python3.7/site-packages/urllib3/util/connection.py", line 84, in create_connection
    raise err
  File "/usr/local/lib/python3.7/site-packages/urllib3/util/connection.py", line 74, in create_connection
    sock.connect(sa)
socket.timeout: timed out

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.7/site-packages/urllib3/connectionpool.py", line 672, in urlopen
    chunked=chunked,
  File "/usr/local/lib/python3.7/site-packages/urllib3/connectionpool.py", line 376, in _make_request
    self._validate_conn(conn)
  File "/usr/local/lib/python3.7/site-packages/urllib3/connectionpool.py", line 994, in _validate_conn
    conn.connect()
  File "/usr/local/lib/python3.7/site-packages/urllib3/connection.py", line 300, in connect
    conn = self._new_conn()
  File "/usr/local/lib/python3.7/site-packages/urllib3/connection.py", line 164, in _new_conn
    % (self.host, self.timeout),
urllib3.exceptions.ConnectTimeoutError: (<urllib3.connection.VerifiedHTTPSConnection object at 0xf32e89f0>, 'Connection to mob2217.securitasdirect.es timed out. (connect timeout=5)')

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.7/site-packages/requests/adapters.py", line 449, in send
    timeout=timeout
  File "/usr/local/lib/python3.7/site-packages/urllib3/connectionpool.py", line 720, in urlopen
    method, url, error=e, _pool=self, _stacktrace=sys.exc_info()[2]
  File "/usr/local/lib/python3.7/site-packages/urllib3/util/retry.py", line 436, 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=FR&user=XXXXXXXXXXX&pwd=XXXXXXXX&lang=fr&request=LOGIN&ID=IPH_________________________XXXXXXXXXXXXXXXXXXXXXXXXXX (Caused by ConnectTimeoutError(<urllib3.connection.VerifiedHTTPSConnection object at 0xf32e89f0>, 'Connection to mob2217.securitasdirect.es timed out. (connect timeout=5)'))

During handling of the above exception, another exception occurred:

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 61, in setup
    if not HUB.login():
  File "/config/custom_components/securitas_direct/__init__.py", line 90, in login
    ret = self.session.login()
  File "/config/custom_components/securitas_direct/securitas.py", line 88, in login
    resp = requests.post(self.BASE_URL, params=self._params, timeout=5)
  File "/usr/local/lib/python3.7/site-packages/requests/api.py", line 119, in post
    return request('post', url, data=data, json=json, **kwargs)
  File "/usr/local/lib/python3.7/site-packages/requests/api.py", line 61, in request
    return session.request(method=method, url=url, **kwargs)
  File "/usr/local/lib/python3.7/site-packages/requests/sessions.py", line 530, in request
    resp = self.send(prep, **send_kwargs)
  File "/usr/local/lib/python3.7/site-packages/requests/sessions.py", line 643, in send
    r = adapter.send(request, **kwargs)
  File "/usr/local/lib/python3.7/site-packages/requests/adapters.py", line 504, in send
    raise ConnectTimeout(e, request=request)
requests.exceptions.ConnectTimeout: HTTPSConnectionPool(host='mob2217.securitasdirect.es', port=12010): Max retries exceeded with url: /WebService/ws.do?Country=FR&user=XXXXXXXXXXXX&pwd=XXXXXXXXX&lang=fr&request=LOGIN&ID=IPH_________________________XXXXXXXXXXXXXXXXXXXXXXXXXX (Caused by ConnectTimeoutError(<urllib3.connection.VerifiedHTTPSConnection object at 0xf32e89f0>, 'Connection to mob2217.securitasdirect.es timed out. (connect timeout=5)'))
2020-03-21 14:58:24 ERROR (MainThread) [homeassistant.core] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 425, in _async_add_entity
    raise HomeAssistantError(msg)

Result is

image

Running Home Assistant 107.4 in Docker on Ubuntu 19.10.

Vartkat commented 4 years ago

I was wondering if changing the BASE_URL in securitas.py would help ? What would be the URL for France ?

kepeket commented 4 years ago

Running on a raspi Hass OS, 107.4, all is working properly

segalion commented 4 years ago

Think I can close this old. Last update are reported to work fine with versions ≥ 0.115