I’m trying to use this sensor to tell when someone walks into my garage to turn the lights on. I am powering the sensor using a 12V 1amp power supply hooked to the brown & blue wires. The unit has a white common wire, a gray (NC) wire and black (NO) wire. I have the white common wire hooked to ground on a ESP32 board and the black (NO) wire hooked to GPIO 23. Here is my ESPHome code
> esphome:
> name: motion_sensor_board
> platform: ESP32
> board: nodemcu-32s
> wifi:
> ssid: "Too Fly For My WiFi"
> password: "XXXXXXXXXXX"
> #Static IP
> manual_ip:
> static_ip: 192.168.1.199
> 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"
> password: "XXXXXXXXXXXX"
> captive_portal:
> # Enable logging
> logger:
> # Enable Home Assistant API
> api:
> ota:
> binary_sensor:
> - platform: gpio
> pin: GPIO23
> name: "Garage Sensor"
When the sensor is not tripped the log shows
[21:16:00][D][binary_sensor:036]: 'Garage Sensor': Sending state OFF
When the sensor is tripped the log repeatedly goes from on to off several times per second
[21:15:59][D][binary_sensor:036]: 'Garage Sensor': Sending state ON
[21:15:59][D][binary_sensor:036]: 'Garage Sensor': Sending state OFF
[21:15:59][D][binary_sensor:036]: 'Garage Sensor': Sending state ON
[21:15:59][D][binary_sensor:036]: 'Garage Sensor': Sending state OFF
[21:15:59][D][binary_sensor:036]: 'Garage Sensor': Sending state ON
[21:15:59][D][binary_sensor:036]: 'Garage Sensor': Sending state OFF
[21:15:59][D][binary_sensor:036]: 'Garage Sensor': Sending state ON
[21:15:59][D][binary_sensor:036]: 'Garage Sensor': Sending state OFF
[21:15:59][D][binary_sensor:036]: 'Garage Sensor': Sending state ON
[21:15:59][D][binary_sensor:036]: 'Garage Sensor': Sending state OFF
[21:15:59][D][binary_sensor:036]: 'Garage Sensor': Sending state ON
[21:15:59][D][binary_sensor:036]: 'Garage Sensor': Sending state OFF
[21:15:59][D][binary_sensor:036]: 'Garage Sensor': Sending state ON
[21:15:59][D][binary_sensor:036]: 'Garage Sensor': Sending state OFF
[21:15:59][D][binary_sensor:036]: 'Garage Sensor': Sending state ON
[21:15:59][D][binary_sensor:036]: 'Garage Sensor': Sending state OFF
[21:15:59][D][binary_sensor:036]: 'Garage Sensor': Sending state ON
[21:15:59][D][binary_sensor:036]: 'Garage Sensor': Sending state OFF
[21:15:59][D][binary_sensor:036]: 'Garage Sensor': Sending state ON
[21:16:00][D][binary_sensor:036]: 'Garage Sensor': Sending state OFF
[21:16:00][D][binary_sensor:036]: 'Garage Sensor': Sending state ON
[21:16:00][D][binary_sensor:036]: 'Garage Sensor': Sending state OFF
[21:16:00][D][binary_sensor:036]: 'Garage Sensor': Sending state ON
[21:16:00][D][binary_sensor:036]: 'Garage Sensor': Sending state OFF
[21:16:00][D][binary_sensor:036]: 'Garage Sensor': Sending state ON
[21:16:00][D][binary_sensor:036]: 'Garage Sensor': Sending state OFF
[21:16:00][D][binary_sensor:036]: 'Garage Sensor': Sending state ON
[21:16:00][D][binary_sensor:036]: 'Garage Sensor': Sending state OFF
[21:16:00][D][binary_sensor:036]: 'Garage Sensor': Sending state ON
[21:16:00][D][binary_sensor:036]: 'Garage Sensor': Sending state OFF
Does anyone have any ideas on how to fix this?