Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- [
- {
- "id": "e879a259.a179b",
- "type": "debug",
- "z": "2745fc07.7d2274",
- "name": "",
- "active": false,
- "tosidebar": true,
- "console": false,
- "tostatus": false,
- "complete": "count",
- "targetType": "msg",
- "statusVal": "",
- "statusType": "auto",
- "x": 1190,
- "y": 3470,
- "wires": []
- },
- {
- "id": "9be54c36.45007",
- "type": "change",
- "z": "2745fc07.7d2274",
- "name": "",
- "rules": [
- {
- "t": "set",
- "p": "reset",
- "pt": "msg",
- "to": "reset",
- "tot": "str"
- }
- ],
- "action": "",
- "property": "",
- "from": "",
- "to": "",
- "reg": false,
- "x": 690,
- "y": 3390,
- "wires": [
- [
- "7d3aff09.54a18"
- ]
- ]
- },
- {
- "id": "4a411474.7146cc",
- "type": "switch",
- "z": "2745fc07.7d2274",
- "name": "",
- "property": "count",
- "propertyType": "msg",
- "rules": [
- {
- "t": "nnull"
- }
- ],
- "checkall": "true",
- "repair": false,
- "outputs": 1,
- "x": 690,
- "y": 3450,
- "wires": [
- [
- "86a6c2ae.7f3d9",
- "dfd3507e.770a5"
- ]
- ]
- },
- {
- "id": "86a6c2ae.7f3d9",
- "type": "join",
- "z": "2745fc07.7d2274",
- "name": "",
- "mode": "custom",
- "build": "string",
- "property": "count",
- "propertyType": "msg",
- "key": "topic",
- "joiner": "",
- "joinerType": "str",
- "accumulate": false,
- "timeout": "",
- "count": "2",
- "reduceRight": false,
- "reduceExp": "",
- "reduceInit": "",
- "reduceInitType": "num",
- "reduceFixup": "",
- "x": 970,
- "y": 3500,
- "wires": [
- [
- "e879a259.a179b",
- "47a68f2c.5b895"
- ]
- ]
- },
- {
- "id": "b7d9faf6.c4baf8",
- "type": "switch",
- "z": "2745fc07.7d2274",
- "name": "",
- "property": "count",
- "propertyType": "msg",
- "rules": [
- {
- "t": "nnull"
- }
- ],
- "checkall": "true",
- "repair": false,
- "outputs": 1,
- "x": 700,
- "y": 3670,
- "wires": [
- [
- "86a6c2ae.7f3d9",
- "e0352e74.fb529"
- ]
- ]
- },
- {
- "id": "9048d542.dfa238",
- "type": "change",
- "z": "2745fc07.7d2274",
- "name": "",
- "rules": [
- {
- "t": "set",
- "p": "reset",
- "pt": "msg",
- "to": "reset",
- "tot": "str"
- }
- ],
- "action": "",
- "property": "",
- "from": "",
- "to": "",
- "reg": false,
- "x": 690,
- "y": 3620,
- "wires": [
- [
- "2d39fc3c.1b3964"
- ]
- ]
- },
- {
- "id": "b4f54f27.13f1a",
- "type": "interval-length",
- "z": "2745fc07.7d2274",
- "format": "mills",
- "bytopic": false,
- "minimum": "150",
- "maximum": "350",
- "window": "",
- "timeout": true,
- "msgTimeout": "950",
- "minimumunit": "msecs",
- "maximumunit": "msecs",
- "windowunit": "msecs",
- "msgTimeoutUnit": "msecs",
- "reset": true,
- "startup": false,
- "msgField": "payload",
- "timestampField": "timestamp",
- "repeatTimeout": false,
- "name": "",
- "x": 450,
- "y": 3390,
- "wires": [
- [
- "7d3aff09.54a18"
- ],
- [
- "9be54c36.45007",
- "4a411474.7146cc"
- ]
- ]
- },
- {
- "id": "4da722d2.e7ae5c",
- "type": "interval-length",
- "z": "2745fc07.7d2274",
- "format": "mills",
- "bytopic": false,
- "minimum": "900",
- "maximum": "1100",
- "window": "",
- "timeout": false,
- "msgTimeout": "1150",
- "minimumunit": "msecs",
- "maximumunit": "msecs",
- "windowunit": "msecs",
- "msgTimeoutUnit": "msecs",
- "reset": false,
- "startup": false,
- "msgField": "payload",
- "timestampField": "timestamp",
- "repeatTimeout": false,
- "name": "",
- "x": 450,
- "y": 3640,
- "wires": [
- [
- "2d39fc3c.1b3964"
- ],
- [
- "b7d9faf6.c4baf8",
- "9048d542.dfa238"
- ]
- ]
- },
- {
- "id": "7d3aff09.54a18",
- "type": "counter",
- "z": "2745fc07.7d2274",
- "name": "",
- "init": "0",
- "step": "1",
- "lower": null,
- "upper": null,
- "mode": "increment",
- "outputs": "1",
- "x": 690,
- "y": 3330,
- "wires": [
- []
- ]
- },
- {
- "id": "2d39fc3c.1b3964",
- "type": "counter",
- "z": "2745fc07.7d2274",
- "name": "",
- "init": "0",
- "step": "1",
- "lower": null,
- "upper": null,
- "mode": "increment",
- "outputs": "1",
- "x": 690,
- "y": 3560,
- "wires": [
- []
- ]
- },
- {
- "id": "dc79cd19.19527",
- "type": "server-state-changed",
- "z": "2745fc07.7d2274",
- "name": "Diagnostic LED",
- "server": "c75798f0.9eb148",
- "version": 1,
- "exposeToHomeAssistant": false,
- "haConfig": [
- {
- "property": "name",
- "value": ""
- },
- {
- "property": "icon",
- "value": ""
- }
- ],
- "entityidfilter": "binary_sensor.heater_diagnostic_led",
- "entityidfiltertype": "exact",
- "outputinitially": false,
- "state_type": "str",
- "haltifstate": "",
- "halt_if_type": "str",
- "halt_if_compare": "is",
- "outputs": 1,
- "output_only_on_state_change": true,
- "for": 0,
- "forType": "num",
- "forUnits": "minutes",
- "ignorePrevStateNull": false,
- "ignorePrevStateUnknown": false,
- "ignorePrevStateUnavailable": false,
- "ignoreCurrentStateUnknown": true,
- "ignoreCurrentStateUnavailable": true,
- "x": 230,
- "y": 3500,
- "wires": [
- [
- "b4f54f27.13f1a",
- "4da722d2.e7ae5c",
- "1e8769f5.c3df26"
- ]
- ]
- },
- {
- "id": "1e8769f5.c3df26",
- "type": "trigger",
- "z": "2745fc07.7d2274",
- "name": "Reset after 5 min",
- "op1": "",
- "op2": "true",
- "op1type": "nul",
- "op2type": "bool",
- "duration": "5",
- "extend": true,
- "overrideDelay": false,
- "units": "min",
- "reset": "",
- "bytopic": "all",
- "topic": "topic",
- "outputs": 1,
- "x": 460,
- "y": 3500,
- "wires": [
- [
- "a9c4a845.7b3138"
- ]
- ]
- },
- {
- "id": "47a68f2c.5b895",
- "type": "api-call-service",
- "z": "2745fc07.7d2274",
- "name": "Select Code",
- "server": "c75798f0.9eb148",
- "version": 1,
- "debugenabled": false,
- "service_domain": "input_number",
- "service": "set_value",
- "entityId": "input_number.heater_diagnostic_code",
- "data": "{\"value\":\"{{count}}\"}",
- "dataType": "json",
- "mergecontext": "",
- "output_location": "",
- "output_location_type": "none",
- "mustacheAltTags": false,
- "x": 1190,
- "y": 3520,
- "wires": [
- []
- ]
- },
- {
- "id": "a9c4a845.7b3138",
- "type": "api-call-service",
- "z": "2745fc07.7d2274",
- "name": "Select Code",
- "server": "c75798f0.9eb148",
- "version": 1,
- "debugenabled": false,
- "service_domain": "input_number",
- "service": "set_value",
- "entityId": "input_number.heater_diagnostic_code",
- "data": "{\"value\":\"0\"}",
- "dataType": "json",
- "mergecontext": "",
- "output_location": "",
- "output_location_type": "none",
- "mustacheAltTags": false,
- "x": 660,
- "y": 3500,
- "wires": [
- []
- ]
- },
- {
- "id": "dfd3507e.770a5",
- "type": "function",
- "z": "2745fc07.7d2274",
- "name": "",
- "func": "var counting = function () {\n let digit = flow.get('led_code');\n node.status({fill:\"red\",shape:\"dot\",text:\"First: \" + digit});\n // flow.set('count',counter);\n clearInterval(flow.get('timer1'));\n node.send(msg);\n return digit;\n\n // if (counter === 0) {\n // clearInterval(flow.get('timer1'));\n // node.status({fill:\"green\",shape:\"dot\",text: \"Finished\"});\n // node.send(msg);\n // return led_code;\n // } else {\n // clearInterval(flow.get('timer1')); \n // node.send(msg);\n // return led_code;\n // }\n}\n\nif (typeof msg.payload === 'number') {\n flow.set('led_code',msg.count);\n // node.status({text: \"Starting\"}); \n let timer1 = setInterval(counting, 1);\n flow.set('timer1',timer1);\n} else if (msg.payload === \"stop\") {\n node.status({}); // clear the status decoration\n clearInterval(flow.get('timer1')); \n \n}\n",
- "outputs": 1,
- "noerr": 0,
- "initialize": "",
- "finalize": "",
- "x": 1180,
- "y": 3340,
- "wires": [
- []
- ]
- },
- {
- "id": "e0352e74.fb529",
- "type": "function",
- "z": "2745fc07.7d2274",
- "name": "",
- "func": "var counting = function () {\n let digit = flow.get('led_code');\n node.status({fill:\"red\",shape:\"dot\",text:\"Second: \" + digit});\n // flow.set('count',counter);\n clearInterval(flow.get('timer1'));\n node.send(msg);\n return digit;\n\n // if (counter === 0) {\n // clearInterval(flow.get('timer1'));\n // node.status({fill:\"green\",shape:\"dot\",text: \"Finished\"});\n // node.send(msg);\n // return led_code;\n // } else {\n // clearInterval(flow.get('timer1')); \n // node.send(msg);\n // return led_code;\n // }\n}\n\nif (typeof msg.payload === 'number') {\n flow.set('led_code',msg.count);\n // node.status({text: \"Starting\"}); \n let timer1 = setInterval(counting, 1);\n flow.set('timer1',timer1);\n} else if (msg.payload === \"stop\") {\n node.status({}); // clear the status decoration\n clearInterval(flow.get('timer1')); \n \n}\n",
- "outputs": 1,
- "noerr": 0,
- "initialize": "",
- "finalize": "",
- "x": 1180,
- "y": 3390,
- "wires": [
- []
- ]
- },
- {
- "id": "c75798f0.9eb148",
- "type": "server",
- "name": "Home Assistant Synology",
- "legacy": false,
- "addon": false,
- "rejectUnauthorizedCerts": false,
- "ha_boolean": "y|yes|true|on|ON|home|open",
- "connectionDelay": true,
- "cacheJson": true
- }
- ]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement