Sonoff /eWeLink component for original firmware

to put it bluntly the Sonoff RF Bridge is NOT SUPPORTED at all with the current component not matter the firmware version…

but there are some good news though :raised_hands: a couple of persons donated recently to the project and per manifesto i used the funds to buy new sonoff devices to integrate. i picked a RF bridge and a motion detector (slightly bad news i had to pick the cheapest prices i could find and now I’m waiting for the shipment, for several weeks now). after i get it i’m going to start working on it, soo there’s some hope for you :wink:

Thanks :pray:
But I sow at the compatibility list in your table


That you support sonoff rf bridge version 3.0 . what I have wrong ?
Regards
David

@david78455 you read it wrong :stuck_out_tongue: Sonoff RF is not Sonoff RF Bridge they are 2 different devices, google it!
also, there’s a mention in the foot of the compatibility table: just because there’s no yes in a specific box doesn’t mean it’s not working, it means no one reported back that it works 100% (meaning there is a high change that it works with a wider fw versions)

Thank you very much :pray: waiting for your good news :slight_smile:
Best Regards
David

Hi
do you know if it will integrate with the SONOFF L1 Smart LED?

1 Like

Thanks for all the work to get this intergrated, i’m trying to get the custom component Sonoff/eWeLink working as an automation with very little success
the custom component and switch creation works on the main lovelace ui,
when i go to set the automation up like below

Trigger : Trigger type-SUN: Event-Sunset,

Action : Action Type-Condition: Condition Type-State: Entity-switch.sonoff_1000796972: State-on

Nothing happens when i manually trigger it.
I can’t find the switch in anything other sub menu than an action type-“Condition” condition type - “state”
and i have looked in the init .py to see if there were any other Attrib values for on/off

thank you for any pointers

from my automations.yaml

id: '1571719032416'
  alias: Sunset Schedule for Outside lights
  description: Switches on outside light when the sunsets
  trigger:
  - event: sunset
    platform: sun
  condition: []
  action:
  - condition: state
    entity_id: switch.sonoff_1000796972
    state: 'on'

You need to call the service “switch.turn_on” to turn on the switch. :wink:

Try this:

- id: '1571719032416'
  alias: Sunset Schedule for Outside lights
  description: Switches on outside light when the sunsets
  trigger:
  - event: sunset
    platform: sun
  condition: []
  action:
  - service: switch.turn_on
    data:
      entity_id: switch.sonoff_1000796972

At least that’s how it works for me for many switches. Btw: Sonoff doesn’t like to toggle many switches at the same time, so if you plan to use an automation for more than one switch, you better use " - delay: 00:00:01" between each of them.

Perfect Thanks, this is all new to me so have to think like Home assistant wants.

Worked perfectly for months, but since 4 days it won’t find the sonoff component anymore.
The only error I get is this:

The following components and platforms could not be set up:

* sonoff

Please check your config.

Anyone experienced this recently?

the same for me, with the Last hassio update

Not working for me, many failed attempts an entries in log on setup, won’t setup and halts HA.

HA LOG

2019-10-26 10:57:23 ERROR (MainThread) [homeassistant.loader] Error loading custom_components.sonoff. Make sure all dependencies are installed
Traceback (most recent call last):
  File "/srv/homeassistant/lib/python3.8/site-packages/homeassistant/loader.py", line 346, in _load_file
    module = importlib.import_module(path)
  File "/usr/local/lib/python3.8/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1014, in _gcd_import
  File "<frozen importlib._bootstrap>", line 991, in _find_and_load
  File "<frozen importlib._bootstrap>", line 975, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 671, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 783, in exec_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "/home/homeassistant/.homeassistant/custom_components/sonoff/__init__.py", line 28, in <module>
    import websocket
ModuleNotFoundError: No module named 'websocket'

CONFIG

sonoff:
  username: [email protected]
  password: myemailpassword
  scan_interval: 60
  grace_period: 600
  api_region: 'us'
  entity_prefix: True
  debug: False

Could be another server failure because it works for me without issues now. Try to access switches via eWeLink app whether it works normaly or not.

Works fine with the app.

Component error: sonoff - No module named 'websocket'

All good, had to manually install websocket and websocket-client.

Thanks for this great share.

FYI, using a dual relay board, see here.

@Coolie1101 what firmware version the dual relay board uses? to add to compatibility list

for anyone familiar with alarm systems in HA and/or persons interested in RF Bridge integration I would appreciate if you help me to figure out how this should actually work :blush:


thanks

I upgraded my HA to v. 0.101, and now Sonoff custom component dosen’t work.
I get this from the log:

2019-10-31 12:03:44 ERROR (MainThread) [homeassistant.loader] Error loading custom_components.sonoff. Make sure all dependencies are installed
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/loader.py", line 346, in _load_file
    module = importlib.import_module(path)
  File "/usr/local/lib/python3.7/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1006, in _gcd_import
  File "<frozen importlib._bootstrap>", line 983, in _find_and_load
  File "<frozen importlib._bootstrap>", line 967, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 677, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 728, in exec_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "/config/custom_components/sonoff/__init__.py", line 10, in <module>
    from homeassistant.util.async_ import run_coroutine_threadsafe
ImportError: cannot import name 'run_coroutine_threadsafe' from 'homeassistant.util.async_' (/usr/src/homeassistant/homeassistant/util/async_.py)'

Anyone else with this issue? or does anyone know how to fix? :slight_smile:

Are you running the latest version of the Sonoff custom component?
( https://github.com/peterbuga/HASS-sonoff-ewelink )

2 Likes