Difference between revisions of "Sonoff Touch"

From Let's Control It
Jump to navigation Jump to search
Line 57: Line 57:
  
 
----
 
----
'''LED'''
+
'''Switch to Relay rule'''
 +
 
 +
<pre style="color: #0077dd">
 +
on touch#switch do
 +
  if [touch#switch]=1 do
 +
  gpio,12,1
 +
  else
 +
  gpio,12,0
 +
  endif
 +
endon
 +
</pre>
 +
 
 +
'''LED rule'''
  
 
Depending if you want the LED to be on or off when the relay is open/closed you may use this rule:
 
Depending if you want the LED to be on or off when the relay is open/closed you may use this rule:

Revision as of 18:40, 19 July 2017

Introduction

Hardware

Sonoff-Touch-001.jpg

  • ESP chip version: ESP8285
  • Flash size: 1M
  • Onboard USB-TTL converter: No
  • GPIO's broken out/available to free use: None
  • GPIO tied to onboard hardware: 0 (button), 12 (Relay 2A@230VAC), 13 (LED blue)
  • Power supply information: 90-250VAC
  • Antenna: onboard PCB antenna

Sonoff-Touch-002.jpg

Wiring/flashing

A programmer is needed to flash this device.

(Progammer -> ESP8285):

3.3V -> VCC (first via [square] on board) 
TX -> RX (second via on board)
RX -> TX (third via on board)
GND -> GND (forth via on board)

In order to get the ESP8285 in flash mode the GPIO-0 needs to be LOW. (See picture with explanations below.)

Already soldered board fitted in the casing.

Sonoff-Touch-003.jpg

Soldered board seen from front.

Sonoff-Touch-004.jpg

Soldered board seen from bottom.

Sonoff-Touch-005.jpg

ESP Easy

Devices

Sonoff touch 001.PNG


Switch

Sonoff touch 002.PNG


Relay

Sonoff touch 003.PNG


Switch to Relay rule

 on touch#switch do
  if [touch#switch]=1 do
   gpio,12,1
  else
   gpio,12,0
  endif
 endon 

LED rule

Depending if you want the LED to be on or off when the relay is open/closed you may use this rule:

 on relay#switch do
  if [relay#switch]=1 do  //change this [relay#switch]=0 for LED off when relay is closed
   gpio,13,1
  else
   gpio,13,0
  endif
 endon