node-red-contrib-notification-center 0.0.2

Node-RED notification hub. A single place to send all notifications through, so they can all be handled in a consistent way.

npm install node-red-contrib-notification-center

pipeline status npm @latest npm downloads license

node-red-contrib-notification-center

Node-RED notification hub.

A single place to send all notifications through, so they can all be handled in a consistent way.

Example flow

Install

Run the following command in your Node-RED user directory - typically ~/.node-red

    npm install node-red-contrib-notification-center

Examples

Example 1: Complete flow

You can get the complete flow from the illustration by opening Node Red, open the hamburger menu (top right corner), choose Import -> Examples -> notification center -> Complete flow.

Example 2: Parsing data into notifications

Here msg.payload contains various status information about my heater. This function transforms the most important data into notifications according to my preferences.

const pelletsLow = msg.payload.hopperDaysLeft <= 2 || msg.payload.hopperContentKg < 20;

msg.payload = [
    {
        "category": "stoker",
        "key": "alarm",
        "severity": "high",
        "text": msg.payload.alert ? msg.payload.stateText : null
    },
    {
        "category": "stoker",
        "key": "hopperWarning",
        "severity": "medium",
        "text": pelletsLow ? "About " + msg.payload.hopperDaysLeft + " days of pellets left" : null
    },
    {
        "category": "stoker",
        "key": "state",
        "severity": "low",
        "text": msg.payload.stateText
    }
]

return msg;

Node Info

Version: 0.0.2
Updated 5 years, 11 months ago
License: Apache-2.0
Rating: 5.0 1

Actions

Rate:

Downloads

10 in the last week

Nodes

  • notification-center

Keywords

  • node-red
  • notification
  • notifications

Maintainers