Glad it’s helpful!
Talk with your contractor about the door sensors. I ran the wire (22/2 wire, I recommend oxygen-free copper wire. It needs to be in-wall rated. I used this) to each door I wanted a sensor on (pretty much all of them) during the electrical rough in stage. I drilled a 1/2" through the framing (not the door, just the 2x4 rough framing) and dropped 3 feet of wire through each hole, then rolled it up out of the way.
If I knew which way the door would swing I put the hole on the side of the door where the handle would be. If I didn’t know I put the hole in the middle of the door frame. There’s enough room between the rough framing and the door frame for the wire to be routed to the correct side of the door. My trim guys installed the doors, I gave them a door sensor so they knew what size hole to drill (I think it was 3/8"). They drilled the hole in the door frame and pulled the wire through. I came back after paint to install the door sensor. Although, you could probably do it before paint and just as they get the doors hung. If they are going to spray foam around the exterior door frames I recommend getting the sensors in before that step.
Here’s what the sensor looks like, it’s very hidden. The top of the door also get’s a 3/8" hole and the other half of the sensor (it’s just a magnet). You can also see a ceiling-mounted motion detector in the ceiling near the attic hatch.
Here’s my wiring schematic and my ESPhome code. I only show one door sensor, but the optocoupler and ESP32 will handle 16 of them. Just run a wire from the optocoupler to a separate ESP32 GPIO for each sensor. run the hot wire from each + input on the optocoupler to the next. Then run a separate ground wire from the 12v power supply (I used this distribution block) to each door sensor. Do not run in series from one door sensor to the next, run separate wires.
esphome:
name: binary_sensor_board_1
platform: ESP32
board: nodemcu-32s
wifi:
ssid: "Basement_AP_IoT"
password: "YOURPASSWORD"
#Static IP
manual_ip:
static_ip: 192.168.1.101
gateway: 192.168.1.1
subnet: 255.255.255.0
#Turn Off Power Save Mode
power_save_mode: none
fast_connect: on
# Enable fallback hotspot (captive portal) in case wifi connection fails
ap:
ssid: "binary-sensor-board-1"
password: "YG6ZvkWHIdDt"
captive_portal:
# Enable logging
logger:
# Enable Home Assistant API
api:
ota:
binary_sensor:
#Terminal 1
- platform: gpio
pin:
number: GPIO23
mode: INPUT_PULLUP
name: "Kassidys Door"
device_class: door
#Terminal 2
- platform: gpio
pin:
number: GPIO22
mode: INPUT_PULLUP
name: "Front Door"
device_class: door
#Terminal 3
- platform: gpio
pin:
number: GPIO21
mode: INPUT_PULLUP
name: "Toy Room Door"
device_class: door
#Terminal 4
- platform: gpio
pin:
number: GPIO19
mode: INPUT_PULLUP
name: "Office Door"
device_class: door
#Terminal 5
- platform: gpio
pin:
number: GPIO18
mode: INPUT_PULLUP
name: "Garage Closet Door"
device_class: door
#Terminal 6
- platform: gpio
pin:
number: GPIO5
mode: INPUT_PULLUP
name: "Garage Entry Door"
device_class: door
#Terminal 7
- platform: gpio
pin:
number: GPIO17
mode: INPUT_PULLUP
name: "Mud Room Laundry Door"
device_class: door
#Terminal 8
- platform: gpio
pin:
number: GPIO16
mode: INPUT_PULLUP
name: "Grocery Door"
device_class: door
#Terminal 9
- platform: gpio
pin:
number: GPIO32
mode: INPUT_PULLUP
name: "Garage Service Door"
device_class: door
#Terminal 10
- platform: gpio
pin:
number: GPIO33
mode: INPUT_PULLUP
name: "Powder Bath Door"
device_class: door
#Terminal 11
- platform: gpio
pin:
number: GPIO25
mode: INPUT_PULLUP
name: "Kids Toilet Door"
device_class: door
#Terminal 12
- platform: gpio
pin:
number: GPIO26
mode: INPUT_PULLUP
name: "Kids Bathroom Door"
device_class: door
#Terminal 13
- platform: gpio
pin:
number: GPIO27
mode: INPUT_PULLUP
name: "2nd Floor Guest Closet"
device_class: door
#Terminal 14
- platform: gpio
pin:
number: GPIO14
mode: INPUT_PULLUP
name: "2nd Floor Guest Door"
device_class: door
#Terminal 15
- platform: gpio
pin:
number: GPIO04
mode: INPUT_PULLUP
name: "Beyer Closet Door"
device_class: door
#Terminal 16
- platform: gpio
pin:
number: GPIO13
mode: INPUT_PULLUP
name: "Beyer Door"
device_class: door
For the motion detectors, run a 22/4 wire (same wire I linked to above, just get the 22/4 version). If you use a combination motion/glass break sensor you will need 22/6 wire, or probably just use a Cat6. The wiring schematic is the exact same as the door sensors except you also need to send the motion detector 12v power. So 2 wires handle the 12v power for the sensor, the other 2 wires take the ground wire from the power supply to the sensor and back to the optocoupler. The motion sensor either opens or closes that circuit when it sees motion. A single 12v power supply of about 2amps should easily handle all your sensors.
For placement, I tried to put them in areas where I thought it would be helpful to see motion (duh!), for the wall-mounted sensors I hung them between 7-8 ft off the floor and always in a corner. For the ceiling mounts, I tried to put them somewhat centered in the space, but I also paid attention to how they would look (like centering them between lights). Try to keep them away from heat sources, like lights and HVAC air supplies and out of direct sunlight.
For wall-mounted, I just put a small screw in the corner of wall and wrapped the wire around it. The drywall guys pulled the screw out (use a phillips head to make it easy on them) and pulled the wire through the drywall. This is the best example I could find.
For ceiling-mounted, screw or nail a 2x4 between the joists, put a 1/2" hole in the 2x4 and drop 2 feet of wire through the hole. The drywall guys will cut a hole and pull the wire through. Similar concept to what I did with this pipe, but put a wire through the hole.
I hope that helps!