Sonoff DUAL R2 changes from ON to OFF automatically

Hi there,
I have just set up two Sonoff DUAL, and I have the problem that when I set up as a Switch (ON OFF), on the BASIC page, if I turn on, after 5 seconds, change to OFF automatically …

This is turning me crazy.
Thank you in advances.

Events log:

2018-04-01 22:26:59.855 [ome.event.ItemCommandEvent] - Item ‘SonoffDUAL02_1_Color’ received command ON
2018-04-01 22:26:59.866 [vent.ItemStateChangedEvent] - SonoffDUAL02_1_Color changed from OFF to ON
2018-04-01 22:27:01.509 [ome.event.ItemCommandEvent] - Item ‘SonoffDUAL02_2_Color’ received command ON
2018-04-01 22:27:01.520 [vent.ItemStateChangedEvent] - SonoffDUAL02_2_Color changed from OFF to ON
2018-04-01 22:27:03.611 [vent.ItemStateChangedEvent] - SonoffDUAL02_1_Color changed from ON to OFF
2018-04-01 22:27:03.627 [vent.ItemStateChangedEvent] - SonoffDUAL02_2_Color changed from ON to OFF

Such could be a SWITCHMODE other then 0 (enter: “SWITCHMODE” into the console of the sonoff), or you have the item switch automatically by use of the expiry binding, or a rule?
Other then that???

I do not have any rule.
About the expiry binding, I do not understand what you mean, sorry :S…
I have a HUW bridge (Amazon ECO), and then the inbox detect the sonoff dual R2, I link to a Switch, and everything works fine, but the status change after 5 seconds aprox. If I re-setup veverything, maybe happens the opposite, when I turn it OFF, then change to ON automatically. This is crazy :smiley: I do not what to do.

I use, last version of openhab, sonoff bassic work like a charm.
I have reflashed a few times the sonoff DUAL R2. Happen with more DUAL R2.

Attached some photos about my setup.
It seems like there is something in the “code” thath does not works properly.

I’m using the sonoff switches just with mqtt, create the item and use it on a sitemap No bridge needed! I did not create any Thing for sonoff!


Switch Light_Dual1 "Light Dual1" <gLichtschalter> { mqtt="<[opusMQTT:stat/sonoff_dual/POWER1:state:default], >[opusMQTT:cmnd/sonoff_dual/POWER1:command:*:default]" }

I am not working with MQTT yet, I do not know how doe it work actually? Do I need to install more app in addition to Openhab2 to run with MQTT?

I need to read about MQTT, before starting to work with MQTT :confused:

I have though to make a rule, to visualize the proper Status, but I do not know how to get the “real” state of the relay, and according it, visualize the ON or OFF status. is it possible? (Then I will see how to setup eveything with MQTT.

You need an MQTT broker!
Read Here.

Thank you opus,

I will read about MQTT.
I guess, I need to install the MQTT Broker and Openhab2 on the same raspberry pi, running together.

Yes, you run them both on your raspi. When I installed it via OPenhabian, then the MQTT broker was installed automatically on the raspberry pi, during the initial installation.

One question.

I have Raspbian and Openhab2 already installed in the Raspberry Pi. All documentation I read, tells me that I have to burn the SD card to install openhabian. Is there any procedure to install openhabian from terminal?

(Sorry, but I am new in Raspberry pi world)

Openhabian is meant to be a complete image, hence IMHO the answer is No.
However, it is the fastest and most promising way to install OH and all needed dependecies!

Just for you r information:

I have just installed Openhabian from the very begginnig, and EVERYTHING works fine now, Sonoff DUAL works like a charm with MQTT.

Thanks fro you advise. Even it is more easy, once you understand MQTT protocol. :wink:


In other words, reading the manuals does help!