Skip to content

Event-Driven Sensor Updates

These are JSON events sent by the ESP32 when the state of a monitored sensor changes.


Sent when a change is detected in a sensor enabled via enable_monitor.

Event Fields:

FieldTypeDescription
actionstring"sensor_update"
typestringThe sensor type: "button", "potentiometer", or "touch".
pinintThe GPIO pin number.
valueintThe new sensor value (state for button, analog reading for potentiometer and touch).
timestamplongTimestamp in milliseconds.

Event Examples:

  • Button Press:

    {"action":"sensor_update","type":"button","pin":14,"value":0,"timestamp":1234567}
  • Potentiometer Change:

    {"action":"sensor_update","type":"potentiometer","pin":34,"value":2048,"timestamp":1234567}
  • Touch Sensor Activation:

    {"action":"sensor_update","type":"touch","pin":4,"value":50,"timestamp":1234567}