This is second part of flashing Tasmota to the Sonoff devices. This time I’m going to push it to Smart Wall Touch Light Switch T0 Gang 3. I previous video and post I went through entire procedure with Sonoff Basic switch.
I made video how to prepare hardware and flash with Tasmota firmware:
There are also OpenHAB files required for MQTT communication between modules. Everything you find also here step by step.
Hardware preparing
Before you flash Sonoff Smart Wall Touch Light Switch you have to go inside and identify pins for connecting your FTDI USB flasher. Apart from standard VCC/GND/TX/RX we have to connect together GND and GPIO0 to enforce flashing mode.
See photo above. There are pins marked: 3V3/RX/TX/GND. I soldered 1 pin GND to get easier connect with GPIO0.
Flashing could be quite tricky. I put command sleep 5s && in front of flasher to get some time to stick properly pins for flashing time. Please watch video for the best approach.
Software flashing
Flashing Sonoff Smart Wall Touch Light Switch is pretty simple. There is not much difference between flashing Sonoff RF Basic/Bridge and any other ESP8266. I covered flashing in more details in THIS post. Please with it familiar first.
I downloaded the most recent version of Tasmota v6.6.1 . Just sonoff normal version. I assume that you have esptool, sonoff firmware. Before you connect flasher you have to keep button pushed. Then press enter and flashing process should begin.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 |
greg-lap /home/greg/sonoff # sleep 5s && ./esptool-2.7/esptool.py --port /dev/ttyUSB0 write_flash -fs 1MB -fm dout 0x0 sonoff.bin esptool.py v2.7 Serial port /dev/ttyUSB0 Connecting.... Detecting chip type... ESP8266 Chip is ESP8285 Features: WiFi, Embedded Flash Crystal is 26MHz MAC: 2c:f4:32:be:b4:ab Uploading stub... Running stub... Stub running... Configuring flash size... Compressed 515872 bytes to 355877... Wrote 515872 bytes (355877 compressed) at 0x00000000 in 32.0 seconds (effective 129.0 kbit/s)... Hash of data verified. Leaving... Hard resetting via RTS pin... |
done.
Connecting to the device
After initial run you should be able to see additional wifi network around. Sonof-XXXX or Tasmota-XXXX depends on firmware version.
Connect your Sonoff Smart Wall Touch Light Switch to a power source and grab your smartphone (or tablet or laptop or any other web and Wi-Fi capable device). Search for a Wi-Fi AP named sonoff-xxxx (where x is a number) and connect to it. In this example the Wi-Fi AP is named sonoff-5291 When it connects to the network, you may get a warning that there is no Internet connection and be prompted to connect to a different network.
After you have connected to the Tasmota Wi-Fi AP, open http://192.168.4.1 in a web browser on the smartphone (or whatever device you used). Some devices might prompt you to sign in to Wi-Fi network which should also open the above address. In configuration UI follow steps to add your home AP. After applying settings Sonoff Smart Wall Touch Light Switch will be trying to connect there. From now you may access it from your network.
If you don’t have access to your router you can find your newly flashed device with an IP scanner:
- Fing – for Android or iOS
- Angry IP Scanner – open source for Linux, Windows and Mac.
- Super Scan – Windows only too (free)
- Tasmota Device Locator – Browser-based
As the sonoff.bin is general solution for various supported hardware you have to configure it to support Sonoff Smart Wall Touch Light Switch. Please find screenshots with ready to use settings.
PRE-Configuration
First action is connecting to device and running console. You have to type there:
1 |
SetOption13 1 |
Tasmota has functionality to perform special actions on multiple button presses and long press for 40 seconds resets firmware to default. This will cause the T1 board to reset if relay board is not connected, because long press on Button1 will be detected.
Configuration
Configure module and select Sonoff T1 3CH Module unless is not automatically detected.
Enable MQTT and define topics/hostname
Other Settings to enable MQTT
Finally after few restarts you should get default view of Sonoff Smart Wall Touch Light Switch with button states.
OpenHAB Configuration
As usual I put OpenHAB configuration snippets. I put also for context previously configured here and here items. For you relevant entries for Sonoff Smart Wall Touch Light Switch were added as last ones in the bottom.
.things
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
Bridge mqtt:broker:localbroker [ host="MQTT-Broker-IP", secure=false, clientID="OpenHABv2" ] { Thing mqtt:topic:sonoffbridge { Channels: Type string : reachable "Reachable" [ stateTopic="tele/sonoff-bridge/LWT" ] Type string : receiveddata "Received Data" [ stateTopic="tele/sonoff-bridge/RESULT", transformationPattern="JSONPATH:$.RfReceived.Data"] Type string : receivedsync "Received Sync" [ stateTopic="tele/sonoff-bridge/RESULT", transformationPattern="JSONPATH:$.RfReceived.Sync"] Type string : receivedlow "Received Low" [ stateTopic="tele/sonoff-bridge/RESULT", transformationPattern="JSONPATH:$.RfReceived.Low"] Type string : receivedhigh "Received High" [ stateTopic="tele/sonoff-bridge/RESULT", transformationPattern="JSONPATH:$.RfReceived.High"] Type string : receivedrfkey "Received RfKey" [ stateTopic="tele/sonoff-bridge/RESULT", transformationPattern="JSONPATH:$.RfReceived.RfKey"] Type number : rssi "WiFi Signal Strength" [ stateTopic="tele/sonoff-bridge/STATE", transformationPattern="JSONPATH:$.Wifi.RSSI"] Type contact : door1 "Door 1" [ stateTopic="tele/sonoff-bridge/RESULT", transformationPattern="JSONPATH:$.RfReceived.Data" ,allowedStates="082439,082433", off="082439", on="082433"] //basic switch: Type switch : basic1 "Sonoff Basic 1" [ stateTopic="stat/sonoff-basic1/Power", commandTopic="cmnd/sonoff-basic1/Power", transformationPattern="JSONPATH:$.POWER" ] //wall gang 3 sonoff switch Type switch : wall1-p1 "Sonoff T0 1" [ stateTopic="stat/sonoff-wall1/RESULT", commandTopic="cmnd/sonoff-wall1/POWER1", transformationPattern="JSONPATH:$.POWER1" ] Type switch : wall1-p2 "Sonoff T0 2" [ stateTopic="stat/sonoff-wall1/RESULT", commandTopic="cmnd/sonoff-wall1/POWER2", transformationPattern="JSONPATH:$.POWER2" ] Type switch : wall1-p3 "Sonoff T0 3" [ stateTopic="stat/sonoff-wall1/RESULT", commandTopic="cmnd/sonoff-wall1/POWER3", transformationPattern="JSONPATH:$.POWER3" ] } } |
.items
1 2 3 4 5 |
Switch sonoffbasic1 "Table Light" <light> (GF_Living) ["Lighting"] {channel="mqtt:topic:sonoffbridge:basic1" } Switch sonoffwall1_p1 "1 Light" <light> (GF_Living_Ceiling_Lights) ["Lighting"] { channel="mqtt:topic:sonoffbridge:wall1-p1" } Switch sonoffwall1_p2 "2 Lights" <light> (GF_Living_Ceiling_Lights) ["Lighting"] { channel="mqtt:topic:sonoffbridge:wall1-p2" } Switch sonoffwall1_p3 "Table Light" <light> (GF_Living_Table_Lights) ["Lighting"] { channel="mqtt:topic:sonoffbridge:wall1-p3" } |
.sitemap
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
Group item=GF_Sonoff_RF { Text item=GF_Sonoff_RF_Reachable label="Status [%s]" Text item=GF_Sonoff_RF_Received_Data label="Data [%s]" Text item=GF_Sonoff_RF_Received_Sync label="Sync [%s]" Text item=GF_Sonoff_RF_Received_Low label="Low [%s]" Text item=GF_Sonoff_RF_Received_High label="High [%s]" Text item=GF_Sonoff_RF_Received_RfKey label="RfKey [%s]" Text item=GF_Sonoff_RF_RSSI label="WiFi Signal Strength [%d %%]" Text item=GF_Sonoff_RF_Door_1 label="Door [%s]" // sonoff basic switch: Switch item=sonoffbasic1 // sonoff wall touch switch: Switch item=sonoffwall1_p3 label="Lampka nad stołem" icon="light" Switch item=sonoffwall1_p2 label="Lampa 2 światła" icon="light" Switch item=sonoffwall1_p1 label="Lampa 1 światło" icon="light" } |
hopefully works.
Promo
Now Sonoff smart devices are cheaper: SONOFF -15% OFF