konnected-io / konnected-security

Konnected connects wired sensors and switches to SmartThings, Home Assistant, Hubitat and OpenHAB
https://konnected.io
Apache License 2.0
416 stars 322 forks source link

Error when trying to turn off Siren #95

Closed viperk1 closed 5 years ago

viperk1 commented 5 years ago

Hey there, I'm running Konnected v2.2.7 and Home Assistant 0.93.2 and everything works except for the Siren. I can turn it on, but turning it back off doesn't due to a connection refused error. This is intermittent but happens frequently. Attached is the full log of the error.

Log Details (ERROR)
Tue Jul 02 2019 19:16:21 GMT-0400 (Eastern Daylight Time)
HTTPConnectionPool(host='10.10.10.171', port=13017): Max retries exceeded with url: /device (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7f64ad8062b0>: Failed to establish a new connection: [Errno 111] Connection refused',))
Traceback (most recent call last):
  File "/srv/homeassistant/lib/python3.6/site-packages/urllib3/connection.py", line 141, in _new_conn
    (self.host, self.port), self.timeout, **extra_kw)
  File "/srv/homeassistant/lib/python3.6/site-packages/urllib3/util/connection.py", line 83, in create_connection
    raise err
  File "/srv/homeassistant/lib/python3.6/site-packages/urllib3/util/connection.py", line 73, in create_connection
    sock.connect(sa)
ConnectionRefusedError: [Errno 111] Connection refused

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/srv/homeassistant/lib/python3.6/site-packages/urllib3/connectionpool.py", line 601, in urlopen
    chunked=chunked)
  File "/srv/homeassistant/lib/python3.6/site-packages/urllib3/connectionpool.py", line 357, in _make_request
    conn.request(method, url, **httplib_request_kw)
  File "/usr/local/lib/python3.6/http/client.py", line 1239, in request
    self._send_request(method, url, body, headers, encode_chunked)
  File "/usr/local/lib/python3.6/http/client.py", line 1285, in _send_request
    self.endheaders(body, encode_chunked=encode_chunked)
  File "/usr/local/lib/python3.6/http/client.py", line 1234, in endheaders
    self._send_output(message_body, encode_chunked=encode_chunked)
  File "/usr/local/lib/python3.6/http/client.py", line 1026, in _send_output
    self.send(msg)
  File "/usr/local/lib/python3.6/http/client.py", line 964, in send
    self.connect()
  File "/srv/homeassistant/lib/python3.6/site-packages/urllib3/connection.py", line 166, in connect
    conn = self._new_conn()
  File "/srv/homeassistant/lib/python3.6/site-packages/urllib3/connection.py", line 150, in _new_conn
    self, "Failed to establish a new connection: %s" % e)
urllib3.exceptions.NewConnectionError: <urllib3.connection.HTTPConnection object at 0x7f64ad8062b0>: Failed to establish a new connection: [Errno 111] Connection refused

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/srv/homeassistant/lib/python3.6/site-packages/requests/adapters.py", line 449, in send
    timeout=timeout
  File "/srv/homeassistant/lib/python3.6/site-packages/urllib3/connectionpool.py", line 639, in urlopen
    _stacktrace=sys.exc_info()[2])
  File "/srv/homeassistant/lib/python3.6/site-packages/urllib3/util/retry.py", line 388, in increment
    raise MaxRetryError(_pool, url, error or ResponseError(cause))
urllib3.exceptions.MaxRetryError: HTTPConnectionPool(host='10.10.10.171', port=13017): Max retries exceeded with url: /device (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7f64ad8062b0>: Failed to establish a new connection: [Errno 111] Connection refused',))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/srv/homeassistant/lib/python3.6/site-packages/konnected/__init__.py", line 57, in put_device
    r = requests.put(url, json=payload, timeout=10)
  File "/srv/homeassistant/lib/python3.6/site-packages/requests/api.py", line 131, in put
    return request('put', url, data=data, **kwargs)
  File "/srv/homeassistant/lib/python3.6/site-packages/requests/api.py", line 60, in request
    return session.request(method=method, url=url, **kwargs)
  File "/srv/homeassistant/lib/python3.6/site-packages/requests/sessions.py", line 533, in request
    resp = self.send(prep, **send_kwargs)
  File "/srv/homeassistant/lib/python3.6/site-packages/requests/sessions.py", line 646, in send
    r = adapter.send(request, **kwargs)
  File "/srv/homeassistant/lib/python3.6/site-packages/requests/adapters.py", line 516, in send
    raise ConnectionError(e, request=request)
requests.exceptions.ConnectionError: HTTPConnectionPool(host='10.10.10.171', port=13017): Max retries exceeded with url: /device (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7f64ad8062b0>: Failed to establish a new connection: [Errno 111] Connection refused',))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/srv/homeassistant/lib/python3.6/site-packages/homeassistant/components/websocket_api/commands.py", line 121, in handle_call_service
    connection.context(msg))
  File "/srv/homeassistant/lib/python3.6/site-packages/homeassistant/core.py", line 1141, in async_call
    self._execute_service(handler, service_call))
  File "/srv/homeassistant/lib/python3.6/site-packages/homeassistant/core.py", line 1163, in _execute_service
    await handler.func(service_call)
  File "/srv/homeassistant/lib/python3.6/site-packages/homeassistant/helpers/entity_component.py", line 194, in handle_service
    required_features
  File "/srv/homeassistant/lib/python3.6/site-packages/homeassistant/helpers/service.py", line 316, in entity_service_call
    future.result()  # pop exception if have
  File "/srv/homeassistant/lib/python3.6/site-packages/homeassistant/helpers/service.py", line 337, in _handle_service_platform_call
    await getattr(entity, func)(**data)
  File "/usr/local/lib/python3.6/concurrent/futures/thread.py", line 56, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/srv/homeassistant/lib/python3.6/site-packages/homeassistant/components/konnected/switch.py", line 89, in turn_off
    self._pin_num, int(self._activation == STATE_LOW))
  File "/srv/homeassistant/lib/python3.6/site-packages/konnected/__init__.py", line 60, in put_device
    raise Client.ClientError(err)
konnected.Client.ClientError: HTTPConnectionPool(host='10.10.10.171', port=13017): Max retries exceeded with url: /device (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7f64ad8062b0>: Failed to establish a new connection: [Errno 111] Connection refused',))
viperk1 commented 5 years ago

Well. I'll close this. The issue was power related since my siren was drawing more amps than expected. I moved it to it's own power supply and no issues since.