delid4ve / openhab-3.x-sonoff

Openhab Binding for Sonoff Devices
26 stars 11 forks source link

Add support for DualR3 in motor/engine mode #20

Open JacekKac opened 1 year ago

JacekKac commented 1 year ago

Expected behaviour : DualR3 configured as a motor/engine in ewLink up is discovered which 1 channel with accepts three commands Open/Close/Stop.

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

cover is implemented also here : https://github.com/AlexxIT/SonoffLAN/blob/master/custom_components/sonoff/cover.py

JacekKac commented 1 year ago

@jgesser maybe you can help ?

jgesser commented 1 year ago

Hi @JacekKac , I'm afraid I can't help. I don't have this kind of device here in my home. Sorry.