Setting up Smart Notifications

Navigation

  1. Click Settings.
  1. In the top right corner, Click Smart Notifications.
  1. In the top right, Click Add Smart Notifications.

From the right side, a form will where you can enter:

Name - Describes the Smart Notification you are trying to integrate
Type - (Email, Slack Message, Mobile App Alerts, SMS, WhatsApp, Pager Duty, IFTTT Trigger, or a Customer Webhook)
Minimum Alert Level - The lowest severity level of an alert that needs to be triggered to send a notification.

📘

Alert Level Hierarchy

The hierarchy of alert levels is INFO < WARN < ERROR < FATAL.

Zones - The region in which you want to monitor alerts for.
Devices - The individual device or device list that you want the smart notification to listen to.
Device Alerts - You can specify the alerts you want to monitor and have report out over the type configured.

Slack

Freedom's Slack integration is an easy way to broadcast alerts to your team.

Generate a Slack webhook URL

To set up this integration, you'll need to generate a Slack webhook URL. You can check out the instructions from Slack here. Your Slack webhook URL will look like this:

https://hooks.slack.com/services/...

PagerDuty

The PagerDuty integration enables you to control who receives certain alerts and when they receive them.

Generate a PagerDuty integration key

To set up this integration, you'll need to generate a PagerDuty integration key. You can check out the instructions from PagerDuty here. Be sure to choose Events API v2.

IFTTT

IFTTT allows you to easily connect services and set up triggers and responses.

Generate an IFTTT key and trigger

To set up this integration, you'll need to generate both an IFTTT key and trigger. First, go to the
IFTTT Webhooks page and click the Connect button. Click the Settings button. Your IFTTT key is the long string at the end of the URL:

https://maker.ifttt.com/use/<YOUR_IFTTT_KEY>

Next, go to the Platform page and select the Applets tab. Click the New Applet button. In the Trigger section, search for Webhooks. Select Receive a web request. Choose a name like freedom_smart_alert for the Field Name. This name is your IFTTT trigger.

Add the action that you would like to trigger and fill in the remaining details, then save and publish your Applet.

Payload format

When an alert is sent to the IFTTT interface, the details of the alert are sent as a JSON payload in the following format:

{
    "value1": "`BATTERY ISSUE` alert for `Droid 3`",  
    "value2": "ERROR TRIGGERED",    
    "value3": "https://app.freedomrobotics.ai/#/devices/..."
}

value 1

issue name and device name

value 2

Issue level and whether the alert was triggered or cleared

value 3

Share link for the time when the issue occurred

Custom Webhook

When you build your application using Freedom, you may want to integrate with a custom service, such as one of your own servers.

Set up the integration

Select the HTTP request type (PUT or POST). Add the URL of your webhook, beginning with https://..., and click SAVE.

Payload Format

When an alert is sent to a custom webhook, the details of the alert are sent as a JSON payload in the following format:

{
    "account": "A0000000000000000000",
    "device": "D0000000000000000000",
    "alert_id": "ALT0000000000000000",
    "name": "LOW_BATTERY",
    "type": "mc.device.data_outside_bounds",
    "action": "clear",
    "level": "warn",
    "attributes": {             // Specified by the trigger
        "voltage": 14.3,
        "current": -3.12,
        "state": "NOT_CHARGING"
    },
    "utc_time": 144032234.23,
    "elapsed_secs": 1213.43    // Only exists on "action": "clear"
}

Testing a Webhook

Each Smart Notification has a Send Test Alert button that will send an example alert to the service / type is configured to.