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.
The Sonoff Touch is a nice glass touch panel based on an ESP8285 with 1MB of integrated flash that can be quite easily flashed with a self compiled version of ESP Easy. You need to compile yourself as the builds available online are all made for the ESP8266 and will not work with the Sonoff Touch.
- 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
if [button#state]=0
gpio,12,0
if [button#state]=1
gpio,12,1
endon - 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:
/devicename/button/state
/devicename/relay/state - 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
Thanks for your post and the precompiled binary! It works!
ReplyDeleteThanks for the feedback.
DeleteHey there XBMCNut,
ReplyDeleteGreat write up as always!
Quick question for you. From watching your video, is it safe to assume that you have the US version of the switch since it is rectangular?
If it is, would you be able to possibly post a a comparison picture of the sonoff touch to a regular light switch?
After looking at all the picture of the US sonoff touch, I just don't feel like it will fit in a regular light switch box. It looks as if i I would have to install it vertically for it to fit.
Thanks!
I had always planned to do this video first https://www.youtube.com/watch?v=VY6beZqGzRo so that should address your question?
DeleteI can confirm it does fit into US gang boxes. I also had the same fit problem due to the screws sticking out. My workaround was to drill holes in the middle piece as you suggest but use those holes to access the screw heads to attach the first plate onto the gang box.
Delete