Ewelink / Sonoff Binding - New binding without flashing

Hi I am not a java programmer but seeing that some things like api id and secret can and will be changed by the provider (ewelink) is it possible to have these outside the jar file and simply access this when the jar is called - would make it easier for “stupids”· like me to keep it going?
Found somewhere that this is possible … txt would be perfect…

FileInputStream is = new FileInputStream( filePath );

I am going to upgrade from 3.2 to 3.3. and hopefully will have conection again…
a simple txt fime with UTF-8 could solve the cloud problem in future…

Hi
again thanks to all the developers. Upgrade to 3.3 worked snapshot jar is working I have cloud connection.
But it seems when logging in via external device (mob) even with secondary account I get logged out of cloud at ewe.

Thank you folks, this also fixed the issue for me. (3.3)

Has there been a fix released for 2.5? The file uploaded by Viktor Oláh on 19 July does not work for me–after renaming the file, copying it to the addons directory, changing ownership, all I get is the same sonoff log message “UNINITIALIZED to INITIALIZING”. Am I missing something? The device was working before and continues to work with the ewelink app.

Thanks @Jacek_Kaczmarczyk for the recompile with appid/secret changed.
Been a very busy time guys, lots and lots going on so apologies ive not been around.

I’ve moved appid/secret away from hard coded now and will be a default value that can be overridden in your account config. Just getting this compiled at present but having to update my system too.

I know there are probably quite a few of you with devices need adding, ill scan my messages and the thread but to make life easier could you send me the details via DM.

try this
havnt tested but updated the appid/secret for you.

Thanks @delid4ve for updating 2.5 too! Unfortunately I still have the same problem :frowning:

whats the issue?

Same errors in the log like before:

I can’t send a ON/OFF to a TH16. But Basic Rx works… When I switch the TH16 on/off via the ewelink app, the status comes through to OH

Let me quickly catch a new debug output

Let me look. I have th16s too.

The API login error is gone - only this errors remain:

2022-07-23 01:00:11.025 [WARN ] [unication.SonoffCommunicationManager] - Ok message not received for transaction: 1658512805375, command was uiActive, retrying again. Retry count 3
2022-07-23 01:00:12.717 [DEBUG] [unication.SonoffCommunicationManager] - Message queue is running
2022-07-23 01:00:12.717 [ERROR] [unication.SonoffCommunicationManager] - Cannot send command uiActive, all connections are offline for deviceid 100149xxxx
2022-07-23 01:00:13.717 [WARN ] [unication.SonoffCommunicationManager] - Unable to send transaction 1658512805375, command was uiActive, after 3 retry attempts

Its fixed in 3.3, unfortunately I’m not going to have time to fix previous releases.

3.3/3.4 version guys:
Added appid/secret to account thing so can be changed if it ever goes down

1 Like

Fair enough! Luckily my Basic’s are still working and from the TH16 I only need the sensor values… But I have to move the binding over to OH 3 asap

If I get a chance I’ll have a look but I can’t promise anything :+1:

1 Like

Thank you for the attempted update to 2.5. Unfortunately the binding isn’t showing up in the PaperUI. Steps taken:

  1. copied to /usr/share/openhab2/addons
  2. changed ownership to openhab
  3. started openhab
  4. binding in PaperUI is absent but shows in console “bundle:list”

I noticed that 2.5r7.jar is 62KB but 2.5r5.jar is 164KB. Is this correct?

For me the binding appeared correctly in OH 2.5 - maybe you should try to stop openhab, clear cache and start again?

I tried one more time with cache clearing …

1) sudo systemctl stop openhab2
2) sudo rm -rf /var/lib/openhab2/tmp/*
3) sudo rm -rf /var/lib/openhab2/cache/*
4) sudo cp /tmp/org.openhab.binding.sonoff-2.5.13-SNAPSHOT_2.5r7.jar /usr/share/openhab2/addons/
5) sudo chown openhab:openhab /usr/share/openhab2/addons/org.openhab.binding.sonoff-2.5.13-SNAPSHOT_2.5r7.jar
6) sha1sum /usr/share/openhab2/addons/org.openhab.binding.sonoff-2.5.13-SNAPSHOT_2.5r7.jar
   --> 5bc05bd54680444360496915566263026e4e5c38
7) sudo systemctl start openhab2

Still not showing binding in PaperUI. If I do the same with the previous release org.openhab.binding.sonoff-2.5.13-SNAPSHOT_2.4r5.jar the binding shows (even without clearing the caches). I’m stumped.

Now that’s weird: I just looked in my bundles:

openhab> bundle:list -s | grep -i sonoff
208 | Active |  80 | 2.5.13.202104280920     | org.openhab.binding.sonoff
334 | Active |  80 | 2.5.13.202207221710     | org.openhab.binding.sonoff

And I can still see the old one, even if I removed it from the addons-folder and restartet oh…
Now I deleted bundle 208:

openhab> bundle:uninstall 208
openhab> bundle:list | grep -i sonoff
334 | Active |  80 | 2.5.13.202207221710     | openHAB Add-ons :: Bundles :: sonoff Binding

And I have the same problem you describe now… Will go back to the old jar now and test…

I Haven’t tested 2.5.x as I no longer run an instance of it. I’ll have a look if I get a chance but you should really upgrade to 3.x as this is all I’ll maintain / add features to going forward.

1 Like