Merge pull request #178 from nickexyz/docs-noderedupdate

Add Node-RED pictures and change ntfy URL to ntfy.sh
pull/194/head
Philipp C. Heckel 2022-03-25 13:32:05 -04:00 committed by GitHub
commit c5642799df
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 191 additions and 162 deletions

View File

@ -132,36 +132,42 @@ Some simple bash scripts to achieve this are kindly provided in [nickexyz's repo
## Node-RED ## Node-RED
You can use the HTTP request node to send messages with [Node-RED](https://nodered.org), some examples: You can use the HTTP request node to send messages with [Node-RED](https://nodered.org), some examples:
Example: Send a message
<details> <details>
<summary>Example: Send a message</summary> <summary>Expand</summary>
``` ```
[ [
{ {
"id": "8f09d37dd5773f88", "id": "c956e688cc74ad8e",
"type": "http request", "type": "http request",
"z": "ff3ad4e1.d3415", "z": "fabdd7a3.4045a",
"name": "ntfy", "name": "ntfy.sh",
"method": "POST", "method": "POST",
"ret": "txt", "ret": "txt",
"paytoqs": "ignore", "paytoqs": "ignore",
"url": "https://example.com/topic", "url": "https://ntfy.sh/mytopic",
"tls": "", "tls": "",
"persist": false, "persist": false,
"proxy": "", "proxy": "",
"authType": "", "authType": "",
"senderr": false, "senderr": false,
"credentials": {}, "credentials":
"x": 1410, {
"y": 740, "user": "",
"wires": [ "password": ""
},
"x": 590,
"y": 3160,
"wires":
[
[] []
] ]
}, },
{ {
"id": "2603f296b25fe351", "id": "32ee1eade51fae50",
"type": "function", "type": "function",
"z": "ff3ad4e1.d3415", "z": "fabdd7a3.4045a",
"name": "data", "name": "data",
"func": "msg.payload = \"Something happened\";\nmsg.headers = {};\nmsg.headers['tags'] = 'house';\nmsg.headers['X-Title'] = 'Home Assistant';\n\nreturn msg;", "func": "msg.payload = \"Something happened\";\nmsg.headers = {};\nmsg.headers['tags'] = 'house';\nmsg.headers['X-Title'] = 'Home Assistant';\n\nreturn msg;",
"outputs": 1, "outputs": 1,
@ -169,20 +175,22 @@ You can use the HTTP request node to send messages with [Node-RED](https://noder
"initialize": "", "initialize": "",
"finalize": "", "finalize": "",
"libs": [], "libs": [],
"x": 1290, "x": 470,
"y": 740, "y": 3160,
"wires": [ "wires":
[ [
"8f09d37dd5773f88" [
"c956e688cc74ad8e"
] ]
] ]
}, },
{ {
"id": "d2351ed0720a239f", "id": "b287e59cd2311815",
"type": "inject", "type": "inject",
"z": "ff3ad4e1.d3415", "z": "fabdd7a3.4045a",
"name": "Manual start", "name": "Manual start",
"props": [ "props":
[
{ {
"p": "payload" "p": "payload"
}, },
@ -198,11 +206,12 @@ You can use the HTTP request node to send messages with [Node-RED](https://noder
"topic": "", "topic": "",
"payload": "", "payload": "",
"payloadType": "date", "payloadType": "date",
"x": 1150, "x": 330,
"y": 740, "y": 3160,
"wires": [ "wires":
[ [
"2603f296b25fe351" [
"32ee1eade51fae50"
] ]
] ]
} }
@ -211,16 +220,20 @@ You can use the HTTP request node to send messages with [Node-RED](https://noder
</details> </details>
![Node red message flow](static/img/nodered-message.png)
Example: Send a picture
<details> <details>
<summary>Example: Send a picture</summary> <summary>Expand</summary>
``` ```
[ [
{ {
"id": "726d0d75d6c0f70e", "id": "d135a13eadeb9d6d",
"type": "http request", "type": "http request",
"z": "ff3ad4e1.d3415", "z": "fabdd7a3.4045a",
"name": "Download jpeg", "name": "Download image",
"method": "GET", "method": "GET",
"ret": "bin", "ret": "bin",
"paytoqs": "ignore", "paytoqs": "ignore",
@ -230,19 +243,24 @@ You can use the HTTP request node to send messages with [Node-RED](https://noder
"proxy": "", "proxy": "",
"authType": "", "authType": "",
"senderr": false, "senderr": false,
"credentials": {}, "credentials":
"x": 1320, {
"y": 780, "user": "",
"wires": [ "password": ""
},
"x": 490,
"y": 3320,
"wires":
[ [
"730dbbc9dbf1ed8a" [
"6e75bc41d2ec4a03"
] ]
] ]
}, },
{ {
"id": "730dbbc9dbf1ed8a", "id": "6e75bc41d2ec4a03",
"type": "function", "type": "function",
"z": "ff3ad4e1.d3415", "z": "fabdd7a3.4045a",
"name": "data", "name": "data",
"func": "msg.payload = msg.payload;\nmsg.headers = {};\nmsg.headers['tags'] = 'house';\nmsg.headers['X-Title'] = 'Home Assistant - Picture';\n\nreturn msg;", "func": "msg.payload = msg.payload;\nmsg.headers = {};\nmsg.headers['tags'] = 'house';\nmsg.headers['X-Title'] = 'Home Assistant - Picture';\n\nreturn msg;",
"outputs": 1, "outputs": 1,
@ -250,40 +268,48 @@ You can use the HTTP request node to send messages with [Node-RED](https://noder
"initialize": "", "initialize": "",
"finalize": "", "finalize": "",
"libs": [], "libs": [],
"x": 1470, "x": 650,
"y": 780, "y": 3320,
"wires": [ "wires":
[ [
"592f424b37f76f5c" [
"eb160615b6ceda98"
] ]
] ]
}, },
{ {
"id": "592f424b37f76f5c", "id": "eb160615b6ceda98",
"type": "http request", "type": "http request",
"z": "ff3ad4e1.d3415", "z": "fabdd7a3.4045a",
"name": "ntfy", "name": "ntfy.sh",
"method": "PUT", "method": "PUT",
"ret": "bin", "ret": "bin",
"paytoqs": "ignore", "paytoqs": "ignore",
"url": "https://example.com/topic", "url": "https://ntfy.sh/mytopic",
"tls": "", "tls": "",
"persist": false, "persist": false,
"proxy": "", "proxy": "",
"authType": "", "authType": "",
"senderr": false, "senderr": false,
"x": 1590, "credentials":
"y": 780, {
"wires": [ "user": "",
"password": ""
},
"x": 770,
"y": 3320,
"wires":
[
[] []
] ]
}, },
{ {
"id": "8aa06dda3c902f6a", "id": "5b8dbf15c8a7a3a5",
"type": "inject", "type": "inject",
"z": "ff3ad4e1.d3415", "z": "fabdd7a3.4045a",
"name": "Manual start", "name": "Manual start",
"props": [ "props":
[
{ {
"p": "payload" "p": "payload"
}, },
@ -299,11 +325,12 @@ You can use the HTTP request node to send messages with [Node-RED](https://noder
"topic": "", "topic": "",
"payload": "", "payload": "",
"payloadType": "date", "payloadType": "date",
"x": 1150, "x": 310,
"y": 780, "y": 3320,
"wires": [ "wires":
[ [
"726d0d75d6c0f70e" [
"d135a13eadeb9d6d"
] ]
] ]
} }
@ -312,6 +339,8 @@ You can use the HTTP request node to send messages with [Node-RED](https://noder
</details> </details>
![Node red picture flow](static/img/nodered-picture.png)
## Gatus service health check ## Gatus service health check
An example for a custom alert with <a href="https://github.com/TwiN/gatus">Gatus</a> An example for a custom alert with <a href="https://github.com/TwiN/gatus">Gatus</a>

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.9 KiB