Automation

Automations provide a method to automate tasks and action.

  • Trigger data - The model data that will trigger (start) this automation.

Commands

  • Start - Start this automation.
  • Stop - Stop this automation.

Properties

Enable

Enable this automation.

  • Data type: boolean
  • Default: true
  • Configuration

CLI: (cli)> config alerting sensor-alert <key> automation enable

Label

The label used to describe and locate this automation.

  • Data type: string
  • Default: Alert Logic
  • Configuration
  • Optional

CLI: (cli)> config alerting sensor-alert <key> automation label

Running

The run status of this automation.

OptionLabel
trueRunning
falseNot running
  • Data type: boolean
  • Status

CLI: (cli)> show alerting sensor-alert <key> automation running

Error

The error associated with the recent failed run.

  • Data type: string
  • Status

CLI: (cli)> show alerting sensor-alert <key> automation error

Script

The javascript automation source.

  • Data type: string
  • Default: `const alerting = await import('@dryjs/alerting'); const alerts = await alerting.handleSensorAlert(data);

//Alter this function to implement a custom alert function customAlert(alerts) { console.log(alerts); }

if (alerts.length > 0) await alerting.processAlerts(data, alerts, customAlert);`

  • Configuration
  • Required

CLI: (cli)> config alerting sensor-alert <key> automation script

Run schedule

Run the automation action on a schedule.

  • Data type: string
  • Configuration
  • Optional

CLI: (cli)> config alerting sensor-alert <key> automation schedule

Run on start

Run the automation action immediately after boot up or the automation is added.

  • Data type: boolean
  • Default: true
  • Configuration

CLI: (cli)> config alerting sensor-alert <key> automation run-on-start