danimtb / dasshio

Hass.io add-on to easily use Amazon Dash Buttons with Home Assistant
Apache License 2.0
192 stars 63 forks source link

Errors Log, config #101

Closed xekil closed 1 year ago

xekil commented 3 years ago

Hello,

I am encountering errors in the logs, but the automation is still working.

Maybe the problem is with the "service_data" syntax but I'm not sure I tried everything.

I am using UI (yaml) config and not the .json file.

thank you in advance

Configuration

timeout: 30
buttons:
  - name: Lipton
    address: 'XX:XX:XX:XX:XX:XX'
    domain: automation
    service: trigger
    service_data: '{"entity_id": "automation.dash_lipton"}'

Log

2020-10-02 14:58:07,042 | INFO | Reading config file: /data/options.json
2020-10-02 14:58:07,044 | INFO | Starting...
2020-10-02 14:58:07,044 | INFO | Starting sniffing...
2020-10-02 14:58:13,498 | INFO | Lipton button pressed!
2020-10-02 14:58:15,506 | ERROR | Unable to perform  request: Check [url], [body], [headers] and API password or                     [domain], [service] and [service_data] format.
Traceback (most recent call last):
  File "/usr/lib/python3.7/site-packages/urllib3/connectionpool.py", line 421, in _make_request
    six.raise_from(e, None)
  File "<string>", line 3, in raise_from
  File "/usr/lib/python3.7/site-packages/urllib3/connectionpool.py", line 416, in _make_request
    httplib_response = conn.getresponse()
  File "/usr/lib/python3.7/http/client.py", line 1344, in getresponse
    response.begin()
  File "/usr/lib/python3.7/http/client.py", line 306, in begin
    version, status, reason = self._read_status()
  File "/usr/lib/python3.7/http/client.py", line 267, in _read_status
    line = str(self.fp.readline(_MAXLINE + 1), "iso-8859-1")
  File "/usr/lib/python3.7/socket.py", line 589, in readinto
    return self._sock.recv_into(b)
socket.timeout: timed out
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
  File "/usr/lib/python3.7/site-packages/requests/adapters.py", line 449, in send
    timeout=timeout
  File "/usr/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/lib/python3.7/site-packages/urllib3/util/retry.py", line 400, in increment
    raise six.reraise(type(error), error, _stacktrace)
  File "/usr/lib/python3.7/site-packages/urllib3/packages/six.py", line 735, in reraise
    raise value
  File "/usr/lib/python3.7/site-packages/urllib3/connectionpool.py", line 672, in urlopen
    chunked=chunked,
  File "/usr/lib/python3.7/site-packages/urllib3/connectionpool.py", line 423, in _make_request
    self._raise_timeout(err=e, url=url, timeout_value=read_timeout)
  File "/usr/lib/python3.7/site-packages/urllib3/connectionpool.py", line 331, in _raise_timeout
    self, url, "Read timed out. (read timeout=%s)" % timeout_value
urllib3.exceptions.ReadTimeoutError: HTTPConnectionPool(host='hassio', port=80): Read timed out. (read timeout=2)
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
  File "/dasshio.py", line 65, in arp_display
    timeout=request_timeout_secs
  File "/usr/lib/python3.7/site-packages/requests/api.py", line 116, in post
    return request('post', url, data=data, json=json, **kwargs)
  File "/usr/lib/python3.7/site-packages/requests/api.py", line 60, in request
    return session.request(method=method, url=url, **kwargs)
  File "/usr/lib/python3.7/site-packages/requests/sessions.py", line 533, in request
    resp = self.send(prep, **send_kwargs)
  File "/usr/lib/python3.7/site-packages/requests/sessions.py", line 646, in send
    r = adapter.send(request, **kwargs)
  File "/usr/lib/python3.7/site-packages/requests/adapters.py", line 529, in send
    raise ReadTimeout(e, request=request)
requests.exceptions.ReadTimeout: HTTPConnectionPool(host='hassio', port=80): Read timed out. (read timeout=2)
2020-10-02 14:58:15,521 | INFO | Finishing sniffing
2020-10-02 14:58:15,521 | INFO | Packet captured! Waiting 30 seconds...
pilot1981 commented 3 years ago

me too have same errors, you solved it?

tri94 commented 3 years ago

snap, have the same problem too.

Any ideas?

prankard commented 1 year ago

A bit late to the party, but just installed this and this works for me, escaping with the backslash on the quotes:

- name: Finish
  address: 00:00:00:00:00:00
  domain: light
  service: toggle
  service_data: "{\"entity_id\": \"light.mylightidhere\"}"
danimtb commented 1 year ago

Closing as solved. Thanks for the reply @prankard