Sonoff /eWeLink component for original firmware

I’m using HA 106.6 in a raspberry pi, but today I had to restart HA since it was not responding.
Unfortunately, HA didn’t reboot correctly (safe mode was automatically enabled) because of a couple of errors:

  • trusted_networks invalid (it’s not true, I didn’t change anything)
  • sonoff integration not found (it’s correctly configured and placed in right folder)

But if delete those entries from configuration file and then re-add them one at a time (two reboots are required in sequence), HA boots without any problem!

I think the 106.6 release broke something in the reboot process of the docker container…

Regarding sonoff L1 led strip integration. For now, there is no elegant solution by @peterbuga, I can offer to use broadlink RM PRO or Mini to control this strip. Here are the codes of broadlink corresponding to remote buttons as on the image.

1 brightness +
JgCAAAABJ5IUERQSExITEhMSFBEUERQSEzYUNRQ2EzYUEhM2EzYUNhQRFBEUERQSExITEhMSFBITNhM2FDYTNhQ1FDYTNhQ2EwAFPwABJkkUAAxOAAEnSRMADE8AASdJFAAMUAABJUoSAAxRAAEnSRMADFAAASdJEwAMUAABJkkUAA0FAAAAAAAAAAA=

2 brightness -
JgBkAAABKJIVEBUQFRAVEBURFBEVEBUQFTUUNRU0FTUUERU0FTUUNRU1FRAVEBUQFRAVERQRFBEVEBU1FDUVNBU1FTQVNRQ1FQAFPQABJ0cWAAejBwAEngABK0cVAAxJAAEnSRMADQUAAAAA

3 off
JgBmAAoHCgAIvgABKJEVEBYQFRAVEBUQFRAVERUQFTQVNBU1FTQVEBY0FTQVNRUQFTQVEBYQFRAVEBUQFRAWNBUQFTQVNRU0FTQVNRU0FQAFPAABKEcVAAxLAAEoRxUADEwAASlGFgANBQAA

4 on
JgBgAAABKJEVEBURFBEUERQRFRAVEBURFDUVNBU1FDUVEBU0FTUVNRQ1FTUUERQRFBEVEBUQFREUERQRFTQVNRQ1FTUUNRU0FQAFPQABKEcVAAxMAAEoRxUADEsAAShHFQANBQAAAAAAAAAA

5 R
JgBgAAABKJEWEBUQFg8WDxYPFhAVEBQRFjMWNBU0FjQUERU0FjQVNBUQFREVNBYPFg8VEBURFRAWMxY0FRAWMxY0FTQWNBU0FgAFPA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UERQ2EzYUNhMSExITNhUQFTUUERQRFREUNRQ1FREUNRUQFTUUNRU0FQAFPQABKUUXAAxMAAEoRxUADQU=

22
JgBYAAABJ5IUEhMSExITEhMSFBEUERQSEzYUNRQ2EzYUERQ2EzYUNhM2FBEUNhMSEzYUERQRFBITEhQ1FBITNhMSFDUUNhM2FAAFPQABJ0gUAAxNAAEpRxUADQU=

23
JgBYAAABKZAVEBYQFRAVEBUQFRAVERUQFTQVNBU1FTQVEBU0FjQVNBURFTQVNBUQFjQVEBUQFRAWNBUQFRAVNBURFTQVNBU1FQAFOwABKEcVAAxLAAEnSBQADQU=

24 SMOOTH
JgBYAAABJ5MSExITExITExITExISExMSFDUUNhQ1FTUUERU0FTQVNRU0FjQVNBUQFjQVEBURFBEVEBUQFRAVNBURFTQVNBY0FQAFPAABKUcVAAxMAAEoRxUADQU=

Looks like it stopped working with 0.107.6 latst update

1 Like

Worked for me in 107.6, stopped working with 107.7.

I did full un-install , re-install and it works again.

1 Like

It sorted itself out after a couple of HA restarts.

Did you try it on 107.7 or 107.6 ?

I would like to let you know that with version 3.3.1 POW R2 is giving the datas with using HA 0.107.7 with Python 3.8.

I only have warning message, and may it was already talk about it, but did not find solution for this:

