Home Assistant: Use a Motion Sensor to Automatically Control Lights

Motion Sensor Hardware and Calibration

  • VIN: The PIR works with either 3.3V or 5V, I recommend using 5 volts
  • GND: Connect to ground
  • DATA: The data pin is binary, and therefore needs to be connected to any input digital pin of your board
  • Time delay: determines how long the sensor sends an active high after detecting a movement, in its clockwise lowest settings, that’s about 1 second, and in the highest, about 4 minutes
  • Movement sensitivity: Controls the measurement distance from about 1,5m — 6m
  • Position H: In this position, the sensor will send an active high signal for the complete time delay setting, and in
  • Position L: When movement is detected, the sensor will send an active high followed by active and remain low for the time delay
  • Measurement distance potentiometer to 1 o’clock (lowest distance of 1,5m)
  • Movement duration to 3 o’clock (movements need to persist for 0,5–1 seconds)
  • Set the jumper to H

Motion Sensor Working Wiring

Adding to ESP Home

- platform: gpio
pin: GPIO13
name: "Living Room Motion"
device_class: motion

Adding to Home Assistant

Home Assistant Automation: Turn on Lights when Movement is Detected

alias: LED Light Motion On
description: ''
path: homeassistant/motion_light.yaml
motion_entity: binary_sensor.espdht_motion
entity_id: light.rgb_led_ring
no_motion_wait: 5




Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store