pir - wolfen351/public-micropython-iot-platform GitHub Wiki

Overview

The PIR module is responsible for detecting motion using two PIR sensors (Sensor A and Sensor B). It provides telemetry data and processes commands based on the sensor states.

Features

  • Motion detection using two PIR sensors.
  • Telemetry reporting for each sensor.
  • Command generation when motion is detected.

UI Hardware / Pinout Configuration

  • Pin A: Configurable via basicSettings['pir']['pinA'].
  • Pin B: Configurable via basicSettings['pir']['pinB'].

Telemetry Provided

  • pirA: State of Sensor A (0 or 1).
  • pirB: State of Sensor B (0 or 1).

Telemetry Consumed

  • None.

Commands Provided

  • Command for motion detection on Sensor A: Configurable via basicSettings['pir']['pinACommand'].
  • Command for motion detection on Sensor B: Configurable via basicSettings['pir']['pinBCommand'].

Commands Consumed

  • None.

Additional Information

  • The module's UI is defined in the index.html file, which displays the state of both sensors.
  • The module uses pull-up resistors for the PIR sensor pins.
  • Errors during initialization (e.g., missing pin configuration) are logged using SerialLog.