Issues with motion sensor

Has anyone had a play with one of these before?
It just always shows as motion detected/active but I’ve never seen it change state.

Any ideas?


I have a few of those. Some of them have been quite erratic. I have not played with sensitivity and timing, but that is on my to do list. I did buy a more expensive version from PiHut and that seems to have been rock solid. Again I need to do some better testing

I have a couple of those in use. Powered at 5V as recommended (docs) — needed a bit of experimentation with the sensitivity control to get it working well with minimal false positives.

My utility room sensor is super-sensitive, but doesn’t trigger once overnight — so good results are possible.

1 Like

This issue I am having is it just stays in a state “detected” and doesn’t change.

I can get it to switch out of the detected state.

Show us your wiring and your ESPHome configuration.

1 Like

I just have

binary_sensor:
  - platform: gpio
    pin: 13
    name: "PIR Sensor"
    device_class: motion

I have it wired exactly as per the image below except im using GPIO13.
ESP32dev board.

I also did continuity to find which is the + pin as there are some that are reversed. I found the + by checking it against the regulator.

Thanks

As I said I tried another pir from PiHut and seemed to work a lot better.

You didn’t set pin to be input… (“mode: input”)

1 Like

Thanks, it doesnt like the config.

binary_sensor:
  - platform: gpio
    pin: 27
    mode; input
    name: "PIR Sensor"
    device_class: motion

It’s “mode: input”, not “mode; input” (note red warning color for mode…)

1 Like

haha sorry its late.

See below…

INFO Reading configuration /config/esphome/pir-sensor-1.yaml...
Failed config

binary_sensor.gpio: [source /config/esphome/pir-sensor-1.yaml:32]
  platform: gpio
  pin: 27
  
  [mode] is an invalid option for [binary_sensor.gpio]. Please check the indentation.
  mode: input
  name: PIR Sensor
  device_class: motion

Indentation… mode goes under “pin” so mode…must be indented. Check help for esphome—> gpio binary sensor.

So you have it powered from the 3V3 pin, I think? The docs recommend you use 5V.

Here’s the relevant snippet from my code, which is on a Wemos D1 Mini running two motion detectors:

binary_sensor:
  - platform: gpio
    pin: D2
    name: "Utility room motion"
    device_class: motion
    filters:
      - delayed_off: 10s

  - platform: gpio
    pin: D1
    name: "Garage motion"
    device_class: motion
    filters:
      - delayed_off: 10s

Both are powered from the 5V line.