Device Status Change Trigger
The Device Status Change trigger fires an automation rule when a device transitions between the online and offline states. Use it to alert on unexpected equipment outages, trigger recovery actions, or log connectivity events to an external system.
How It Works
VWire tracks each device's connectivity state in real time via the MQTT broker heartbeat and the device's last-seen timestamp. When a device connects or disconnects, the platform emits a status change event — and any rule watching that device with this trigger type is evaluated.
Device disconnects from MQTT (or heartbeat times out)
│
▼
Status: online → offline (transition detected)
│
▼
Rules watching this device for "Offline" or "Any change" fire
│
▼
Conditions checked → Actions run
The trigger fires on the state change — not on the state itself. If a device stays offline for 6 hours, the trigger fires once (when it goes offline), not continuously. This prevents action spam during prolonged outages.
When to Use This Trigger
| Use Case | Example |
|---|---|
| Outage alert | Gateway goes offline → push alarm to on-call engineer |
| Recovery notification | Device comes back online → send "✅ Device restored" notification |
| External logging | Device status changes → POST to incident management webhook |
| Watchdog relay | Critical sensor goes offline → trigger a hardware reset relay |
| SLA tracking | Log every offline event to an external system via email/webhook |
Step-by-Step Setup
Step 1 — Basics
Name the rule clearly (e.g. "Gateway Offline Alert"). Select the Project the device belongs to.
Step 2 — Trigger
Select Device Status Change from the trigger type list.
| Field | Description |
|---|---|
| Device | The device to watch. Only devices in the selected project are shown. |
| When device goes | Offline, Online, or Any change |
Fire when options explained:
| Option | Fires when |
|---|---|
| Offline | Device disconnects or heartbeat times out |
| Online | Device connects and is recognised as active |
| Any change | Either direction (online → offline or offline → online) |
Step 3 — Conditions (optional)
Conditions for status-change rules typically check other pin values rather than the status itself, since the status is already encoded in the trigger. Examples:
- Fire the "offline" alert only if pin V5 (a "critical system" flag) =
1 - Skip alerts during maintenance windows by using the Active Time Window option instead
If you add no conditions, the rule fires on every matching status transition.