You can completely remove the low voltage board and connect as shown below. GPIO0 needs to be pulled to ground on power up (it can be left grounded during flashing) to enter programming mode. Power the device from your FTDI programmer set to 3.3V.
- Download the latest release candidate from here http://www.letscontrolit.com/wiki/index.php/ESPEasy#Release_candidates and the copy the compiled version I created here into the same folder.
- Run flash.cmd and choose your com port, then 1024 to match the flash size of the Sonoff Touch and then 148 for the version number. Flashing should take about 30s.
- Once completed, disconnect from your programmer and reconnect. The device will boot into AP mode with a SSID of ESP_0.
- Connect to that network using configesp as the password then navigate to 192.168.4.1
- Connect to your SSID and enter your network password. The Sonoff should now connect to your Wi-Fi and tell you what IP it got assigned.
- Connect your PC back to your network and navigate to the IP your Sonoff got assigned.
- Under ‘Config’, give your device a name (I called mine sonofft1) and change the protocol to OpenHAB MQTT and set your broker IP, username and password.
- Under Tools > Advanced, tick ‘MQTT Retain Msg:’ and ‘Rules:’ right at the bottom and click Submit.
- At the top, you’ll now have a new tab called Rules. Paste the following into the rules section and click submit.
on button#state do
- Under devices, add a switch input configured as shown to enable the touch button
- Add another switch input for the relay as shown. The IDX/Var you can make up and I don’t think they matter if you’re using MQTT. They do if you’re connecting to Domoticz.
- You should now be able to push the button and your light will come on. Using the rules I’ve posted, the light should go off when the Sonoff is rebooted and stay off.
- You can get a report on the button and relay states by subscribing to:
- You can control the relay by publishing to /devicename/gpio/12 with a payload of 1 for on and 0 for off
N.B The integrated LED does not need control and simply tracks the button/relay state.
BUTTON is on GPIO0
RELAY is on GPIO12
LED is on GPIO13