Monitoring door switches on existing wired alarm system

Hey guys! Just wanted to share my most recent project. I have an ademco (honeywell) vista 20-p home alarm system that already has wired door sensors on all of my exterior doors. Of course HA already interfaces with this system to get arm/disarm/alarm status etc, but there was no way i could see that would allow me to get the status of the door sensors. SO, i built my own interface!

My board uses a wemos d1 mini running tasmota, along with 2 LM393 comparators to monitor up to 4 alarm zones. On my alarm system, each zone has a Low (ground) and High (positive) wire; when the door is shut the high side is at about 4 volts, and when it is open it is right at 12 volts.

I could have probably gotten away with using an opto-isolator IF the High wire just went to ground when the door was open/shut, but that wasn’t the case here. As it stands, i have a voltage divider that puts out about 8 volts that i’m using as a reference voltage for each comparator. So, the voltage divider is hooked up to pin 2 of one comparator and the high side of one of the alarm zones is hooked up to pin 3. When the door is closed, pin 3 reads 4 volts which is lower than the 8 volt reference on pin 2, so the comparator pulls pin 1 (which is hooked up to D3 on the wemos) to ground. When the door is open, pin 3 is at 12 volts, which is higher than pin 2’s 8 volts, so the comparator pulls pin 1 high.

The vista 20p just happens to run at 12v and it also contains a 12v SLA backup battery, so it was pretty easy to hook up a 12v usb car charger to run the wemos. The comparators accept anywhere from 2 to 36 volts and are powered directly from the 12v backup battery, via the 3 pin header on the board. I labeled it 12v but it should have said +VCC. The 4 input pins are labeled with the corresponding pins that the comparators are hooked up to, just for reference, and i’ve also broken out a few unused IO pins on JP1, which has labels on the bottom of the board. Also, sorry the solder mask is a bit of a mess, this is only my 2nd or so attempt at designing a PCB.

schematic
board

Tasmota of course updates HA via MQTT, the screenshot below shows how the pins are configured. For some reason the firmware version i’m running will not send the correct messages when the “switches” turn on and off if there is not also a relay configured, so i just picked some unused pins for the relays to be configured on. Also, you have to go to the Console of tasmota and change the switchmode for each switch pin to 1 (switchmode1 1 switchmode2 1 …etc) so that it reports On and Off instead of just Toggle.

tasmota

3 boards from Osh Park were a little less than $10, i think the comparators were about $5 for 5, and I already had the resistors and diodes. So, for ~$17 my porch and garage lights automatically turn on now when I open either of those doors :smile:

…didn’t realize that would all be such a long post. I hope all of that made sense!

3 Likes

Oh and I forgot to mention, they are configured as MQTT binary sensors in HA:

binary_sensor:
  - platform: mqtt
    state_topic: 'stat/wemos/POWER1'
    name: 'Back Door'
    payload_on: "ON"
    payload_off: "OFF"
  - platform: mqtt
    state_topic: "stat/wemos/POWER2"
    name: "Front Door"
    payload_on: "ON"
    payload_off: "OFF"
  - platform: mqtt
    state_topic: "stat/wemos/POWER3"
    name: "Back Porch Door"
    payload_on: "ON"
    payload_off: "OFF"