Sonoff /eWeLink component for original firmware

you provided wrong user and password :expressionless: ?
i’m going to catch and throw a message for this error in the feature, but (with all due respect) this was one of the last worries while developing this component.

in your secrets.yaml file just add:

sonoff_username: '[email protected]'
sonoff_password: 'password_with_strange_!@#$%^&*()P{'
1 Like

As it should be my friend! I will keep trying! The app isn’t very good. I’m trying to just reset my password because i can’t for sure remember it. But I order to do that I need to know the old one lol

This is AWESOME @peterbuga, Thank You for putting this out for us! Works great! Im going to order more switches now!

@Corey_Maxim glad you had it sort out :wink:
Care to share what types of devices you have and if possible the firmware version you’re running on so I can add them to the compatibility list if they aren’t there already ? Thanks

So far I only have two Sonoff Basics running firmware 3.5.4 - Hassio 83.3

I used this component and switch is visible in the HA, but I can’t turn on the switch using HA. Any ideas, what is wrong?
Error received:
Error doing job: Task exception was never retrieved
12:45 deps/lib/python/site-packages/websocket/_http.py (ERROR)

i really have no idea :confused: never saw this kind of problem

is this literally the only error you get while trying to change the state of the switch?

i need more details to figure out what might be the problem: sonoff version + firmware, HA install type, also, a shot in the dark but try to figure what version of websockets from pypi you have installed

alternatively, you could give a try to “websocket” branch, it’s a rewrite of the component but i’m still testing it so it’s not merged in “master”

Hi,
I have HA at MAC and latest version of the sonoff firmware.
Detailed log:
Error doing job: Task exception was never retrieved
Traceback (most recent call last):
File “/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/asyncio/tasks.py”, line 181, in _step
result = coro.throw(exc)
File “/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/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.6/lib/python3.6/asyncio/futures.py”, line 331, in iter
yield self # This tells Task to wait for completion.
File “/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/asyncio/tasks.py”, line 244, in _wakeup
future.result()
File “/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/asyncio/futures.py”, line 244, in result
raise self._exception
File “/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/concurrent/futures/thread.py”, line 55, in run
result = self.fn(*self.args, **self.kwargs)
File “/Users/robertp/.homeassistant/custom_components/sonoff.py”, line 437, in turn_on
self._state = self._hass.data[DOMAIN].switch(True, self._deviceid, self._outlet)
File “/Users/robertp/.homeassistant/custom_components/sonoff.py”, line 289, in switch
self._ws = self._get_ws()
File “/Users/robertp/.homeassistant/custom_components/sonoff.py”, line 254, in _get_ws
self._ws = create_connection((‘wss://{}:8080/api/ws’.format(self._wshost)), timeout=10)
File “/Users/robertp/.homeassistant/deps/lib/python/site-packages/websocket/_core.py”, line 511, in create_connection
websock.connect(url, **options)
File “/Users/robertp/.homeassistant/deps/lib/python/site-packages/websocket/_core.py”, line 220, in connect
options.pop(‘socket’, None))
File “/Users/robertp/.homeassistant/deps/lib/python/site-packages/websocket/_http.py”, line 126, in connect
sock = _ssl_socket(sock, options.sslopt, hostname)
File “/Users/robertp/.homeassistant/deps/lib/python/site-packages/websocket/_http.py”, line 253, in _ssl_socket
sock = _wrap_sni_socket(sock, sslopt, hostname, check_hostname)
File “/Users/robertp/.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.6/lib/python3.6/ssl.py”, line 401, in wrap_socket
_context=self, _session=session)
File “/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/ssl.py”, line 808, in init
self.do_handshake()
File “/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/ssl.py”, line 1061, in do_handshake
self._sslobj.do_handshake()
File “/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/ssl.py”, line 683, in do_handshake
self._sslobj.do_handshake()
ssl.SSLError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:749)

1 Like

looks like python on mac really tries to validate the wss connection.
i’ll push a fix to bypass this and let you know (for reference, the sonoff devices don’t do any kind of ssl check, they just need a ssl connection :laughing:)

@peterbuga - fkn good work. I’ve been waiting on this for long time.

Got it working on my dev environment at the first shoot. Pushing it to prod tomorrow :slight_smile:

1 Like

@peterbuga you can add " Sonoff T1 US: 1-3 Gang US AU Standard WiFi RF Smart Wall Touch Light Switch" to your list (Sonoff 1 Gang wall switch)

@martin.iluminatti thanks :+1: i will add it. by any chance can you specify the firmware version too?

Sonoff POW2 working fine with https://github.com/peterbuga/HASS-sonoff-ewelink :slight_smile: (until now only can turn on and turn off)

Thank you, this is really great!

1 Like

That’s pretty much all you can do to it right now :sweat_smile:

There is already a request on github regarding the possibility to use the monitor capabilities of these devices inside HA. I plan to integrate it also but because I don’t have a device to test it, it might take a while :roll_eyes:

1 Like

Test with Sonoff S31. Works fine as a switch. ^^

Ifan02 works with this without issue. It creates 4 switchs, 1 for the light and 3 for the various fan speeds.

Thanks for putting this together!

That’s great.
Have a spare one that I didn’t get time to install.
Thanks.

Glad to hear that :+1:

I would highly appreciate if you could send me the output of this script https://github.com/peterbuga/HASS-sonoff-ewelink/tree/master/sonoff-debug (help me to help you kind of deal) and I’ll try to convert the Ifan02 in a proper fan entity inside HA. thanks

Manufacturer: Sonoff
Model: T1 1C
Firmware Version 2.6.0

I have been unable to find a Tasmota firmware that would work with this 2 channel momentary inching relay that I use with my 2 garage doors:

MHCozy 2 ch relay on Amazon

Decided to give this a go since the relay uses the Ewelink app. It works very well. Thank you for putting this together!

1 Like