Would like for button not to switch relay

151 views
Skip to first unread message

Dries Dokter

unread,
Jan 30, 2017, 5:58:51 AM1/30/17
to SonoffUsers
Hello,

I have reprogrammed the sonoff with this new firmware, it is great! I do have a question however:
Using the current firmware I have managed to have the sonoff communicate with mosquito, and am able to use 
mosquitto_pub to switch on the sonoff and mosquitto_sub to receive updates when it switches 


I have a Sonoff basic and connected Pin5 (GPIO14) and GND to an external button. Pressing the external button switches the relay but I  would like it as follows:
  • Button pressed
  • Update send to Openhab / Domoticz
  • Based on some logic: Openhab / Domoticz decides to send a message to switch/toggle the relay
    (I am not at all at home to the MQQT lingo :-) So hopefully you can see through that :-)  )

So basically I would like to have the direct relation "external button press --> switches relay" configurable..
Is this already available?

Regards,

Dries  

Dries Dokter

unread,
Feb 1, 2017, 5:40:22 AM2/1/17
to SonoffUsers
Okay,

So in the mean time I found out 2 things:
I was using Sonoff-MQTT-OTA-Arduino not realizing that Sonoff-Tasmota would be better :-)

In the Sonoff-Tasmota wiki it says:
The button can send a MQTT message to the broker that in turn will switch the relay. To configure this you need to perform cmnd/sonoff/ButtonTopic sonoff where sonoff equals to Topic. The message can also be provided with the retain flag by cmnd/sonoff/ButtonRetain on.

And that is exactly what I needed, so that answers my question! 

Nick Barnett

unread,
Feb 1, 2017, 7:55:00 PM2/1/17
to SonoffUsers
I had the same "problem" about not knowing tasmota existed/would be better for my scenario. Glad you fixed it.
Reply all
Reply to author
Forward
0 new messages