Skip to content

Instantly share code, notes, and snippets.

@prombouts
Created August 13, 2022 07:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save prombouts/98233a00106730bcd53b134c4f49cb87 to your computer and use it in GitHub Desktop.
Save prombouts/98233a00106730bcd53b134c4f49cb87 to your computer and use it in GitHub Desktop.
Get Raspberry PI temperature and call LogicApp
[
{
"id": "cdd3427b60e26088",
"type": "tab",
"label": "Temp to LogicApp",
"disabled": false,
"info": "",
"env": []
},
{
"id": "f9c23d23.c8c24",
"type": "exec",
"z": "cdd3427b60e26088",
"command": "vcgencmd measure_temp",
"addpay": false,
"append": "",
"useSpawn": "false",
"timer": "",
"winHide": false,
"oldrc": false,
"name": "Get Raspberry CPU Temperature",
"x": 380,
"y": 260,
"wires": [
[
"a0ad4644.0efbf8"
],
[],
[]
]
},
{
"id": "a0ad4644.0efbf8",
"type": "function",
"z": "cdd3427b60e26088",
"name": "Extract CPU Temp",
"func": "const re = /^temp=(.*)'C$/gm;\nmsg.payload = Number(msg.payload.replace(re, '$1'));\nreturn msg;",
"outputs": 1,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 550,
"y": 380,
"wires": [
[
"a780cf0d7090480b"
]
]
},
{
"id": "a97d78fc.40c268",
"type": "inject",
"z": "cdd3427b60e26088",
"name": "Run every 15 minutes",
"props": [
{
"p": "payload"
},
{
"p": "topic",
"vt": "str"
}
],
"repeat": "900",
"crontab": "",
"once": true,
"onceDelay": 0.1,
"topic": "",
"payload": "",
"payloadType": "date",
"x": 150,
"y": 140,
"wires": [
[
"f9c23d23.c8c24"
]
]
},
{
"id": "a780cf0d7090480b",
"type": "http request",
"z": "cdd3427b60e26088",
"name": "Call LogicApp",
"method": "POST",
"ret": "txt",
"paytoqs": "ignore",
"url": "https://someazurelogicappurl.com",
"tls": "",
"persist": false,
"proxy": "",
"authType": "",
"senderr": false,
"credentials": {
"user": "",
"password": ""
},
"x": 820,
"y": 460,
"wires": [
[]
]
}
]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment