Ewelink / Sonoff Binding - New binding without flashing

Hi Dave and thanks for looking at it again…

Yes you are absolutely right - everyone should upgrade to OH3 asap… But since Covid began, I was extremely busy. My OH2.5 is literally controlling the whole house and I couldn’t find time to do a big bang… That’s why I am trying to migrate step by step… Having >4000 items and >10000 lines of rules dsl makes it quite difficult to migrate everything at once… I use the OH Remote binding for most of the stuff - and I think I will do same for your binding… Meaning to switch the binding over to my OH3 intance and send the updates to the OH 2.5 instance back in order the rules can fire there…

For the current problem:

This one works and shows the Sonoff Account Thing:

org.openhab.binding.sonoff-2.5.13-SNAPSHOT_2.4r5.jar

And this one doesn’t work (it doesn’t even show up in PaperUI-Bindings):

org.openhab.binding.sonoff-2.5.13-SNAPSHOT_2.5r7.jar

I dunno if this’ll help. But I have had this issue, and eventually a solution for me.

If you download the file incorrectly, it’ll save as the ‘jar’ file, but it will be the html (because you download it from github). So then it won’t run as it isn’t a jar. Even with wget this happens.
(You can test by editing the jar file. It should be in binary, but if you can read html in it, then its not the right file).
You need to ensure you download the actual file. If you use a browser on github, access the file page and click download to get the correct file.

1 Like

Good point, unfortunately it’s not the case here :frowning:

> file org.openhab.binding.sonoff-2.5.13-SNAPSHOT_2.*
org.openhab.binding.sonoff-2.5.13-SNAPSHOT_2.4r5.jar: Zip archive data, at least v1.0 to extract
org.openhab.binding.sonoff-2.5.13-SNAPSHOT_2.5r7.jar: Zip archive data, at least v1.0 to extract

Can you help me with DUAL R3 working as a motor/enginge controller. i am using it as a rollershuter and it work fine from ewlinka app/physicall buttons. Logs:

ewLink application commands:

Stop:


2022-07-30 09:54:28.319 [TRACE] [unication.SonoffCommunicationManager] - Lan event received from 192.168.0.143 with payload [ServiceInfoImpl@26256144 name: 'eWeLink_100143717c._ewelink._tcp.local.' address: '/192.168.0.143:8081 ' status: 'NO DNS state: probing 1 task: null' is persistent, has data
        data1: uuSXtg0PKYlnsSX1LURGIFj3q8yA3SBALz1IS/inTpGhLz1b/CYGZXWTw+Qzn1fb
        seq: 18
        iv: NjEzMzgwOTE5ODQ2MzQ3NA==
        type: multifun_switch
        apivers: 1
        txtvers: 1
        encrypt: true
        id: 100143717c]
2022-07-30 09:54:28.321 [TRACE] [unication.SonoffCommunicationManager] - Decrypting LAN message for 100143717c
2022-07-30 09:54:28.324 [TRACE] [unication.SonoffCommunicationManager] - LAN message for 100143717c is {"data1":"uuSXtg0PKYlnsSX1LURGIFj3q8yA3SBALz1IS/inTpGhLz1b/CYGZXWTw+Qzn1fb","seq":"18","iv":"NjEzMzgwOTE5ODQ2MzQ3NA\u003d\u003d","type":"multifun_switch","apivers":"1","txtvers":"1","encrypt":"true","deviceid":"100143717c","localAddress":"192.168.0.143","params":{"currLocation":0,"location":0,"motorTurn":0},"ipaddress":"192.168.0.143"}
2022-07-30 09:54:28.327 [DEBUG] [unication.SonoffCommunicationManager] - Updated state for 100143717c, with data {"data1":"uuSXtg0PKYlnsSX1LURGIFj3q8yA3SBALz1IS/inTpGhLz1b/CYGZXWTw+Qzn1fb","seq":"18","iv":"NjEzMzgwOTE5ODQ2MzQ3NA\u003d\u003d","type":"multifun_switch","apivers":"1","txtvers":"1","encrypt":"true","deviceid":"100143717c","localAddress":"192.168.0.143","params":{"currLocation":0,"location":0,"motorTurn":0},"ipaddress":"192.168.0.143"}
2022-07-30 09:54:28.330 [TRACE] [unication.SonoffCommunicationManager] - Forwarded state to device 100143717c
2022-07-30 09:54:28.333 [DEBUG] [nternal.handler.SonoffAccountHandler] - Added IP Address 100143717c for device 192.168.0.143

