Ewelink / Sonoff Binding - New binding without flashing

Hmm…
That looks more like the build system was screwed when I compiled it

I’ll recompile tomorrow and load it up quick to test

1 Like

@mvo just tested on my 3.x docker and working fine
looks like a core issue when your main install to me.

Hi Dave, thanks for your answer. I just update other threat because look like something on core. However, on the same OH3 instance if I used 3 version it works (thing are online) but I’m getting below error:

2021-04-10 09:09:36.464 [ERROR] [ding.sonoff.internal.connections.Api] - Api threw an error code 401 with message cannot found access token info. Additional User information: You cannot use more than 1 instance of Ewelink at one time, please check the app or another binding is not logged into your account

I guess I found the issue. As mentioned previous I’ve tried to update from version 3.1.0 SNAP to latest version, I’ve stopped OH3, delete old and add new .jar with latest snapshot, after that clean-cache and upload new version + start OH3, however I did not deleted things/items I’ve created before and it somehow create the issue. After I clean things and items and start OH again it back to work… maybe somethintg related or wrong step took during upgrade of snap???

So yeah you had two lots running, hence the 401 error.

If you upgraded from a 1 or 2 release then yeah a lot of things changed so a delete and recreate was required for a lot of stuff (and a cache clean).

It’s pretty much done now so should be any need for the above going forward. Just got to get a few things tidied up, iron out any bugs that come over the next few weeks and submit it for official integration.

1 Like

@delid4ve hope all is well,
Just got around to test the latest binding for TH16.
I had to clear the cache, and I confirm that it is working beautifully on LAN Only mode.

Thank you

1 Like

Thanks for your great work, @delid4ve !
I worked a few hours on trying to get the binding to work with my OH3. Just as I reached a dead end, I noticed you removed all jars from github and committed new files. Are you planning on putting the jars back there sometimes?

Thanks!

Just had a bit of a reorganisation, they’re all under /openhab-sonoff-compiled in my repo. Pretty sure I changed the top post in this thread. What issues are you having? (2.4r2 is the latest, just make sure you get the 3.x version and not the 2.5x)

Hi Dave, great work thanks.

I have a Problem with my S26 things. I can switch off and on, but I did not receive a status from the S26. And I receive a CONFIGURATION_ERROR in openhab 3.

2021-04-25 14:40:45.046 [INFO ] [nternal.handler.SonoffAccountHandler] - Sonoff mode set to: mixed
2021-04-25 14:40:45.658 [ERROR] [unication.SonoffCommunicationManager] - The device xxxxxxxxx doesnt exist, unable to set state

Have you run discovery?
Sounds like the cache file isn’t present.
If it is then stop and restart the binding to see if that fixes

1 Like

Hello Dave, I appreciate your help with this log, here is a dimmer and a generic RF 433 mhz buttons.

sonoff.log (15.9 KB)

Thanks, that works

The rfBridge and buttons are already supported, ill get the dimmer added today for you.

@jateros Dimmer now integrated:
2.5.x: https://github.com/delid4ve/openhab-sonoff-compiled/blob/main/org.openhab.binding.sonoff-2.5.13-SNAPSHOT_2.4r3.jar
3.x: https://github.com/delid4ve/openhab-sonoff-compiled/blob/main/org.openhab.binding.sonoff-3.1.0-SNAPSHOT_2.5r1.jar

Did you just need to run discovery? Or just restart? It should pick up the new state automatically and re-init any devices so i hope the former :slight_smile:

Anyone else have any outstanding issues… just in case I’ve missed them…
Versions above also fix zigbee temp sensor displaying incorrect temperature (no decimal places)

Thanks a lot Dave, dimmer does work!!!.
Regarding RF 433 mhz buttons, while sonoff integration is scanning for devices does not detect my buttons, Basically I need to detect the time when i have pressed the button as a trigger.

Hmm… strange… mine detects them.
You could add them manually and I’ll look tomorrow regarding discovery.
Add an rfremote thing (correct button number) and set the bridge as the RFBRIDGE you’ve added. deviceid should be 1 if you have nothing else present on the rf bridge (can always look in the discovery json when you run a scan).
Channels will give you internally activated time and externally activated time
You do need to have the rf bridge present first btw as a thing too if you haven’t

My discovery result:

I have tried automatically by scan, and manually as you said, but neither worked.

I am trying to add a two rf buttons, now they are linked and working in my eWeilink app but when I tried to discovery them in sonoff integration nothing appears and manually does not work neither.

my name bridge is “Bridge”.

The bridge is the rfbridge yeah not the account bridge? The way the binding works is it will only discover sub devices (rf and zigbee) once the main bridge (rfbridge or zigbee) has been added as a thing as it uses the thing to create the link (in case of more than 1 bridge)

So the structure is:
Add account:
Discover:
Add devices including rfbridge
Discover
Now rf devices are found

Just checked your log, you need to set the thing as an rf 2 button remote and the id is 1, your contact sensor is 0 btw.

try clearing the cache also to see if that fixes.

Let me know and I’ll try and find out why tomorrow otherwise

Ps… I just see your deviceid on that remote is a full device id, the rf devices are just the order in the subdevice list (from the cache file under userdata/sonoff) for the bridge, you’ll see the channel numbers starting at 0 in there

Dave,

I have tested 4 RF buttons remote and sonoff integration does discovery it, I thing that is related to the number of buttons, maybe something in the code es not going well with the number off buttons, 1,2,3 buttons are not discovered, but 4 buttons remote is discovered.

I appreciate if you can check.

I’ll have a look, quite possibly it misses 1/2/3 buttons as I only have a 4 button to test.

Did you see my last edit though about your device id above (ps)

@jateros found it, copy/paste fault :joy: give me 5