From Hentschel
Jump to: navigation, search

Hottub controller project

16,141 bytes added, 09:09, 17 November 2017
/* Node Red Flow */
formatted:
<pre>[
{
"id": "17827a89.1c5a75",
"type": "tab",
"label": "Hottub",
"disabled": false,
"info": ""
},
{
"id": "89370546.4b5a78",
"type": "inject",
"z": "17827a89.1c5a75",
"name": "Hottub Get Device State",
"topic": "",
"payload": "",
"payloadType": "str",
"repeat": "",
"crontab": "",
"once": false,
"x": 163,
"y": 125,
"wires": [
[
"3004c3c5.4736ac"
]
]
},
{
"id": "3004c3c5.4736ac",
"type": "http request",
"z": "17827a89.1c5a75",
"name": "",
"method": "GET",
"ret": "txt",
"url": "http://hottub/htmobile/rest/hottub",
"tls": "",
"x": 396,
"y": 126,
"wires": [
[
"fe84d5b4.179728"
]
]
},
{
"id": "fe84d5b4.179728",
"type": "debug",
"z": "17827a89.1c5a75",
"name": "",
"active": true,
"console": "false",
"complete": "false",
"x": 1011,
"y": 127,
"wires": []
},
{
"id": "e9178e01.76041",
"type": "inject",
"z": "17827a89.1c5a75",
"name": "Hottub Get Blower State",
"topic": "",
"payload": "",
"payloadType": "str",
"repeat": "",
"crontab": "",
"once": false,
"x": 162,
"y": 184,
"wires": [
[
"f94d2865.bb5aa8"
]
]
},
{
"id": "f94d2865.bb5aa8",
"type": "http request",
"z": "17827a89.1c5a75",
"name": "",
"method": "GET",
"ret": "txt",
"url": "http://hottub/htmobile/rest/hottub/blower",
"tls": "",
"x": 385,
"y": 183,
"wires": [
[
"c397e60f.c142c8"
]
]
},
{
"id": "59bb7750.cf1338",
"type": "debug",
"z": "17827a89.1c5a75",
"name": "",
"active": true,
"console": "false",
"complete": "false",
"x": 1010,
"y": 184,
"wires": []
},
{
"id": "c397e60f.c142c8",
"type": "xml",
"z": "17827a89.1c5a75",
"name": "",
"attr": "",
"chr": "",
"x": 567,
"y": 184,
"wires": [
[
"7487e93e.710578"
]
]
},
{
"id": "7487e93e.710578",
"type": "function",
"z": "17827a89.1c5a75",
"name": "parse blower state",
"func": "var state = msg.payload.blower.$.state;\nmsg.payload = state;\nreturn msg;\n",
"outputs": 1,
"noerr": 0,
"x": 776,
"y": 185,
"wires": [
[
"59bb7750.cf1338"
]
]
},
{
"id": "d8585233.920af",
"type": "inject",
"z": "17827a89.1c5a75",
"name": "Hottub Get Temperature",
"topic": "",
"payload": "",
"payloadType": "str",
"repeat": "",
"crontab": "",
"once": false,
"x": 151,
"y": 331,
"wires": [
[
"75b3da22.9c9714"
]
]
},
{
"id": "75b3da22.9c9714",
"type": "http request",
"z": "17827a89.1c5a75",
"name": "",
"method": "GET",
"ret": "txt",
"url": "http://hottub/htmobile/rest/hottub/temperature",
"tls": "",
"x": 374,
"y": 330,
"wires": [
[
"ee13f7d5.fc2208"
]
]
},
{
"id": "5baba87b.144fb8",
"type": "debug",
"z": "17827a89.1c5a75",
"name": "",
"active": true,
"console": "false",
"complete": "false",
"x": 1009,
"y": 331,
"wires": []
},
{
"id": "ee13f7d5.fc2208",
"type": "xml",
"z": "17827a89.1c5a75",
"name": "",
"attr": "",
"chr": "",
"x": 556,
"y": 331,
"wires": [
[
"c3d4f167.0ec4a"
]
]
},
{
"id": "c3d4f167.0ec4a",
"type": "function",
"z": "17827a89.1c5a75",
"name": "get temperature",
"func": "var temperature = msg.payload.temperature.$.value;\nmsg.payload = temperature;\nreturn msg;\n",
"outputs": 1,
"noerr": 0,
"x": 755,
"y": 332,
"wires": [
[
"5baba87b.144fb8"
]
]
},
{
"id": "c2190a79.36bf68",
"type": "inject",
"z": "17827a89.1c5a75",
"name": "Hottub Set Blower On",
"topic": "",
"payload": "",
"payloadType": "str",
"repeat": "",
"crontab": "",
"once": false,
"x": 151,
"y": 405,
"wires": [
[
"ab01f83d.653628"
]
]
},
{
"id": "ab01f83d.653628",
"type": "http request",
"z": "17827a89.1c5a75",
"name": "",
"method": "PUT",
"ret": "txt",
"url": "http://hottub/htmobile/rest/hottub/blower/ON",
"tls": "",
"x": 384,
"y": 404,
"wires": [
[
"a1d8afeb.1cc75"
]
]
},
{
"id": "a1d8afeb.1cc75",
"type": "xml",
"z": "17827a89.1c5a75",
"name": "",
"attr": "",
"chr": "",
"x": 566,
"y": 405,
"wires": [
[
"d2ebeae7.39a138"
]
]
},
{
"id": "d2ebeae7.39a138",
"type": "function",
"z": "17827a89.1c5a75",
"name": "get result",
"func": "var state = msg.payload.ok.$.succeeded;\nmsg.payload = state;\nreturn msg;\n",
"outputs": 1,
"noerr": 0,
"x": 742,
"y": 429,
"wires": [
[
"fbfe0722.2f86f8"
]
]
},
{
"id": "bde9bd3b.55efb",
"type": "inject",
"z": "17827a89.1c5a75",
"name": "Hottub Set Blower Off",
"topic": "",
"payload": "",
"payloadType": "str",
"repeat": "",
"crontab": "",
"once": false,
"x": 150,
"y": 455,
"wires": [
[
"2d9eac78.d9d884"
]
]
},
{
"id": "2d9eac78.d9d884",
"type": "http request",
"z": "17827a89.1c5a75",
"name": "",
"method": "PUT",
"ret": "txt",
"url": "http://hottub/htmobile/rest/hottub/blower/OFF",
"tls": "",
"x": 383,
"y": 454,
"wires": [
[
"10074578.832c4b"
]
]
},
{
"id": "fbfe0722.2f86f8",
"type": "debug",
"z": "17827a89.1c5a75",
"name": "",
"active": true,
"console": "false",
"complete": "false",
"x": 1011,
"y": 428,
"wires": []
},
{
"id": "10074578.832c4b",
"type": "xml",
"z": "17827a89.1c5a75",
"name": "",
"attr": "",
"chr": "",
"x": 565,
"y": 455,
"wires": [
[
"d2ebeae7.39a138"
]
]
},
{
"id": "34e6a82b.70b678",
[
"6d1e552.43fc5ac"
]
]
},
{
"id": "bbbe6064.4c732",
"type": "http request",
"z": "17827a89.1c5a75",
"name": "",
"method": "PUT",
"ret": "txt",
"url": "http://hottub/htmobile/rest/hottub/setpoint/94",
"tls": "",
"x": 532,
"y": 671,
"wires": [
[
"f6436b3c.700988"
]
]
},
{
"id": "f6436b3c.700988",
"type": "xml",
"z": "17827a89.1c5a75",
"name": "",
"attr": "",
"chr": "",
"x": 702,
"y": 671,
"wires": [
[
"d2ebeae7.39a138"
]
]
},
{
"id": "3765614f.1302ce",
"type": "inject",
"z": "17827a89.1c5a75",
"name": "Hottub Get Pump State",
"topic": "",
"payload": "",
"payloadType": "str",
"repeat": "",
"crontab": "",
"once": false,
"x": 146,
"y": 232,
"wires": [
[
"627ac717.3c1158"
]
]
},
{
"id": "627ac717.3c1158",
"type": "http request",
"z": "17827a89.1c5a75",
"name": "",
"method": "GET",
"ret": "txt",
"url": "http://hottub/htmobile/rest/hottub/pump",
"tls": "",
"x": 379,
"y": 231,
"wires": [
[
"6f16848f.7d465c"
]
]
},
{
"id": "2c2f0a07.9e69f6",
"type": "debug",
"z": "17827a89.1c5a75",
"name": "",
"active": true,
"console": "false",
"complete": "false",
"x": 1009,
"y": 233,
"wires": []
},
{
"id": "6f16848f.7d465c",
"type": "xml",
"z": "17827a89.1c5a75",
"name": "",
"attr": "",
"chr": "",
"x": 561,
"y": 232,
"wires": [
[
"549bfe15.ddeb2"
]
]
},
{
"id": "549bfe15.ddeb2",
"type": "function",
"z": "17827a89.1c5a75",
"name": "parse pump state",
"func": "var state = msg.payload.pump.$.state;\nmsg.payload = state;\nreturn msg;\n",
"outputs": 1,
"noerr": 0,
"x": 770,
"y": 233,
"wires": [
[
"2c2f0a07.9e69f6"
]
]
},
{
"id": "f539c13.855ec4",
"type": "inject",
"z": "17827a89.1c5a75",
"name": "Hottub Get Heater State",
"topic": "",
"payload": "",
"payloadType": "str",
"repeat": "",
"crontab": "",
"once": false,
"x": 152,
"y": 276,
"wires": [
[
"254a637d.6d59ac"
]
]
},
{
"id": "254a637d.6d59ac",
"type": "http request",
"z": "17827a89.1c5a75",
"name": "",
"method": "GET",
"ret": "txt",
"url": "http://hottub/htmobile/rest/hottub/heater",
"tls": "",
"x": 375,
"y": 275,
"wires": [
[
"84149125.1ee6b"
]
]
},
{
"id": "3748b3b0.f58e6c",
"type": "debug",
"z": "17827a89.1c5a75",
"name": "",
"active": true,
"console": "false",
"complete": "false",
"x": 1009,
"y": 276,
"wires": []
},
{
"id": "84149125.1ee6b",
"type": "xml",
"z": "17827a89.1c5a75",
"name": "",
"attr": "",
"chr": "",
"x": 557,
"y": 276,
"wires": [
[
"50a30206.315efc"
]
]
},
{
"id": "50a30206.315efc",
"type": "function",
"z": "17827a89.1c5a75",
"name": "parse heater state",
"func": "var state = msg.payload.heater.$.state;\nmsg.payload = state;\nreturn msg;\n",
"outputs": 1,
"noerr": 0,
"x": 766,
"y": 277,
"wires": [
[
"3748b3b0.f58e6c"
]
]
},
{
"id": "2952aecc.6b6c22",
"type": "inject",
"z": "17827a89.1c5a75",
"name": "Hottub Set Pump On",
"topic": "",
"payload": "",
"payloadType": "str",
"repeat": "",
"crontab": "",
"once": false,
"x": 148,
"y": 506,
"wires": [
[
"bd1f38c0.553178"
]
]
},
{
"id": "bd1f38c0.553178",
"type": "http request",
"z": "17827a89.1c5a75",
"name": "",
"method": "PUT",
"ret": "txt",
"url": "http://hottub/htmobile/rest/hottub/pump/ON",
"tls": "",
"x": 381,
"y": 505,
"wires": [
[
"879b63ea.a2dac"
]
]
},
{
"id": "879b63ea.a2dac",
"type": "xml",
"z": "17827a89.1c5a75",
"name": "",
"attr": "",
"chr": "",
"x": 563,
"y": 506,
"wires": [
[
"d2ebeae7.39a138"
]
]
},
{
"id": "7b0d2e9b.10bae",
"type": "inject",
"z": "17827a89.1c5a75",
"name": "Hottub Set Pump Off",
"topic": "",
"payload": "",
"payloadType": "str",
"repeat": "",
"crontab": "",
"once": false,
"x": 147,
"y": 556,
"wires": [
[
"ac5a4692.03a928"
]
]
},
{
"id": "ac5a4692.03a928",
"type": "http request",
"z": "17827a89.1c5a75",
"name": "",
"method": "PUT",
"ret": "txt",
"url": "http://hottub/htmobile/rest/hottub/pump/OFF",
"tls": "",
"x": 380,
"y": 555,
"wires": [
[
"1d41c064.f8283"
]
]
},
{
"id": "1d41c064.f8283",
"type": "xml",
"z": "17827a89.1c5a75",
"name": "",
"attr": "",
"chr": "",
"x": 562,
"y": 556,
"wires": [
[
"d2ebeae7.39a138"
]
]
},
{
"id": "6d1e552.43fc5ac",
"type": "switch",
"z": "17827a89.1c5a75",
"name": "",
"property": "payload",
"propertyType": "msg",
"rules": [
{
"t": "lt",
"v": "90",
"vt": "str"
},
{
"t": "btwn",
"v": "90",
"vt": "num",
"v2": "96",
"v2t": "num"
},
{
"t": "gt",
"v": "96",
"vt": "str"
}
],
"checkall": "false",
"outputs": 3,
"x": 332,
"y": 668,
"wires": [
[
"8ab53cae.75f97"
],
[
"bbbe6064.4c732"
],
[
"4514ff37.a76b3"
]
]
},
{
"id": "8ab53cae.75f97",
"type": "http request",
"z": "17827a89.1c5a75",
"name": "",
"method": "PUT",
"ret": "txt",
"url": "http://hottub/htmobile/rest/hottub/setpoint/76",
"tls": "",
"x": 533,
"y": 621,
"wires": [
[
"2ae4833e.13ee6c"
]
]
},
{
"id": "2ae4833e.13ee6c",
"type": "xml",
"z": "17827a89.1c5a75",
"name": "",
"attr": "",
"chr": "",
"x": 703,
"y": 621,
"wires": [
[
"d2ebeae7.39a138"
]
]
},
{
"id": "4514ff37.a76b3",
"type": "http request",
"z": "17827a89.1c5a75",
"name": "",
"method": "PUT",
"ret": "txt",
"url": "http://hottub/htmobile/rest/hottub/setpoint/98",
"tls": "",
"x": 530,
"y": 720,
"wires": [
[
"ef143c49.70a7"
]
]
},
{
"id": "ef143c49.70a7",
"type": "xml",
"z": "17827a89.1c5a75",
"name": "",
"attr": "",
"chr": "",
"x": 700,
"y": 720,
"wires": [
[
"d2ebeae7.39a138"
]
]
}
]</pre>