Close:


2022-07-30 09:55:40.202 [TRACE] [unication.SonoffCommunicationManager] - Lan event received from 192.168.0.143 with payload [ServiceInfoImpl@28103068 name: 'eWeLink_100143717c._ewelink._tcp.local.' address: '/192.168.0.143:8081 ' status: 'NO DNS state: probing 1 task: null' is persistent, has data
        data1: Zx71MujHzdW7skawPxDja9Z8iAbol+5vve/lW6q4IrZKABcQBkZAO9gmUVQ9vG3R
        seq: 20
        iv: NzQ4MTE4MDg4MTY3MjUxMg==
        type: multifun_switch
        apivers: 1
        txtvers: 1
        encrypt: true
        id: 100143717c]
2022-07-30 09:55:40.204 [TRACE] [unication.SonoffCommunicationManager] - Decrypting LAN message for 100143717c
2022-07-30 09:55:40.207 [TRACE] [unication.SonoffCommunicationManager] - LAN message for 100143717c is {"data1":"Zx71MujHzdW7skawPxDja9Z8iAbol+5vve/lW6q4IrZKABcQBkZAO9gmUVQ9vG3R","seq":"20","iv":"NzQ4MTE4MDg4MTY3MjUxMg\u003d\u003d","type":"multifun_switch","apivers":"1","txtvers":"1","encrypt":"true","deviceid":"100143717c","localAddress":"192.168.0.143","params":{"currLocation":0,"motorTurn":2},"ipaddress":"192.168.0.143"}
2022-07-30 09:55:40.210 [DEBUG] [unication.SonoffCommunicationManager] - Updated state for 100143717c, with data {"data1":"Zx71MujHzdW7skawPxDja9Z8iAbol+5vve/lW6q4IrZKABcQBkZAO9gmUVQ9vG3R","seq":"20","iv":"NzQ4MTE4MDg4MTY3MjUxMg\u003d\u003d","type":"multifun_switch","apivers":"1","txtvers":"1","encrypt":"true","deviceid":"100143717c","localAddress":"192.168.0.143","params":{"currLocation":0,"motorTurn":2},"ipaddress":"192.168.0.143"}
2022-07-30 09:55:40.213 [TRACE] [unication.SonoffCommunicationManager] - Forwarded state to device 100143717c
2022-07-30 09:55:40.217 [DEBUG] [nternal.handler.SonoffAccountHandler] - Added IP Address 100143717c for device 192.168.0.143

Open:

2022-07-30 09:56:01.911 [TRACE] [unication.SonoffCommunicationManager] - Lan event received from 192.168.0.143 with payload [ServiceInfoImpl@26384946 name: 'eWeLink_100143717c._ewelink._tcp.local.' address: '/192.168.0.143:8081 ' status: 'NO DNS state: probing 1 task: null' is persistent, has data
        data1: o3EYzFgnyrnUGNZ7YUVcXQuc4fyP+jrsnLl7enszBJaS24xxIYKkhaxE0YwOpEDs
        seq: 22
        iv: MTk0NzcyMTU5MTczMjA3Nw==
        type: multifun_switch
        apivers: 1
        txtvers: 1
        encrypt: true
        id: 100143717c]
2022-07-30 09:56:01.913 [TRACE] [unication.SonoffCommunicationManager] - Decrypting LAN message for 100143717c
2022-07-30 09:56:01.916 [TRACE] [unication.SonoffCommunicationManager] - LAN message for 100143717c is {"data1":"o3EYzFgnyrnUGNZ7YUVcXQuc4fyP+jrsnLl7enszBJaS24xxIYKkhaxE0YwOpEDs","seq":"22","iv":"MTk0NzcyMTU5MTczMjA3Nw\u003d\u003d","type":"multifun_switch","apivers":"1","txtvers":"1","encrypt":"true","deviceid":"100143717c","localAddress":"192.168.0.143","params":{"currLocation":0,"motorTurn":1},"ipaddress":"192.168.0.143"}
2022-07-30 09:56:01.919 [DEBUG] [unication.SonoffCommunicationManager] - Updated state for 100143717c, with data {"data1":"o3EYzFgnyrnUGNZ7YUVcXQuc4fyP+jrsnLl7enszBJaS24xxIYKkhaxE0YwOpEDs","seq":"22","iv":"MTk0NzcyMTU5MTczMjA3Nw\u003d\u003d","type":"multifun_switch","apivers":"1","txtvers":"1","encrypt":"true","deviceid":"100143717c","localAddress":"192.168.0.143","params":{"currLocation":0,"motorTurn":1},"ipaddress":"192.168.0.143"}
2022-07-30 09:56:01.923 [TRACE] [unication.SonoffCommunicationManager] - Forwarded state to device 100143717c
2022-07-30 09:56:01.926 [DEBUG] [nternal.handler.SonoffAccountHandler] - Added IP Address 100143717c for device 192.168.0.143

