Ewelink / Sonoff Binding - New binding without flashing

where did you look? it wont show up under bindings but only settings->things->blue add button bottom right->sonoff

does the binding show up under the console when doing a bundle:list command?

I’m just in the process everyone of compiling the latest snapshot for my qnap and ill start bug fixing. bear with me.

1 Like

That’s where i looked, no Sonoff binding

Nope. It’s like it is being completely ignored. I had the binding working with Openhab 3.0.2. Since i moved on to 3.1.0 i have had no success with it.

So have just loaded up the latest 3.1.0 Stable release and with openhab-sonoff-compiled/org.openhab.binding.sonoff-3.2.0-SNAPSHOT_2.5r6.jar at main · delid4ve/openhab-sonoff-compiled · GitHub

It loads up fine and I’m able to add all of my things (some are offline as they are not connected for testing only):

I haven’t bug tested the connection issues yet but will look at over the weekend and next week



Hi @delid4ve, did it work after reboot of device? Because first time install it did work for me as well but after i rebooted my raspberry pi it showed all errors that i sent in posts above.

@fisker have you already got files under userdata/sonoff - if so can you pm me them, if not can you enable trace logging and send me the big long json (showing you all the devices) that will show up when it attempts to load the binding/account. I’ve found the piece of code that’s causing it but need to see why.

@fregger65 and others that are getting the javax issue, use the 3.2.0 snapshot jar above

No improvement for me, the binding is still being ignored. Is there anything i can do to try to force the load?

Sounds like a file permission issue if it’s not even detecting it. Have you tried clearing the cache? I’m 99% sure it’s not the binding if it’s not even loading it.

Your original javax issue was because the 3.1 jar was built before 3.1 main release but this shouldn’t be the case now with the 3.2 snapshot version.

Hi Dave,

Thanx for your swift answers :slight_smile:

Cache cleared multiple times, checked permissions, also with the openhabian-config permission check tool. Checked in the openhab-cli console for orphans and other old traces off the former sonoff binding. I do have a couple of other bindings in the addon folder that are functioning OK. If it’s not the sonoff binding, what else could be the culprit? Anybody?

openhabian 3.1.0 - Release Build
Release = Raspbian GNU/Linux 10 (buster)
Kernel = Linux 5.10.52-v7l+
Platform = Raspberry Pi 4 Model B Rev 1.1

Does the jar you used that gave the javax issue load in? Or does this now not load either?

Yes, it does.

I’ll have a dig into it in the next couple of days. Can you let me know the exact jar that you are using that loads but with the error :+1:

That would be org.openhab.binding.sonoff-3.1.0-SNAPSHOT.jar
Thank you :slight_smile:

Hi,
excellent work, congratulations!

I use Sonoff Dual r3s a lot because every shutter works with these. Bindig installation was easy. I set up the evelink bridge, it connected successfully. The discovery found the nodes. I set dual r3 to motor mode. Thus, it must be called in a completely different way than when controlling the relays. Possible expand with a “dual r3 motor” mode? If I can I will help her.

Thanks
Zsolt

I have the same problem as @mvo. My openhab and Sonoff device are not in the same subnet. If I change account thing access mode to cloud only switch works, but when in Cloud and Local nothing happens.
Sonoff device: RE5V1C
Openhab 3.1

2021-08-27 19:37:33.192 [DEBUG] [rnal.handler.SonoffBaseDeviceHandler] - Sonoff - Command Payload:org.openhab.binding.sonoff.internal.dto.commands.SingleSwitch@d82020
2021-08-27 19:37:33.193 [DEBUG] [unication.SonoffCommunicationManager] - Added a message to the queue
2021-08-27 19:37:34.194 [WARN ] [unication.SonoffCommunicationManager] - Ok message not received for transaction: 1630082253193, command was switch, retrying again. Retry count 2
2021-08-27 19:37:34.295 [DEBUG] [unication.SonoffCommunicationManager] - Message queue is running
2021-08-27 19:37:35.296 [WARN ] [unication.SonoffCommunicationManager] - Ok message not received for transaction: 1630082253193, command was switch, retrying again. Retry count 3
2021-08-27 19:37:35.398 [DEBUG] [unication.SonoffCommunicationManager] - Message queue is running
2021-08-27 19:37:36.399 [WARN ] [unication.SonoffCommunicationManager] - Unable to send transaction 1630082253193, command was switch, after 3 retry attempts
2021-08-27 19:37:36.500 [DEBUG] [unication.SonoffCommunicationManager] - Message queue is running
2021-08-27 19:37:46.566 [DEBUG] [nternal.handler.SonoffAccountHandler] - Running Activation task
2021-08-27 19:37:46.567 [DEBUG] [connection.SonoffWebSocketConnection] - Websocket Sending Message:ping
2021-08-27 19:37:46.603 [DEBUG] [connection.SonoffWebSocketConnection] - Pong Response received
1 Like

