Hi everybody and thanks to peterbuga for the much needed component
i’ve been able to configure a Sonoff Basic, but have the same bug reported for MacOS.
In detail, if it helps…
- configuration worked
- i can see the switch
- no errors by HA at startup
- the error only occurs when i try to turn the switch on or off
at startup:
2019-01-09 17:58:28 INFO (MainThread) [homeassistant.loader] Loaded sonoff from custom_components.sonoff
2019-01-09 17:58:28 WARNING (MainThread) [homeassistant.loader] You are using a custom component for sonoff which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you do experience issues with Home Assistant.
2019-01-09 17:58:28 INFO (MainThread) [homeassistant.setup] Setting up sonoff
2019-01-09 17:58:28 INFO (MainThread) [custom_components.sonoff] Found websocket address: eu-pconnect3.coolkit.cc
2019-01-09 17:58:28 INFO (MainThread) [homeassistant.setup] Setup of domain sonoff took 0.5 seconds.
but when i try to operate the switch i get the same error already described:
2019-01-09 18:01:10 ERROR (MainThread) [homeassistant.core] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
File “/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/homeassistant/helpers/service.py”, line 277, in _handle_service_platform_call
await getattr(entity, func)(**data)
File “/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/concurrent/futures/thread.py”, line 57, in run
result = self.fn(*self.args, **self.kwargs)
File “/var/root/.homeassistant/custom_components/switch/sonoff.py”, line 58, in turn_off
self._state = self._hass.data[SONOFF_DOMAIN].switch(False, self._deviceid, self._outlet)
File “/var/root/.homeassistant/custom_components/sonoff.py”, line 289, in switch
self._ws = self._get_ws()
File “/var/root/.homeassistant/custom_components/sonoff.py”, line 254, in _get_ws
self._ws = create_connection((‘wss://{}:8080/api/ws’.format(self._wshost)), timeout=10)
File “/var/root/.homeassistant/deps/lib/python/site-packages/websocket/_core.py”, line 511, in create_connection
websock.connect(url, **options)
File “/var/root/.homeassistant/deps/lib/python/site-packages/websocket/_core.py”, line 220, in connect
options.pop(‘socket’, None))
File “/var/root/.homeassistant/deps/lib/python/site-packages/websocket/_http.py”, line 126, in connect
sock = _ssl_socket(sock, options.sslopt, hostname)
File “/var/root/.homeassistant/deps/lib/python/site-packages/websocket/_http.py”, line 253, in _ssl_socket
sock = _wrap_sni_socket(sock, sslopt, hostname, check_hostname)
File “/var/root/.homeassistant/deps/lib/python/site-packages/websocket/_http.py”, line 232, in _wrap_sni_socket
server_hostname=hostname,
File “/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/ssl.py”, line 412, in wrap_socket
session=session
File “/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/ssl.py”, line 853, in _create
self.do_handshake()
File “/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/ssl.py”, line 1117, in do_handshake
self._sslobj.do_handshake()
ssl.SSLCertVerificationError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self signed certificate in certificate chain (_ssl.c:1051)