Overview

In our garage we have an attic hatch to the second floor storage space. Unfortunately, having the hatch open interferes with the garage door opening. Because of this fact, we wanted to disable the garage door when the hatch was open.



Solution

We decided to use a SONOFF S20 attached to a door sensor.

Parts

PartImageURL
Sonoff S20

image2020-10-14_15-51-13.png


Gikfun MC-38 Wired Door Window Sensor for Arduino EK1656C




Wiring

Connect Door sensor to GPIO3(TX on Sonoff S20 board) and GND.

Configuration


Flashed S20 with Tasmota firmware and configured as a Generic Module with the following settings:

  • Configure the Module as 18 Generic
  • Set GPIO0 as Button1
  • Set GPIO3  as Switch1
  • Set GPIO12 as  Relay1
  • Set GPIO13 as Led1



Since we want the power off when the door is open, we need to set the switchmode to inverted follow.

Via the console, set Switchmode to 2 (inverted follow 0 = on, 1 = off )

> Switchmode 2


Future

May use a SONOFF basic and hide the controller in the box behind the plug so that no wires are visible.









  • No labels