2020-03-27 14:36:03 ERROR (Thread-2) [custom_components.sonoff] websocket error: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self signed certificate in certificate chain (_ssl.c:1108)
2020-03-27 14:36:03 DEBUG (Thread-2) [custom_components.sonoff] websocket closed
2020-03-27 14:36:03 DEBUG (Thread-2) [custom_components.sonoff] (re)init websocket
2020-03-27 14:36:03 ERROR (Thread-2) [custom_components.sonoff] websocket error: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self signed certificate in certificate chain (_ssl.c:1108)
2020-03-27 14:36:03 DEBUG (Thread-2) [custom_components.sonoff] websocket closed
2020-03-27 14:36:03 DEBUG (Thread-2) [custom_components.sonoff] (re)init websocket
2020-03-27 14:36:03 ERROR (Thread-2) [custom_components.sonoff] websocket error: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self signed certificate in certificate chain (_ssl.c:1108)
2020-03-27 14:36:03 DEBUG (Thread-2) [custom_components.sonoff] websocket closed

The OS is synology with opkg. However this is not an exactly problem, but full of my HA log.
Anyone can help to eliminate it? Thank you.

It worjed fine on 6, had a missing entity after upgrading to 7 but it went back to normal after another reboot.

Any idea how to change the friendly name in Hassio? Currently it is using the name from ewelink app.

Open Web Interface , Goto Configuration/Customizations. Find your SonOff entity in a drop down box . Change Name attribute. Click Save.

I’m really enjoying the component. I’m trying to automate my Sonoff devices. I can switch them on and off manually. I’ve created an action, any advice on why it’s not working?

You need to use service “switch.turn_on”, “switch.turn_off” or “switch.toggle”.

EDIT: Now I wonder what kind of an usecase is “condition” as an action anyway. :thinking:

1 Like

This is the first time for me configuring automation. Using service action type worked. Thank you.

@peterbuga
Update fw for sonoff basic and 4chpro 3.3.0 --> 3.4.0 ok

@peterbuga, i have a hassio system in which i monitor my AC’s units energy consumption using some tp-link hs110 plugs and a sonoff pow r2.
I have forced a 1 sec scan interval to all entities using this automation:

`

  • id: update_tp_link
    initial_state: ‘on’
    trigger:
    • platform: time_pattern
      seconds: ‘/1’ # every 1 seconds
      action:
    • service: homeassistant.update_entity
      data:
      entity_id:
      • switch.fujitsu_asyg24klca
      • switch.daikin_atxc25b
      • switch.carrier_42qhb09d8sa
        `

This is working fine on tplinks.

Is there a way to have a similar result to the sonoff plug?
I know that there is a 60secs limitation to scan_interval.
Is it possible to remove this limitation?
As it is i have this really ugly and difficult to analyze result as you can see in the following picture of grafana where the really smooth blue line we can see an AC unit having a 1sec interval from a tplink plug, while with the orange line we can see the 60secs blocks coming from sonoff:


Thanks

hi @liakjim
1st of all the Pow R2 stopped actively reporting on firmwares 3.x+
2nd even if you still are on lower firmware and Pow R2 still works for you the changes in reported values are definitely not changing by second => i assume you’ll still have “blocky” reports (the scan_interval is used as a polling fallback mechanism when/if websocket fail, but even so read next…)
3rd it has been softly reported that iTead will soon-ish block the usage of this component and others alike based on its logic, so I guess it doesn’t make much sense to fix more of it (you’ll have to make peace with your OCD :stuck_out_tongue:) - the reason for this is I assume we killed their servers with possible thousands of “simulated apps” running 24/7, luckily some of the new firmwares have some kind of local controlling possibilities so it’s not all bad

Hi!

  1. No they didn’t. The screenshot i uploaded is from a pow r2 with 3.4.0 firmware.
  2. Same as 1.
  3. Interesting.

I have a sonoff wall switch which I trigger through my lights dashboard with switch on and off .

I have however noticed recently that the input booleans I was using to get the status updates from the sonoff app are no longer working, so if I turn the light on and off either through the app or the wall switch it doesn’t show in the lights card .

The logs show the following error :

ERROR (zeroconf-ServiceBrowser_eWeLink_1000883763._ewelink._tcp.local.) [homeassistant.components.switch.sonoff_lan_mode_r3] Error updating service for device 1000883763: encoding without a string argument, probably wrong API key: eWeLink_1000883763._ewelink._tcp.local

After googling the error I came across this thread so I believe it’s related to the firmware update (currently on 3.3.0) .

Turning the light on and off still works perfect but the updates don’t …

Is there any way around this guys ?

Ricardo, that error is from my component. With that component you need to specify the API key in the configuration.yml