so it seeems that motorTurn parameter is responsible for Open/Close/Stop behaviour

What to do now with the thing configuration channels? Binding is discovering this think as a DualR3 and adds 2 switches (channels) but they are not working obviously.


 Sending LAN Update to http://192.168.0.143:8081/zeroconf/switches
2022-07-30 10:00:31.974 [DEBUG] [ernal.connection.SonoffLanConnection] - Lan response received: {"sequence":"","seq":27,"error":400,"encrypt":true}
2022-07-30 10:00:32.863 [WARN ] [unication.SonoffCommunicationManager] - Unable to send transaction 1659168029607, command was switches, after 3 retry attempts

what to try/do next?

I’ll get this added next week for you :+1:

1 Like

the binding for a few days this error comes out

I’m using oh2.5, do we know why it doesn’t work?

a greeting

@delid4ve i am waiting:) after some further test i noticed that DUALR3 can also use position parametr of the engine after calibration of the rollershutter. It will be good to implement it also, i will try to gather some logs:

 Added IP Address 100143717c for device 192.168.100.26
2022-08-02 14:17:36.372 [DEBUG] [connection.SonoffWebSocketConnection] - WebSocket message received {"action":"update","deviceid":"100143717c","apikey":"66b28cbf-f354-4c74-8ab2-bf9487","userAgent":"device","d_seq":9827,"params":**{"currLocation":92}**,"from":"device","seq":"122"}
2022-08-02 14:17:36.374 [DEBUG] [unication.SonoffCommunicationManager] - Updated state for 100143717c, with data {"action":"update","deviceid":"100143717c","apikey":"66b28cbfbhbhbhh","userAgent":"device","d_seq":9827,"params":{"currLocation":92},"from":"device","seq":"122"}
2022-08-02 14:17:36.378 [DEBUG] [ng.sonoff.internal.SonoffTaskManager] - Stopping local polling for 100143717c
2022-08-02 14:17:36.380 [DEBUG] [ng.sonoff.internal.SonoffTaskManager] - Stopping consumption polling for 100143717c
2022-08-02 14:17:36.582 [DEBUG] [unication.SonoffCommunicationManager] - Updated state for 100143717c, with data {"data1":"DnIKORoK7vVlZzyTQdEIzDUAQRWvjQQf742qyKRCeC8\u003d","seq":"122","iv":"Nzc5MzkzMjk2MzY5MDUxNQ\u003d\u003d","type":"multifun_switch","apivers":"1","txtvers":"1","encrypt":"true","deviceid":"100143717c","localAddress":"192.168.100.26","params":{"currLocation":92},"ipaddress":"192.168.100.26"}
2022-08-02 14:17:37.682 [DEBUG] [unication.SonoffCommunicationManager] - Updated state for 100143717c, with data {"data1":"E47Cw2RdAlkvoNkVzkve92eC5Z2Qnd5B5G5WaAzQtFQzUkY5Ulm+buwCO2LPsR29O5Zf4yImGaHM1g19flRMtWIKFBItf/2XcaP7gV9rN50tHTlcbeRzaO4b9wuMfvTZEgvmThIAY8l3RMJSA0Ea5wkwy3QTs2m6E3/uqnnE39Q\u003d","seq":"123","iv":"NjY4MTUxNjk4MjA4NzE5Nw\u003d\u003d","type":"multifun_switch","apivers":"1","txtvers":"1","encrypt":"true","deviceid":"100143717c","localAddress":"192.168.100.26","params":{"currLocation":92,"current_01":63,"voltage_01":23440,"actPow_01":14410,"reactPow_01":3909,"apparentPow_01":14931},"ipaddress":"192.168.100.26"}
2022-08-02 14:17:38.502 [DEBUG] [connection.SonoffWebSocketConnection] - WebSocket message received {"action":"update","deviceid":"100143717c","apikey":"66b992a2f9487","userAgent":"device","d_seq":6324,"params":{"currLocation":84},"from":"device","seq":"124"}
2022-08-02 14:17:38.504 [DEBUG] [unication.SonoffCommunicationManager] - Updated state for 100143717c, with data {"action":"update","deviceid":"100143717c","apikey":"dfdgfadsv x2f9487","userAgent":"device","d_seq":6324,"params":{"currLocation":84},"from":"device","seq":"124"}
2022-08-02 14:17:38.781 [DEBUG] [unication.SonoffCommunicationManager] - Updated state for 100143717c, with data {"data1":"xgCvwN4BEQYFRb2Tya+r9zy3ml6z0KvFQkk7v4YXdo0\u003d","seq":"124","iv":"MTQ2NDgzMTM3ODYzOTMwNw\u003d\u003d","type":"multifun_switch","apivers":"1","txtvers":"1","encrypt":"true","deviceid":"100143717c","localAddress":"192.168.100.26","params":{"currLocation":84},"ipaddress":"192.168.100.26"}
2022-08-02 14:17:39.396 [DEBUG] [connection.SonoffWebSocketConnection] - WebSocket message received {"action":"update","deviceid":"100143717c","apikey":"dfsfdskjf2f9487","userAgent":"device","d_seq":8725,"params":{"motorTurn":0,"currLocation":81,"location":81},"from":"device","seq":"125"}
2022-08-02 14:17:39.398 [DEBUG] [unication.SonoffCommunicationManager] - Updated state for 100143717c, with data {"action":"update","deviceid":"100143717c","apikey":"dsfsf7","userAgent":"device","d_seq":8725,"params":{"motorTurn":0,"currLocation":81,"location":81},"from":"device","seq":"125"}

