Controlling Actuators

Last updated March 14, 2026


ActuatorToggle Card

The ActuatorToggle card provides on/off control for relays, switches, and other binary actuators.

Toggle Switch

Click the toggle to send a command to the Pi:

  1. The dashboard writes the desired state to Firebase RTDB
  2. Node-RED on the Pi reads the command
  3. The actuator hardware is switched
  4. The Pi confirms the new state back to RTDB
  5. The card updates to reflect the confirmed state

Staleness Detection

The card monitors how recently the Pi confirmed the actuator state:

  • Fresh (green dot) — State confirmed within the expected interval
  • Stale (yellow dot) — No confirmation received recently, may indicate a communication lag
  • Offline (red dot) — No confirmation for an extended period

Timeout and Retry

If a command does not get confirmed within the timeout window:

  • The card shows a retry button
  • You can re-send the command
  • If the Pi is offline, the command queues in RTDB and executes when the Pi reconnects

Command Flow

Actuator commands follow the unidirectional data flow:

  1. Dashboard writes desired state to /devices/{id}/actuators/{name} in RTDB
  2. Node-RED on Pi subscribes to that path and receives the command
  3. Hardware GPIO pin is set high or low
  4. Node-RED publishes the confirmed state back to RTDB
  5. Dashboard subscribes to the confirmed state and updates the card

The cloud never directly controls hardware. All commands go through the Pi's Node-RED engine.

Safety Considerations

  • PID-controlled actuators — Manual toggle may conflict with the PID loop. The card shows a warning when the actuator is under PID control.
  • Offline mode — If the Pi loses internet, actuators remain in their last commanded state. PID loops continue running locally.
  • Power loss — Relay state after power restore depends on the relay module (most default to OFF).

Scheduled Control

Actuators can be controlled on a schedule:

  • Time-based rules — Turn on at 6 AM, off at 10 PM
  • Interval rules — Toggle every 15 minutes for 5 minutes
  • Conditional rules — Combine with sensor readings (IF temperature > 30 THEN fan ON)

Schedules are configured in the Scheduled Automation section and execute on the Pi for reliability.

Next Steps

actuatorscontrolrelay