PIR Sensor Not Detecting After Firmware Update (ESPHome/Tasmota)

Introduction

Many users integrate PIR sensors with ESPHome or Tasmota on ESP8266/ESP32. After a firmware update, the sensor may stop working. This is usually due to configuration changes, not hardware failure.

Common Causes

1. Pin Mapping Changes

The new firmware may use different GPIO numbering or the pin function may have changed. In ESPHome, verify that the pin number in your YAML matches the actual connection.

2. Pull-Up/Pull-Down Configuration

Some updates change default pin modes. If your sensor requires a pull-up (open-drain) and it was previously enabled by default, a new version might require explicit configuration.

3. Debounce Settings

Newer versions may have different default debounce times. If the debounce is too long, short pulses may be ignored.

4. Inverted Logic

Some sensors output active LOW (open-drain) instead of active HIGH. The configuration may need `platform: gpio` with `inverted: true`.

5. Platform Changes

Major version updates can change how binary sensors are defined. Always check release notes.

ESPHome Configuration Fixes

Example working configuration for PIR sensor:

binary_sensor:
  - platform: gpio
    pin: 
      number: GPIO4
      mode: INPUT_PULLUP
      inverted: true  # If sensor outputs LOW when triggered
    name: "Living Room Motion"
    device_class: motion
    filters:
      - delayed_on: 50ms
      - delayed_off: 500ms

Tasmota Configuration

In Tasmota, use:

SetOption114 1  # Enable pulse counter mode
Rule1 on motion#boot do publish stat/%topic%/MOTION 1 endon

Step-by-Step Troubleshooting

  1. Revert to previous firmware version to confirm sensor hardware still works.
  2. Check ESPHome logs for errors or warnings about the pin.
  3. Test with a simple configuration that only reads the pin and prints state.
  4. Verify with a multimeter that the sensor output is actually changing.
  5. Compare your current YAML with the example above.

Case Study: ESPHome 2024 to 2025 Upgrade

After upgrading ESPHome from 2024.12 to 2025.2, a user’s PIR sensor stopped working. The issue was that the new version required explicit `mode: INPUT_PULLUP` whereas previously it defaulted to pull-up. Adding this line fixed it.

Conclusion

Firmware updates can change behavior. Always keep a backup of working configurations and test changes incrementally.

Leave a Reply

Your email address will not be published. Required fields are marked *