Catenis Flow Guide

Notification Channel Node

The “Notification Channel” node connects with Catenis and receives notification messages for a given event. Examples of these events include: when a device receives a message, when a device receives an asset, when a sent message is read, etc.

Image of the Notification Channel Node

Node Properties Panel Field Description

Node property configuration slide-out panel (this panel is accessed by double-clicking on the node).

2020-07-27_21-11-54
Properties Configuration Panel for the Notification Channel Node

Node-RED Specific Fields

  1. Name Field:  Add a descriptive name of your choice that will help differentiate this node from others of the same type on the Node-RED workspace (not required).
  2. Connection Field: This drop-down selection is required.  Set a previously configured Catenis connection (virtual device). If you need to configure a new virtual device click the pencil button to the right of the field and follow the direction on setting up a new virtual device that can be found here.

Catenis Flow Setting Fields

  1. Event – Select the event for which you wish to receive notifications for. Options include:
    1. new-msg-received: A notification will be generated when the configured device receives a new message.
    2. sent-msg-read:  A notification will be generated when a sent message is read by the intended receiver.
    3. asset-received:  A notification will be generated when the configured device receives an asset from another device.
    4. asset-confirmed:  A notification will be generated when a pending asset transfer is confirmed.
    5. final-msg-progress: A notification will be generated when the progress of asynchronous message processing comes to an end.

How to use

  1. Drag and drop this node from the Catenis Flow pallet area to the Node-RED workspace. Double click it to display its properties slide out panel.
  2. On the “Device” drop-down field of the properties slide out panel choose the Catenis virtual device you previously configured. The virtual device is a configuration node containing the Catenis Virtual device information (device ID and API Secret key). This should be the controlling device (the device for which you want to receive notification events for).
  3. Click on the “🔔 Event” drop-down menu and then select the event for which you wish to receive notifications for. Options include:
    1. new-msg-received: A notification will be generated when the configured device receives a new message.
    2. sent-msg-read:  A notification will be generated when a sent message is read by the intended receiver.
    3. asset-received: A notification will be generated when the configured device receives an asset from another device.
    4. asset-confirmed: A notification will be generated when a pending asset transfer is confirmed.
    5. final-msg-progress:  A notification will be generated when the progress of asynchronous message processing comes to an end.
  4. Wire this node to a debug node if you wish to see the output of the node printed on the debug sidebar. Otherwise, the output from this node can be passed into another node on this flow.
  5. Click the red “Deploy” button on the upper right hand side of the Node-RED dashboard to deploy this flow. After a successful deployment, the default status of the “notification channel” node will be “disconnected”. You must click the gray square button attached to this node on the  left of this node to change the status to connected.
  6. To test the flow: trigger the specific event for which you set up a notification for. For example, if the node is set up to generate notifications for received messages, try having a message sent from another device to the device this “notification channel” node is configured with to see  a notification printed in the debug sidebar. The debug sidebar should display a returned JSON object containing the relevant information regarding the notification.

Example Flow - Import Into Node-Red to Get Started


[{"id":"92dc1178.a5028","type":"notification channel","z":"7699bc9b.28f854","name":"","device":"","eventName":"new-msg-received","x":260,"y":220,"wires":[["bd8702b3.c833a"]]},{"id":"bd8702b3.c833a","type":"debug","z":"7699bc9b.28f854","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":770,"y":220,"wires":[]},{"id":"62f8453.e2d0abc","type":"debug","z":"7699bc9b.28f854","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","x":770,"y":120,"wires":[]},{"id":"53fdfbd1.5643c4","type":"send message","z":"7699bc9b.28f854","name":"","device":"","toDeviceId":"","isProdUniqueId":false,"encoding":"utf8","storage":"auto","encrypt":false,"readConfirmation":false,"async":false,"x":472,"y":120,"wires":[["62f8453.e2d0abc"]]},{"id":"da0f951f.e17128","type":"inject","z":"7699bc9b.28f854","name":"","topic":"","payload":"{\"message\":\"Hello World\",\"targetDevice\":{\"id\":\"enter target DeviceId here\",\"isProdUniqueId\":false},\"options\":{\"encoding\":\"utf8\",\"encrypt\":false,\"storage\":\"auto\",\"readConfirmation\":true,\"async\":false}}","payloadType":"json","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":150,"y":120,"wires":[["53fdfbd1.5643c4"]]},{"id":"8aa87807.29fb88","type":"comment","z":"7699bc9b.28f854","name":"Set virtual device for this Catenis node","info":"All Catenis nodes require that you set the proper virtual device on its slideout property panel on the device field.\n\nNot setting the device properly will result in a \"TypeError: Cannot read property 'ctnApiClient' of null\" ","x":541,"y":80,"wires":[]},{"id":"5f11c220.0cfd1c","type":"comment","z":"7699bc9b.28f854","name":"Enter your own target device ID here","info":"","x":220,"y":80,"wires":[]},{"id":"7b2f095d.b28408","type":"comment","z":"7699bc9b.28f854","name":"Confgure this node with the same device as the target device of the send message node","info":"Warning: To receive notification, Notification Channel node must be connected. \n\nAfter clicking the Deploy button the notification channel node will list disconnected. To re-connect click the button attached to the left of the Notification Channel node.","x":378,"y":182,"wires":[]}]

Note: After importing the sample flow you will need to set the “notification channel” node to your own previously configured virtual device. Instructions on how to setup your virtual device on Node-RED can be found here: https://blockchainofthings.com/docs/configure-your-first-virtual-device-on-catenis-flow/

Note: The target device of the “send message” node should be the same as configured device of the “notification channel node”.

Related Articles

CompanyElement_SM_LightBackgrounds
How can we make things Better for you?
  • Accepted file types: jpg, gif, png, pdf.
  • This field is for validation purposes and should be left unchanged.