Flow Details
The Symbol is a ringing phone, the text is the number of the caller. The Fritzbox Node needs to be properly configured, as well as your own MQTT Server. Adjust the Awtrix topic to your needing. The notification would actually repeat 10 times. That is, to keep it up long enough. Conveniently though, when the caller hangs up, the notification is dismissed through the second output.
[
{
"id": "73c5d9d0d102eb2a",
"type": "tab",
"label": "Awtrix incoming call",
"disabled": false,
"info": "",
"env": []
},
{
"id": "6d1ba29c2fa36ae8",
"type": "function",
"z": "73c5d9d0d102eb2a",
"name": "create caller-id message",
"func": "var caller = \"\";\n\nif (msg.payload && msg.payload.type === \"INBOUND\") {\n caller = msg.payload.caller;\n\n msg.payload = {\n \"text\": caller,\n \"icon\": 1232,\n \"repeat\": 10,\n \"pushIcon\": 0,\n \"save\": true,\n \"textCase\": 2\n };\n\n return [{ payload: msg.payload }, null];\n} else {\n caller = ''; // or set it to some default value\n msg.payload = \"\";\n return [null, { payload: 1 }]; // Adjust the value as needed for output 2\n}\n\nnode.status({ fill: 'green', shape: 'ring', text: \"Call from\" + ' : ' + caller });\nreturn msg;\n",
"outputs": 2,
"timeout": 0,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 650,
"y": 280,
"wires": [
[
"1eb36040e542b763"
],
[
"a43a9ef28c04d848"
]
]
},
{
"id": "1eb36040e542b763",
"type": "mqtt out",
"z": "73c5d9d0d102eb2a",
"name": "Notify Incoming Call",
"topic": "awtrix_ip/notify",
"qos": "1",
"retain": "false",
"respTopic": "",
"contentType": "",
"userProps": "",
"correl": "",
"expiry": "",
"broker": "",
"x": 900,
"y": 260,
"wires": []
},
{
"id": "a43a9ef28c04d848",
"type": "mqtt out",
"z": "73c5d9d0d102eb2a",
"name": "Dismiss Notification",
"topic": "awtrix_ip/notify/dismiss",
"qos": "1",
"retain": "false",
"respTopic": "",
"contentType": "",
"userProps": "",
"correl": "",
"expiry": "",
"broker": "",
"x": 900,
"y": 320,
"wires": []
},
{
"id": "0630a4323d4ad39e",
"type": "fritzbox-callmonitor",
"z": "73c5d9d0d102eb2a",
"device": "",
"name": "",
"topic": "",
"x": 380,
"y": 280,
"wires": [
[
"6d1ba29c2fa36ae8"
]
]
}
]
-- Flow first published on December 22, 2023, last updated on January 20, 2024 at 13:41.