IS there support for Sonoff NS panel?

I integrated the NS panel via MQTT:

What does below logs means?

2022-08-09 20:50:55.212 [WARN ] [unication.SonoffCommunicationManager] - Ok message not received for transaction: 1660089054211, command was switch, retrying again. Retry count 2

2022-08-09 20:50:56.326 [WARN ] [unication.SonoffCommunicationManager] - Ok message not received for transaction: 1660089054211, command was switch, retrying again. Retry count 3

2022-08-09 20:50:57.428 [WARN ] [unication.SonoffCommunicationManager] - Unable to send transaction 1660089054211, command was switch, after 3 retry attempts

is there a way to use ewLink app and binding at the same time? i noticed that ewlink cloud is not accepting more than one client connected. It’s a problem for me becasue i am using one ewlink account for different locations (different openhab instances). Any ideas how to use more than one instance at the same time? maybe i can share device to a different account and us it via binding ?

Hey Guys and Thanks @delid4ve for all your effort you put in this.

I just wanted to ask a quick question on the binding. I have a Sonoff 4CH R3 WiFi Modul to control 4 switches. I’ve installed the latest Binding from @delid4ve and connected to ewelink account. The scan automatically observed the correct Group, with the included switches. So far so good, I’ve created the related things (switches) and connected it with the correct channels, but I turn on / off the switches using the binding. Inside the logs I can see:

2022-08-18 20:50:55.212 [WARN ] [unication.SonoffCommunicationManager] - Ok message not received for transaction: ############, command was switch, retrying again. Retry count 2

2022-08-18 20:50:56.326 [WARN ] [unication.SonoffCommunicationManager] - Ok message not received for transaction: ############, command was switch, retrying again. Retry count 3

2022-08-18 20:50:57.428 [WARN ] [unication.SonoffCommunicationManager] - Unable to send transaction ############, command was switch, after 3 retry attempts

And the Thing is showing “LAN offline” - that is something I’m not totally sure where this comming from. Maybe someone can help me on that or give me some thoughts.

Many thanks and best regards Sven

Still have fingers crossed that openHAB 2.5.x will receive one last effort to revive this binding. @delid4ve, thanks for creating and keeping it alive this long. All the best …

This binding worked for me as a charm from the day one I used it and never had any issues.
Thank you Dave for the great work. Just can’t resist to say kudos :slightly_smiling_face:

2 Likes

I also have many warnings like “Retry count…” (running on OH3.3)
No clue how to resolve it.

Hello everybody.
i am using OH3.3 and in thanking @delid4ve for the excellent work I would like to ask him if he thought about implementing the roller shutter functionality for the DualR3 in this binding

Thanx

Dual r3 support gonna be added, been tied up with pl so havnt got it done yet, soon.

1 Like

The retry count is where a response is not coming back from the lightwave servers when you send a command. Flaky internet could cause this or a firewall blocking the outbound connection.

Can you dm me the cache file created. I’ll take a look

Unfortunately the api is one connection only. You open the app it disconnects the binding etc.