StyraHem / ShellyForHASS

Shelly smart home platform for Home Assistant
MIT License
621 stars 111 forks source link

[BUG] Task exception was never retrieved #442

Open Phatee opened 4 years ago

Phatee commented 4 years ago

Environment

Describe the bug

ShellyForHass doesn't see my new Shelly duo bulb device. Logger: homeassistant Source: custom_components/shelly/init.py:194 First occurred: 12:40:50 PM (1 occurrences) Last logged: 12:40:50 PM Error doing job: Task exception was never retrieved Traceback (most recent call last): File "/config/custom_components/shelly/init.py", line 194, in start_up pys.start() File "/usr/local/lib/python3.8/site-packages/pyShelly/init.py", line 126, in start self._coap.start() File "/usr/local/lib/python3.8/site-packages/pyShelly/coap.py", line 27, in start self._init_socket() File "/usr/local/lib/python3.8/site-packages/pyShelly/coap.py", line 44, in _init_socket socket.inet_aton(self._root.host_ip)) OSError: illegal IP address string passed to inet_aton

Steps to Reproduce

1: New device added via shelly app to my network 2: HassIO is reporting error in log

Expected behavior

New device should be visible in the ShellyforHass

Screenshots

Traceback/Error logs

Logger: homeassistant Source: custom_components/shelly/init.py:194 First occurred: 12:40:50 PM (1 occurrences) Last logged: 12:40:50 PM Error doing job: Task exception was never retrieved Traceback (most recent call last): File "/config/custom_components/shelly/init.py", line 194, in start_up pys.start() File "/usr/local/lib/python3.8/site-packages/pyShelly/init.py", line 126, in start self._coap.start() File "/usr/local/lib/python3.8/site-packages/pyShelly/coap.py", line 27, in start self._init_socket() File "/usr/local/lib/python3.8/site-packages/pyShelly/coap.py", line 44, in _init_socket socket.inet_aton(self._root.host_ip)) OSError: illegal IP address string passed to inet_aton

Additional context

miljume commented 3 years ago

I have almost the same issue but in my case the traceback look like this

Logger: homeassistant
Source: custom_components/shelly/__init__.py:194
First occurred: 19:05:47 (1 occurrences)
Last logged: 19:05:47

Error doing job: Task exception was never retrieved
Traceback (most recent call last):
  File "/config/custom_components/shelly/__init__.py", line 194, in start_up
    pys.start()
  File "/usr/local/lib/python3.8/site-packages/pyShelly/__init__.py", line 130, in start
    self._mqtt.start()
  File "/usr/local/lib/python3.8/site-packages/pyShelly/mqtt.py", line 98, in start
    self._init_socket()
  File "/usr/local/lib/python3.8/site-packages/pyShelly/mqtt.py", line 104, in _init_socket
    sock.bind((self._root.bind_ip, self._root.mqtt_port))
OSError: [Errno 98] Address in use
hakana commented 3 years ago

I have almost the same issue but in my case the traceback look like this

Logger: homeassistant
Source: custom_components/shelly/__init__.py:194
First occurred: 19:05:47 (1 occurrences)
Last logged: 19:05:47

Error doing job: Task exception was never retrieved
Traceback (most recent call last):
  File "/config/custom_components/shelly/__init__.py", line 194, in start_up
    pys.start()
  File "/usr/local/lib/python3.8/site-packages/pyShelly/__init__.py", line 130, in start
    self._mqtt.start()
  File "/usr/local/lib/python3.8/site-packages/pyShelly/mqtt.py", line 98, in start
    self._init_socket()
  File "/usr/local/lib/python3.8/site-packages/pyShelly/mqtt.py", line 104, in _init_socket
    sock.bind((self._root.bind_ip, self._root.mqtt_port))
OSError: [Errno 98] Address in use

This is because you have set the MQTT_PORT to a port already used. Just use another port. This is not related to this issue.

hakana commented 3 years ago

This is because you have set HOST_IP to an invalid or not existing IP address.

HOST_IP must be set to an IP address existing on the HA computer. Run terminal in HA and see what IP address you have.