Intermediate - Offline Device Monitor
Use Logic and Ledger to detect devices that stay offline too long and trigger alerts.
Introduction
This intermediate blueprint shows how to combine the Logic and Ledger cloud services to build an automated offline device monitor for a product fleet.
Supported devices
Hardware and supplies
- Particle device (Photon 2, Boron, etc.)
- USB cable
Cloud services and integrations
Logic
Ledger
Project description:
This blueprint uses a scheduled Logic function and a Cloud Ledger to monitor devices in a product and alert you when they have been offline longer than a pre-defined period.
The Logic function periodically (for example, every 60 minutes) lists all devices in
a product, checks which devices are not currently connected, and compares their
last_heard timestamps against a time threshold. Devices that are both disconnected
and past the threshold are considered offline and added to an offlineDevices list.
A Cloud Ledger is used to persist the state of offline devices between Logic runs.
By comparing the current list of offline devices with the ledger’s stored list, the
function can detect newly-offline devices and publish a single offline-device-alert
event containing just those new entries. The ledger is then updated with the latest
offline device IDs so subsequent runs don’t repeatedly alert on the same devices.
This pattern is useful for product fleets where you need proactive visibility into devices that have gone quiet, and want to trigger downstream notifications or incident workflows without writing additional firmware logic.