I have 21 hardwired motion detectors in my house centrally wired to two Esp32 devices running ESPHome. One of these ESP32’s is hooked to 12 of the detectors and works flawlessly. The other ESP32 is hooked to 9 detectors. On this ESP32 6 of the detectors are changing their state every second or more. How can I fix these so they are stable?
Here is my ESP32 code
esphome:
name: motion_sensor_board_2
platform: ESP32
board: nodemcu-32s
wifi:
ssid: "Basement_AP_IoT"
password: "XXXXXXXX"
#Static IP
manual_ip:
static_ip: 192.168.1.105
gateway: 192.168.1.1
subnet: 255.255.255.0
#Turn Off Power Save Mode
power_save_mode: none
# Enable fallback hotspot (captive portal) in case wifi connection fails
ap:
ssid: "Motion-Sensor-Board-2"
password: "YG6ZvkWHIdDt"
captive_portal:
# Enable logging
logger:
# Enable Home Assistant API
api:
ota:
binary_sensor:
- platform: gpio
pin:
number: GPIO18
mode: INPUT_PULLUP
name: "Basement Garage Door Beam Sensor"
device_class: motion
- platform: gpio
pin:
number: GPIO5
mode: INPUT_PULLUP
name: "Side Garage Motion 3"
device_class: motion
- platform: gpio
pin:
number: GPIO17
mode: INPUT_PULLUP
name: "Side Garage Motion 2"
device_class: motion
- platform: gpio
pin:
number: GPIO16
mode: INPUT_PULLUP
name: "Side Garage Motion 1"
device_class: motion
- platform: gpio
pin:
number: GPIO32
mode: INPUT_PULLUP
name: "Side Garage Beam Sensor"
device_class: motion
- platform: gpio
pin:
number: GPIO33
mode: INPUT_PULLUP
name: "Big Garage Beam Sensor"
device_class: motion
- platform: gpio
pin:
number: GPIO25
mode: INPUT_PULLUP
name: "Upstairs Hall Motion"
device_class: motion
- platform: gpio
pin:
number: GPIO26
mode: INPUT_PULLUP
name: "Master Toilet Motion"
device_class: motion
- platform: gpio
pin:
number: GPIO27
mode: INPUT_PULLUP
name: "Kassidy Closet Motion"
device_class: motion
- platform: gpio
pin:
number: GPIO14
mode: INPUT_PULLUP
name: "Beyer Closet Motion"
device_class: motion
- platform: gpio
pin:
number: GPIO12
mode: INPUT_PULLUP
name: "Master Closet Motion"
device_class: motion
- platform: gpio
pin:
number: GPIO13
mode: INPUT_PULLUP
name: "Garage Closet Motion"
device_class: motion
Here’s the log showing the problem.
[21:16:42][D][binary_sensor:036]: 'Kassidy Closet Motion': Sending state OFF
[21:16:42][D][binary_sensor:036]: 'Beyer Closet Motion': Sending state OFF
[21:16:42][D][binary_sensor:036]: 'Master Closet Motion': Sending state OFF
[21:16:42][D][binary_sensor:036]: 'Garage Closet Motion': Sending state OFF
[21:16:42][D][binary_sensor:036]: 'Upstairs Hall Motion': Sending state OFF
[21:16:42][D][binary_sensor:036]: 'Master Toilet Motion': Sending state OFF
[21:16:42][D][binary_sensor:036]: 'Kassidy Closet Motion': Sending state ON
[21:16:42][D][binary_sensor:036]: 'Beyer Closet Motion': Sending state ON
[21:16:42][D][binary_sensor:036]: 'Master Closet Motion': Sending state ON
[21:16:42][D][binary_sensor:036]: 'Garage Closet Motion': Sending state ON
[21:16:42][D][binary_sensor:036]: 'Upstairs Hall Motion': Sending state ON
[21:16:42][D][binary_sensor:036]: 'Master Toilet Motion': Sending state ON
[21:16:43][D][binary_sensor:036]: 'Upstairs Hall Motion': Sending state OFF
[21:16:43][D][binary_sensor:036]: 'Master Toilet Motion': Sending state OFF
[21:16:43][D][binary_sensor:036]: 'Kassidy Closet Motion': Sending state OFF
[21:16:43][D][binary_sensor:036]: 'Beyer Closet Motion': Sending state OFF
[21:16:43][D][binary_sensor:036]: 'Master Closet Motion': Sending state OFF
[21:16:43][D][binary_sensor:036]: 'Garage Closet Motion': Sending state OFF
[21:16:43][D][binary_sensor:036]: 'Kassidy Closet Motion': Sending state ON
[21:16:43][D][binary_sensor:036]: 'Beyer Closet Motion': Sending state ON
[21:16:43][D][binary_sensor:036]: 'Master Closet Motion': Sending state ON
[21:16:43][D][binary_sensor:036]: 'Garage Closet Motion': Sending state ON
[21:16:43][D][binary_sensor:036]: 'Upstairs Hall Motion': Sending state ON
[21:16:43][D][binary_sensor:036]: 'Master Toilet Motion': Sending state ON
[21:16:44][D][binary_sensor:036]: 'Upstairs Hall Motion': Sending state OFF
[21:16:44][D][binary_sensor:036]: 'Master Toilet Motion': Sending state OFF
[21:16:44][D][binary_sensor:036]: 'Kassidy Closet Motion': Sending state OFF
[21:16:44][D][binary_sensor:036]: 'Beyer Closet Motion': Sending state OFF
[21:16:44][D][binary_sensor:036]: 'Master Closet Motion': Sending state OFF
[21:16:44][D][binary_sensor:036]: 'Upstairs Hall Motion': Sending state ON
[21:16:44][D][binary_sensor:036]: 'Master Toilet Motion': Sending state ON
[21:16:44][D][binary_sensor:036]: 'Kassidy Closet Motion': Sending state ON
[21:16:44][D][binary_sensor:036]: 'Beyer Closet Motion': Sending state ON
[21:16:44][D][binary_sensor:036]: 'Master Closet Motion': Sending state ON