Ewelink / Sonoff Binding - New binding without flashing

Tags: #<Tag:0x00007f17364d1670> #<Tag:0x00007f17364d1580> #<Tag:0x00007f17364d1490>

Control of sonoff and other brands using the ewelink platform.

  • Local and cloud control is available.
  • Device discovery included.
  • 2.5.x and 3.x available

The binding currently has limited device support listed below, however if you send me the debug log under ‘Discovery Response’ or the file created under userdata/sonoff after adding your account I will get them added.

Please refer to the readme below. Pre-compiled Jar files are available for each branch (2.5.x and 3.x)

7 Likes

Awesome. Thanks.

Fantastic Job, works great.

@LeeC77 @candiesdoodle - glad to hear :+1:. Can you monitor updates coming in after 6 hours of run time. I haven’t had it up for that long without removal/adding where I’ve been testing so hopefully it logs back in again. I may have to play about with the login interval if not.

Although you can use devices offline (local mode), the binding has to send a login message every six hours to the api in order for the device to keep pushing out updates on the LAN. If you do want to entirely disable this, you can put supported devices into developer mode (untested but should work) and block the devices internet connection.

If you don’t want to put them into developer mode, you can still block the internet access and switches will function, however you wont receive updates for channels such as power,energy,current if you have the likes of a POWR2. You should however still get switch updates should it be changed from elsewhere.

http://developers.sonoff.tech/sonoff-diy-mode-api-protocol.html

also, forgot to say…
If you have been helping me test, you’ll need to remove your things and re-add as alot has changed overnight in the binding. (@Schnuecks @LeeC77 this more than likely applies to you)

Thanks, to you too, you had the hard part of it. The time invested in programming and debugging was totally worth it.

Edit: I switched on debug and will report to you, tomorrow.

Awesome nice Job, thanks a Lot, waiting for such a solution so long, without MQTT and flashing

So while cleaning up the code looks like I broke the switching for anything with more than 1 channel. I’ll look and update tomorrow :+1: @LeeC77 I believe the last jar I pm’d you yesterday works for the meantime

new jars uploaded to gihub for both branches fixing the switch issue.

I try add the binding using the .jar file, then in OH3 UI, add “bridge” thing using “+”, but then I got " “HANDLER_INITIALIZING_ERROR”, what seems to be my problem? any idea?
Thanks.

Can you send me the debug logs please (PM), and hash out your username /password for security

Send. Thx in advance

I changed the region to “as” then it work fine with my s26.
Thanks a lot for the great binding, will try add more device and see.

Yep I see…
Still good feedback though as the error checking is very light at present.

2021-02-03 08:32:55.361 [DEBUG] [ding.sonoff.internal.connections.Api] - Login Request url:https://CN-api.coolkit.cc:8080/api/user/login

2021-02-03 08:32:56.180 [DEBUG] [ding.sonoff.internal.connections.Api] - Login Response Raw:{“error”:301,“region”:“as”}

I’ll add this in. I will at some point remove the region as a config parameter too as I can get this detected auto magically :wink:

I’ve just added a text file things example to the top post if anyone wants to set up manually. Once you have discovered and have the uuid and deviceId for each device.

Hi,

I copied jar from GitHub - delid4ve/openhab-sonoff at 3.0.0 as org.openhab.binding.sonoff.jar into addon directory of OH3.

Nothing appears in inbox, nor can I install a thing as binding does not appear.

Did I miss something?

There’s people using on 3.x and working, not myself as I’m still in the dark ages on 2.5.11. Have a look in the logs, should tell you whether it detects the jar and any issues.

Also… until you add an account thing discovery won’t work. The binding won’t show up under bindings (limited 3.x use but from others it seems custom jars do not show here like on 2.5.x) , but if you go to ‘things’ and click + then you’ll be able to select sonoff there

Hi, nothing seen in logs.
Binding is not shown under “thing” -> “+”.
Binding is not listed in karaf console (bundle:list)
Other manual installed addons (like broadlink) are shown in UI and console.

Can I add some debug information on console or something similar?

I’ll have a look in about an hour. Just woke up but will be going out to my machine soon, I’ll spin up a quick 3.x docker.

I’ve not tested the 3.x jar myself but other report it’s working.

Not sure regarding the console, don’t use it that often other than to change logging levels of individual bindings, but if it’s not showing up you probably can’t change the logging level

Shows up on mine so im not sure. maybe re-download, remove, wait 30 secs and readd, then refresh ui page.

things are then also shown:

Hello.
First - Thank you for your work. Really!

I have downloaded the *.jar file an have put it in the correct place (i installed an jar file befor - that worked)

I got an Error in the log:
2021-02-02 23:53:16.333 [ERROR] [t.core.internal.addons.AddonResource] - Exception while parsing the addon URL ‘openhab-sonoff/org.openhab.binding.sonoff-3.0.0-SNAPSHOT.jar at 3.0.0 · delid4ve/openhab-sonoff · GitHub’: No add-on service registered for URI openhab-sonoff/org.openhab.binding.sonoff-3.0.0-SNAPSHOT.jar at 3.0.0 · delid4ve/openhab-sonoff · GitHub

Iam new to Openhab 3 - so it can be my mistake too :slight_smile:

Is there anything i can do?

yours bernhard