π‘οΈ Temperature sensor
Combine with temperature for complete room sensor.

PIR sensors are perfect for detecting motion. Turn on lights automatically, get notified when someone comes home, or build a simple alarm system.
| Part | Description | Price |
|---|---|---|
| ESP32 DevKit | WiFi microcontroller | $5 |
| HC-SR501 PIR | Motion sensor | $2 |
| Jumper wires | 3 pcs male-female | $1 |
| Total | ~$8 |
Red (VCC) β ESP32 5V or VIN pin
Yellow (OUT/Signal) β ESP32 GPIO5
Black (GND) β ESP32 GND
esphome: name: hallway-sensor friendly_name: Hallway Sensor
esp32: board: esp32dev
logger:api: encryption: key: "your-key"ota: platform: esphome
# PIR Motion Sensorbinary_sensor: - platform: gpio pin: GPIO5 name: "Hallway Motion" device_class: motion filters: - delayed_off: 10s # Keep "on" for 10 sec after motion
# Optional: Status LEDlight: - platform: status_led name: "Status LED" pin: GPIO2
wifi: ssid: "your-wifi" password: "your-password"Click INSTALL β Wirelessly (or USB first time)
Go to Home Assistant β Developer Tools β States
Search for binary_sensor.hallway_motion
Walk past the sensor - status changes to on
HC-SR501 has two small screws you can adjust:
ββββββββββββββββββββββββββββ ββ [Time] [Sens] ββ β β ββ Duration Sensitivity ββ ββββββββββββββββββββββββββββ| Screw | Counter-clockwise | Clockwise |
|---|---|---|
| Time | Shorter βonβ time (~3s) | Longer βonβ time (~5min) |
| Sensitivity | Shorter range (~3m) | Longer range (~7m) |
automation: - alias: "Turn on hallway light on motion" trigger: - platform: state entity_id: binary_sensor.hallway_motion to: "on" action: - service: light.turn_on target: entity_id: light.hallwayautomation: - alias: "Turn on hallway light at night" trigger: - platform: state entity_id: binary_sensor.hallway_motion to: "on" condition: - condition: sun after: sunset before: sunrise action: - service: light.turn_on target: entity_id: light.hallway data: brightness_pct: 50 - delay: "00:02:00" - service: light.turn_off target: entity_id: light.hallwayautomation: - alias: "Smart hallway light" mode: restart # Restart timer on new motion trigger: - platform: state entity_id: binary_sensor.hallway_motion to: "on" action: - service: light.turn_on target: entity_id: light.hallway data: brightness_pct: "{{ 30 if is_state('sun.sun', 'below_horizon') else 80 }}" - wait_for_trigger: - platform: state entity_id: binary_sensor.hallway_motion to: "off" for: "00:02:00" - service: light.turn_off target: entity_id: light.hallway| Project | Description |
|---|---|
| Automatic light | Turn on lights in hallway on motion |
| Security alarm | Send notification when away |
| Activity log | Track when rooms are used |
| Smart heating | Heat only used rooms |
π‘οΈ Temperature sensor
Combine with temperature for complete room sensor.
π‘ LED Strip
Turn on LED strip on motion for ambient light.