Connect wired alarm system sensors to SmartThings with a NodeMCU ESP8266 [deprecated]

Eric,

Just trying to help from afar… Your door/window magnetic reed switch has four wires attached to it. I have not seen this before. Are there actually four screw terminals on the contact switch, one for each wire? Or are some of the wires doubled up? Can you take a picture of the side of the switch where the wires attach?

At the point in your house where all of the wires come out of the wall (i.e. where your alarm panel would be installed, if you had one), do you have 4 wires per sensor? In other words, do you have 1 gray cable (with 4 wires inside, white, red, green, black) for every contact sensor? I am curious if the pre-wiring was done in a “zone configuration” with only one set of wires coming back to the alarm panel area per a gorup/zone of doors/windows.

Usually a magnetic contact sensor, like the one you have pictured above, is simply a single pair of normally open contacts. When a magnet is placed near it, these contacts are closed, completing the circuit. In this way, if a wire is cut (intentionally or accidentally) the alarm will be triggered, the same as if the door/window was opened causing the magnet to move away from the switch.

You should only need to use 1 pair of wires per door/window switch, attached to whatever processor you choose to use. You mention using an Arduino, however this discussion thread is specific to using an NodeMCU ESP8266 board. Which processor are you planning on using? If you’re using an Arduino, you may want to look at my ST_Anything project. ST_Anything works with both Arduino’s as well as ESP8266 based boards.

Regardless of the processor you choose, typically you will wire one side of the contact door/window contact switch to the GND terminal on your Arduino/ESP8266. The other side is wired to one of the digital input pins on your board. By using the “Internal Pullup” feature, the board will send a +5v or +3.3v out the digital input pin to the switch. If the door/window is closed, the switch will be closed, thereby connected GND to the corresponding pin on your board. This will be detected as a “LOW” state of the pin by the software. When the door/window is opened, the circuit opens up, causing the Internal Pullup feature to put 5v or 3.3v on the pin, resulting in a HIGH condition being seen by the software.

Hopefully this helps explain the wiring. I am still confused by your contact sensors having 4 wires attached to them, though…

Dan