StyraHem / ShellyForHASS

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

OSError: [Errno 98] Address in use #456

Closed miljume closed 4 years ago

miljume commented 4 years ago

I receive the following error, usually at restarts

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

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

Running Home Assistant 0.115.2 and ShellyForHass 0.2.1.beta.1

simonjowett commented 4 years ago

I'm getting the same error. I've tried updating to the beta version of Home assistant 0.116 with no luck.

Logger: homeassistant Source: custom_components/shelly/init.py:194 First occurred: 2:52:09 PM (1 occurrences) Last logged: 2:52:09 PM


  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```
simonjowett commented 4 years ago

I've deleted then reinstalled the integration, All my 14 devices are ok until i reboot and I'm back in the same situation with all entities showing unavailable. NB: my IoT devices are on a Vlan (192.168.100.xx x and my home assistant is on 192.168.1.10

Am I going to be better off with a fully manual configuration?

hakana commented 4 years ago

This is probably because you have specified mqtt port to 1883 or something else that is already used by for example Home Assistants MQTT server. Please use another port number.

simonjowett commented 4 years ago

Hi Hakana - thanks for this - I've changed it to a 'dummy' number (1899). I tried to set it to 0 but the HA popup box won't go below 1. (bug?)

I guess I just misunderstood the nature of the data required here, as it comes directly under the HA IP address I wrongly assumed it was asking for the MQTT server on HA I've set-up.

The automatic integration has now found all the devices and entities, I'll go back now and delete the manual integration.

Thanks again for your help - I'm really a Shelly 'convert' (enthusiast).

hakana commented 4 years ago

Great, I will close this now.