Step 1: Accessing Node-RED Open your Home Assistant instance. Navigate to the Node-RED addon. Click on the addon to open the Node-RED editor. Step 2: Importing the Flow In the Node-RED editor, click on the menu icon in the top-right corner. Select “Import” from the dropdown menu. Copy the provided flow JSON. Paste the JSON into the import dialog box. Click “Import” to import the flow. 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 [ { "id": "a96270e425179e4a", "type": "tab", "label": "Subs", "disabled": false, "info": "", "env": [] }, { "id": "b29251f338c92d7b", "type": "group", "z": "a96270e425179e4a", "style": { "stroke": "#3d3e46", "stroke-opacity": "1", "fill": "#21222c", "fill-opacity": "0.5", "label": true, "label-position": "nw", "color": "#f8f8f2" }, "nodes": [ "inject1", "function1", "mqtt1" ], "x": 14, "y": 19, "w": 812, "h": 82 }, { "id": "inject1", "type": "inject", "z": "a96270e425179e4a", "g": "b29251f338c92d7b", "name": "Send periodically", "props": [ { "p": "payload" }, { "p": "topic", "vt": "str" } ], "repeat": "600", "crontab": "", "once": false, "onceDelay": 0.1, "topic": "", "payload": "Like and subscribe", "payloadType": "str", "x": 150, "y": 60, "wires": [ [ "function1" ] ] }, { "id": "function1", "type": "function", "z": "a96270e425179e4a", "g": "b29251f338c92d7b", "name": "Prepare message with icon", "func": "// Text to send\nvar textToSend = 'Like and subscribe';\n\n// Creating payload object according to the example\nmsg.payload = {\n \"text\": textToSend,\n \"icon\": \"10516\", // Icon name, change as needed\n \"duration\": 10 // Display duration, you can adjust\n};\n\nreturn msg;", "outputs": 1, "timeout": "", "noerr": 0, "initialize": "", "finalize": "", "libs": [], "x": 400, "y": 60, "wires": [ [ "mqtt1" ] ] }, { "id": "mqtt1", "type": "mqtt out", "z": "a96270e425179e4a", "g": "b29251f338c92d7b", "name": "Publish Text to MQTT", "topic": "awtrix_b6d76c/custom/subs", "qos": "2", "retain": "false", "respTopic": "", "contentType": "", "userProps": "", "correl": "", "expiry": "", "broker": "346df2a95aac5785", "x": 680, "y": 60, "wires": [] }, { "id": "346df2a95aac5785", "type": "mqtt-broker", "name": "MQTT HA Broker", "broker": "10.10.0.100", "port": "1883", "clientid": "", "autoConnect": true, "usetls": false, "protocolVersion": "4", "keepalive": "60", "cleansession": true, "autoUnsubscribe": true, "birthTopic": "awtrix_b6d76c", "birthQos": "2", "birthRetain": "true", "birthPayload": "", "birthMsg": {}, "closeTopic": "awtrix_b6d76c", "closeQos": "2", "closeRetain": "true", "closePayload": "", "closeMsg": {}, "willTopic": "awtrix_b6d76c", "willQos": "2", "willRetain": "true", "willPayload": "", "willMsg": {}, "userProps": "", "sessionExpiry": "" } ] Step 3: Understanding the Flow This flow is designed to periodically send a message to an MQTT topic. Let’s break down each node:
...