Hi,
Please help me with example of account.thing file.
I am new in openhab and need to see the sintax.
Installation of addon via adding a jar to addon folder is fine.
in console I see add-on is INSTALLED but I don’t know sintax of account.thing.
In documentation this is not collected.
I am with openhab3 and in settings>things don’t see sonoff

Regards

Hi again, after put latest jar in addon directory of openhab all work.
But now I have next question.
HOW to change country code? In UI I can add just username and password.

debug:
2021-08-31 07:44:23.298 [DEBUG] [ernal.connection.SonoffLanConnection] - mDNS service has been stopped (JmDNS-/127.0.0.1)
2021-08-31 07:44:25.305 [DEBUG] [ernal.connection.SonoffLanConnection] - mDNS service has been stopped (JmDNS-/192.168.10.39)
2021-08-31 07:44:25.308 [DEBUG] [connection.SonoffWebSocketConnection] - Stopping websocket client
2021-08-31 07:44:25.310 [DEBUG] [nternal.handler.SonoffAccountHandler] - Initialising Sonoff Account: sonoff:account:cc8eb29220
2021-08-31 07:44:25.313 [INFO ] [nternal.handler.SonoffAccountHandler] - Sonoff Access Mode set to: mixed
2021-08-31 07:44:25.317 [DEBUG] [unication.SonoffCommunicationManager] - Message queue is running
2021-08-31 07:44:25.331 [DEBUG] [ernal.connection.SonoffLanConnection] - mDNS service has been started on IP 127.0.0.1
2021-08-31 07:44:25.347 [DEBUG] [ernal.connection.SonoffLanConnection] - mDNS service has been started on IP 192.168.10.39
2021-08-31 07:44:25.351 [DEBUG] [l.connection.SonoffConnectionManager] - Lan connected
2021-08-31 07:44:25.355 [DEBUG] [ernal.connection.SonoffApiConnection] - Api Login Request:{“email”:“@abv.bg",“password”:"***",“countryCode”:"+1"}
2021-08-31 07:44:26.312 [DEBUG] [ernal.connection.SonoffApiConnection] - Api Login Response:{“error”:10001,“msg”:“password error!”,“data”:null}
2021-08-31 07:44:26.315 [DEBUG] [l.connection.SonoffConnectionManager] - Api disconnected
2021-08-31 07:44:26.318 [DEBUG] [connection.SonoffWebSocketConnection] - Stopping websocket client
2021-08-31 07:44:34.942 [DEBUG] [nternal.handler.SonoffAccountHandler] - Sonoff - Running dispose()
2021-08-31 07:44:34.945 [DEBUG] [ernal.connection.SonoffLanConnection] - Sonoff - Stopping LAN connection
2021-08-31 07:44:36.955 [DEBUG] [ernal.connection.SonoffLanConnection] - mDNS service has been stopped (JmDNS-/127.0.0.1)
2021-08-31 07:44:38.964 [DEBUG] [ernal.connection.SonoffLanConnection] - mDNS service has been stopped (JmDNS-/192.168.10.39)
2021-08-31 07:44:38.967 [DEBUG] [connection.SonoffWebSocketConnection] - Stopping websocket client
2021-08-31 07:44:38.970 [DEBUG] [nternal.handler.SonoffAccountHandler] - Initialising Sonoff Account: sonoff:account:cc8eb29220
2021-08-31 07:44:38.973 [INFO ] [nternal.handler.SonoffAccountHandler] - Sonoff Access Mode set to: mixed
2021-08-31 07:44:38.977 [DEBUG] [unication.SonoffCommunicationManager] - Message queue is running
2021-08-31 07:44:38.999 [DEBUG] [ernal.connection.SonoffLanConnection] - mDNS service has been started on IP 127.0.0.1
2021-08-31 07:44:39.014 [DEBUG] [ernal.connection.SonoffLanConnection] - mDNS service has been started on IP 192.168.10.39
2021-08-31 07:44:39.018 [DEBUG] [l.connection.SonoffConnectionManager] - Lan connected
2021-08-31 07:44:39.022 [DEBUG] [ernal.connection.SonoffApiConnection] - Api Login Request:{“email”:"
@abv.bg",“password”:"
",“countryCode”:"+1"}
2021-08-31 07:44:39.997 [DEBUG] [ernal.connection.SonoffApiConnection] - Api Login Response:{“error”:10001,“msg”:“password error!”,“data”:null}
2021-08-31 07:44:40.001 [DEBUG] [l.connection.SonoffConnectionManager] - Api disconnected
2021-08-31 07:44:40.014 [DEBUG] [connection.SonoffWebSocketConnection] - Stopping websocket client
2021-08-31 07:44:40.047 [DEBUG] [nternal.handler.SonoffAccountHandler] - Sonoff - Running dispose()
2021-08-31 07:44:40.051 [DEBUG] [ernal.connection.SonoffLanConnection] - Sonoff - Stopping LAN connection
2021-08-31 07:44:42.060 [DEBUG] [ernal.connection.SonoffLanConnection] - mDNS service has been stopped (JmDNS-/127.0.0.1)
2021-08-31 07:44:44.067 [DEBUG] [ernal.connection.SonoffLanConnection] - mDNS service has been stopped (JmDNS-/192.168.10.39)
2021-08-31 07:44:44.070 [DEBUG] [connection.SonoffWebSocketConnection] - Stopping websocket client
2021-08-31 07:44:44.073 [DEBUG] [nternal.handler.SonoffAccountHandler] - Initialising Sonoff Account: sonoff:account:cc8eb29220
2021-08-31 07:44:44.076 [INFO ] [nternal.handler.SonoffAccountHandler] - Sonoff Access Mode set to: mixed
2021-08-31 07:44:44.079 [DEBUG] [unication.SonoffCommunicationManager] - Message queue is running
2021-08-31 07:44:44.102 [DEBUG] [ernal.connection.SonoffLanConnection] - mDNS service has been started on IP 127.0.0.1
2021-08-31 07:44:44.126 [DEBUG] [ernal.connection.SonoffLanConnection] - mDNS service has been started on IP 192.168.10.39
2021-08-31 07:44:44.132 [DEBUG] [l.connection.SonoffConnectionManager] - Lan connected
2021-08-31 07:44:44.136 [DEBUG] [ernal.connection.SonoffApiConnection] - Api Login Request:{“email”:"
@abv.bg",“password”:"
***********”,“countryCode”:"+1"}
2021-08-31 07:44:44.379 [ERROR] [unication.SonoffCommunicationManager] - The device 1000fe3ed8 doesnt exist, unable to set state
2021-08-31 07:44:44.382 [DEBUG] [nternal.handler.SonoffAccountHandler] - Added IP Address 1000fe3ed8 for device 192.168.10.23
2021-08-31 07:44:44.394 [ERROR] [unication.SonoffCommunicationManager] - The device 1000fe43e8 doesnt exist, unable to set state
2021-08-31 07:44:44.396 [DEBUG] [nternal.handler.SonoffAccountHandler] - Added IP Address 1000fe43e8 for device 192.168.10.24
2021-08-31 07:44:45.100 [DEBUG] [ernal.connection.SonoffApiConnection] - Api Login Response:{“error”:10001,“msg”:“password error!”,“data”:null}
2021-08-31 07:44:45.103 [DEBUG] [l.connection.SonoffConnectionManager] - Api disconnected
2021-08-31 07:44:45.105 [DEBUG] [connection.SonoffWebSocketConnection] - Stopping websocket client

Regards

Can’t get it to work… I am still on OH 2.5.12 and I put org.openhab.binding.sonoff-2.5.13-SNAPSHOT_2.5r6.jar into the addons-folder (where I already have some jars).

Console shows:

openhab> bundle:list -s | grep -i "sonoff"                                                                                                                                                                                               
318 x Active x  80 x 2.5.13.202107250727     x org.openhab.binding.sonoff
[16:46:45] root@openhab:/srv/openhab2-addons# ls -al *sonoff*
-rw-rw-r-- 1 openhab openhab 150434 Sep  2 16:19 org.openhab.binding.sonoff-2.5.13-SNAPSHOT_2.5r6.jar
[16:51:17] root@openhab:/srv/openhab2-addons# file org.openhab.binding.sonoff-2.5.13-SNAPSHOT_2.5r6.jar 
org.openhab.binding.sonoff-2.5.13-SNAPSHOT_2.5r6.jar: Zip archive data, at least v1.0 to extract

But in PaperUI I can’t see the binding when trying to add a thing… File permissions checked, Restart / Clean Cache / Uninstall / Reinstall - nothing helps… Any idea?

If they are not in the same subnet then local mode won’t work (they need multicast traffic which is L2 and cannot route (under normal circumstances))

Not needed anymore - just user and pass

Can you try version 2.4 for me