Publish an Alert with Node-RED
In this page, you will see how to publish an Alert from your Node-Red application that will be delivered to the alert channel members based on their preference of method of delivery.
Navigate to the Alerts tab. Tap on Alert Channels and create a channel.
Tap on the gear icon next to the alert channel and go to Manage Alert Channel Notifications to set your personal preferences for receiving an alert from this channel (Go to Managing Alert Channel for details). Note that to receive a text message, you should verify your phone number first, which can be done in the Profile Button on the top right side of the screen.
Ensure your device is connected to the cloud by checking if you see the green light on the device page, Enable the Node-RED connection in the Remote Connections tab, and hit Connect.
From the nodes in the left navigation bar, drag and drop the alert channel out node.
Double-click on the alert channel out node, and then double click on the edit button.
Next, we will click the refresh button in the Topic and select the Alert Channel that we will like to publish to.
Once everything is complete, click Done.
- Drag and drop an inject node.
- Drag and drop a function node.
- Connect the inject to function to alert channel out node, respectively.
- Double-tap the function node and write this code:
"subject": "An alert subject",
"description": "Description of the alert",
Severity levels could be one of the following:
From the top right corner of Node-RED, tap Deploy.
Tap the button of the inject node and you should receive an alert based on your alert channel notification preferences. You can change your notification preferences by selecting the alert channel and clicking on the gear icon.