Last active
July 13, 2020 23:21
-
-
Save bdwilson/7f8100874c14e6d971dd8f72b3b9e43b to your computer and use it in GitHub Desktop.
Hubitat Node-Red Presence Flow
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| [ | |
| { | |
| "id": "866a2010.a3d2f", | |
| "type": "tab", | |
| "label": "Hubitat Presence", | |
| "disabled": false, | |
| "info": "" | |
| }, | |
| { | |
| "id": "66b577d7.f56b48", | |
| "type": "hubitat device", | |
| "z": "866a2010.a3d2f", | |
| "name": "Home-B", | |
| "server": "21cafcc5.b5a984", | |
| "deviceId": "394", | |
| "attribute": "presence", | |
| "sendEvent": true, | |
| "x": 80, | |
| "y": 120, | |
| "wires": [ | |
| [ | |
| "dd44008d.cfcd4" | |
| ] | |
| ] | |
| }, | |
| { | |
| "id": "ce8e69a9.89d5d8", | |
| "type": "hubitat device", | |
| "z": "866a2010.a3d2f", | |
| "name": "Home-R", | |
| "server": "21cafcc5.b5a984", | |
| "deviceId": "395", | |
| "attribute": "presence", | |
| "sendEvent": true, | |
| "x": 80, | |
| "y": 180, | |
| "wires": [ | |
| [ | |
| "dd44008d.cfcd4" | |
| ] | |
| ] | |
| }, | |
| { | |
| "id": "b4a9a1ba.7b558", | |
| "type": "switch", | |
| "z": "866a2010.a3d2f", | |
| "name": "present/not present", | |
| "property": "payload.value", | |
| "propertyType": "msg", | |
| "rules": [ | |
| { | |
| "t": "eq", | |
| "v": "not present", | |
| "vt": "str" | |
| }, | |
| { | |
| "t": "eq", | |
| "v": "present", | |
| "vt": "str" | |
| } | |
| ], | |
| "checkall": "true", | |
| "repair": false, | |
| "outputs": 2, | |
| "x": 330, | |
| "y": 100, | |
| "wires": [ | |
| [ | |
| "2554b1eb.a581de" | |
| ], | |
| [ | |
| "21dbaba.b0c8654" | |
| ] | |
| ] | |
| }, | |
| { | |
| "id": "a839c765.c17178", | |
| "type": "comment", | |
| "z": "866a2010.a3d2f", | |
| "name": "Arrival/Departure ", | |
| "info": "", | |
| "x": 100, | |
| "y": 60, | |
| "wires": [] | |
| }, | |
| { | |
| "id": "2554b1eb.a581de", | |
| "type": "hubitat device", | |
| "z": "866a2010.a3d2f", | |
| "name": "Home-B", | |
| "server": "21cafcc5.b5a984", | |
| "deviceId": "394", | |
| "attribute": "presence", | |
| "sendEvent": false, | |
| "x": 540, | |
| "y": 80, | |
| "wires": [ | |
| [ | |
| "9abe4f11.1f16a" | |
| ] | |
| ] | |
| }, | |
| { | |
| "id": "9abe4f11.1f16a", | |
| "type": "switch", | |
| "z": "866a2010.a3d2f", | |
| "name": "present/not present", | |
| "property": "payload.value", | |
| "propertyType": "msg", | |
| "rules": [ | |
| { | |
| "t": "eq", | |
| "v": "not present", | |
| "vt": "str" | |
| } | |
| ], | |
| "checkall": "true", | |
| "repair": false, | |
| "outputs": 1, | |
| "x": 710, | |
| "y": 80, | |
| "wires": [ | |
| [ | |
| "d81078cf.457f28" | |
| ] | |
| ] | |
| }, | |
| { | |
| "id": "d81078cf.457f28", | |
| "type": "hubitat device", | |
| "z": "866a2010.a3d2f", | |
| "name": "Home-R", | |
| "server": "21cafcc5.b5a984", | |
| "deviceId": "395", | |
| "attribute": "presence", | |
| "sendEvent": false, | |
| "x": 880, | |
| "y": 80, | |
| "wires": [ | |
| [ | |
| "c53ef3b0.e852d" | |
| ] | |
| ] | |
| }, | |
| { | |
| "id": "c53ef3b0.e852d", | |
| "type": "switch", | |
| "z": "866a2010.a3d2f", | |
| "name": "present/not present", | |
| "property": "payload.value", | |
| "propertyType": "msg", | |
| "rules": [ | |
| { | |
| "t": "eq", | |
| "v": "not present", | |
| "vt": "str" | |
| } | |
| ], | |
| "checkall": "true", | |
| "repair": false, | |
| "outputs": 1, | |
| "x": 1050, | |
| "y": 80, | |
| "wires": [ | |
| [ | |
| "73504949.2c90a8", | |
| "73946be1.2fd594" | |
| ] | |
| ] | |
| }, | |
| { | |
| "id": "c25af692.005bf8", | |
| "type": "comment", | |
| "z": "866a2010.a3d2f", | |
| "name": "Not Present", | |
| "info": "", | |
| "x": 490, | |
| "y": 40, | |
| "wires": [] | |
| }, | |
| { | |
| "id": "73504949.2c90a8", | |
| "type": "hubitat mode", | |
| "z": "866a2010.a3d2f", | |
| "name": "mode", | |
| "server": "21cafcc5.b5a984", | |
| "sendEvent": false, | |
| "x": 600, | |
| "y": 140, | |
| "wires": [ | |
| [ | |
| "1eec6533.17391b" | |
| ] | |
| ] | |
| }, | |
| { | |
| "id": "1eec6533.17391b", | |
| "type": "switch", | |
| "z": "866a2010.a3d2f", | |
| "name": "Not Cleaners", | |
| "property": "payload.value", | |
| "propertyType": "msg", | |
| "rules": [ | |
| { | |
| "t": "neq", | |
| "v": "Cleaners", | |
| "vt": "str" | |
| } | |
| ], | |
| "checkall": "true", | |
| "repair": false, | |
| "outputs": 1, | |
| "x": 750, | |
| "y": 140, | |
| "wires": [ | |
| [ | |
| "212fa171.0588ae", | |
| "11359f95.13c83", | |
| "7407e712.361d18" | |
| ] | |
| ] | |
| }, | |
| { | |
| "id": "212fa171.0588ae", | |
| "type": "hubitat hsm-setter", | |
| "z": "866a2010.a3d2f", | |
| "name": "Arm Home", | |
| "server": "21cafcc5.b5a984", | |
| "state": "armHome", | |
| "x": 940, | |
| "y": 140, | |
| "wires": [ | |
| [] | |
| ] | |
| }, | |
| { | |
| "id": "11359f95.13c83", | |
| "type": "hubitat mode-setter", | |
| "z": "866a2010.a3d2f", | |
| "name": "Set mode to Away", | |
| "server": "21cafcc5.b5a984", | |
| "modeId": "2", | |
| "x": 950, | |
| "y": 180, | |
| "wires": [ | |
| [] | |
| ] | |
| }, | |
| { | |
| "id": "21dbaba.b0c8654", | |
| "type": "hubitat mode", | |
| "z": "866a2010.a3d2f", | |
| "name": "", | |
| "server": "21cafcc5.b5a984", | |
| "sendEvent": false, | |
| "x": 490, | |
| "y": 240, | |
| "wires": [ | |
| [ | |
| "b24dfdf6.1d9c7" | |
| ] | |
| ] | |
| }, | |
| { | |
| "id": "65f026e3.4daf58", | |
| "type": "comment", | |
| "z": "866a2010.a3d2f", | |
| "name": "Present", | |
| "info": "", | |
| "x": 490, | |
| "y": 200, | |
| "wires": [] | |
| }, | |
| { | |
| "id": "b24dfdf6.1d9c7", | |
| "type": "switch", | |
| "z": "866a2010.a3d2f", | |
| "name": "is Away", | |
| "property": "payload.value", | |
| "propertyType": "msg", | |
| "rules": [ | |
| { | |
| "t": "eq", | |
| "v": "Away", | |
| "vt": "str" | |
| } | |
| ], | |
| "checkall": "true", | |
| "repair": false, | |
| "outputs": 1, | |
| "x": 540, | |
| "y": 300, | |
| "wires": [ | |
| [ | |
| "bab4c9ee.a09d48" | |
| ] | |
| ] | |
| }, | |
| { | |
| "id": "bab4c9ee.a09d48", | |
| "type": "hubitat mode-setter", | |
| "z": "866a2010.a3d2f", | |
| "name": "Home", | |
| "server": "21cafcc5.b5a984", | |
| "modeId": "1", | |
| "x": 570, | |
| "y": 340, | |
| "wires": [ | |
| [ | |
| "cbd5429d.1e186" | |
| ] | |
| ] | |
| }, | |
| { | |
| "id": "feb35495.5bc3b8", | |
| "type": "pushover api", | |
| "z": "866a2010.a3d2f", | |
| "keys": "b3ffec8b.aa42d", | |
| "title": "Alarm Status", | |
| "name": "Alarm Status B", | |
| "x": 1200, | |
| "y": 380, | |
| "wires": [] | |
| }, | |
| { | |
| "id": "73946be1.2fd594", | |
| "type": "no-op", | |
| "z": "866a2010.a3d2f", | |
| "name": "To Do: lock and close everything", | |
| "x": 1230, | |
| "y": 160, | |
| "wires": [ | |
| [] | |
| ] | |
| }, | |
| { | |
| "id": "2c2e7fce.e665f", | |
| "type": "change", | |
| "z": "866a2010.a3d2f", | |
| "name": "Add arm message + timestamp", | |
| "rules": [ | |
| { | |
| "t": "set", | |
| "p": "payload", | |
| "pt": "msg", | |
| "to": "Armed Alarm at TIMESTAMP", | |
| "tot": "str" | |
| }, | |
| { | |
| "t": "change", | |
| "p": "payload", | |
| "pt": "msg", | |
| "from": "TIMESTAMP", | |
| "fromt": "str", | |
| "to": "time", | |
| "tot": "msg" | |
| } | |
| ], | |
| "action": "", | |
| "property": "", | |
| "from": "", | |
| "to": "", | |
| "reg": false, | |
| "x": 1050, | |
| "y": 280, | |
| "wires": [ | |
| [ | |
| "fe5ec357.03dc4" | |
| ] | |
| ] | |
| }, | |
| { | |
| "id": "7407e712.361d18", | |
| "type": "function", | |
| "z": "866a2010.a3d2f", | |
| "name": "timestamp", | |
| "func": "msg.time = new Date().toLocaleString()\nreturn msg;", | |
| "outputs": 1, | |
| "noerr": 0, | |
| "initialize": "", | |
| "finalize": "", | |
| "x": 730, | |
| "y": 200, | |
| "wires": [ | |
| [ | |
| "a59d0c41.b05ea" | |
| ] | |
| ] | |
| }, | |
| { | |
| "id": "dd44008d.cfcd4", | |
| "type": "change", | |
| "z": "866a2010.a3d2f", | |
| "name": "Save payload to msg.data", | |
| "rules": [ | |
| { | |
| "t": "set", | |
| "p": "data", | |
| "pt": "msg", | |
| "to": "payload", | |
| "tot": "msg" | |
| } | |
| ], | |
| "action": "", | |
| "property": "", | |
| "from": "", | |
| "to": "", | |
| "reg": false, | |
| "x": 280, | |
| "y": 140, | |
| "wires": [ | |
| [ | |
| "b4a9a1ba.7b558" | |
| ] | |
| ] | |
| }, | |
| { | |
| "id": "3f8ce91d.1e6746", | |
| "type": "debug", | |
| "z": "866a2010.a3d2f", | |
| "name": "", | |
| "active": true, | |
| "tosidebar": true, | |
| "console": false, | |
| "tostatus": false, | |
| "complete": "data", | |
| "targetType": "msg", | |
| "statusVal": "", | |
| "statusType": "auto", | |
| "x": 1180, | |
| "y": 420, | |
| "wires": [] | |
| }, | |
| { | |
| "id": "fe5ec357.03dc4", | |
| "type": "switch", | |
| "z": "866a2010.a3d2f", | |
| "name": "Who left/arrived? Just tell them status.", | |
| "property": "data.displayName", | |
| "propertyType": "msg", | |
| "rules": [ | |
| { | |
| "t": "cont", | |
| "v": "Home-R", | |
| "vt": "str" | |
| }, | |
| { | |
| "t": "cont", | |
| "v": "Home-B", | |
| "vt": "str" | |
| } | |
| ], | |
| "checkall": "true", | |
| "repair": false, | |
| "outputs": 2, | |
| "x": 930, | |
| "y": 340, | |
| "wires": [ | |
| [ | |
| "e7c0fff4.2eab5", | |
| "3f8ce91d.1e6746" | |
| ], | |
| [ | |
| "feb35495.5bc3b8", | |
| "3f8ce91d.1e6746" | |
| ] | |
| ] | |
| }, | |
| { | |
| "id": "a59d0c41.b05ea", | |
| "type": "switch", | |
| "z": "866a2010.a3d2f", | |
| "name": "present or not present", | |
| "property": "data.value", | |
| "propertyType": "msg", | |
| "rules": [ | |
| { | |
| "t": "eq", | |
| "v": "present", | |
| "vt": "str" | |
| }, | |
| { | |
| "t": "eq", | |
| "v": "not present", | |
| "vt": "str" | |
| } | |
| ], | |
| "checkall": "true", | |
| "repair": false, | |
| "outputs": 2, | |
| "x": 800, | |
| "y": 260, | |
| "wires": [ | |
| [ | |
| "d4094b6c.9d76b8" | |
| ], | |
| [ | |
| "2c2e7fce.e665f" | |
| ] | |
| ] | |
| }, | |
| { | |
| "id": "d4094b6c.9d76b8", | |
| "type": "change", | |
| "z": "866a2010.a3d2f", | |
| "name": "Add disarm message + timestamp", | |
| "rules": [ | |
| { | |
| "t": "set", | |
| "p": "payload", | |
| "pt": "msg", | |
| "to": "Disarmed Alarm at TIMESTAMP", | |
| "tot": "str" | |
| }, | |
| { | |
| "t": "change", | |
| "p": "payload", | |
| "pt": "msg", | |
| "from": "TIMESTAMP", | |
| "fromt": "str", | |
| "to": "time", | |
| "tot": "msg" | |
| } | |
| ], | |
| "action": "", | |
| "property": "", | |
| "from": "", | |
| "to": "", | |
| "reg": false, | |
| "x": 1060, | |
| "y": 240, | |
| "wires": [ | |
| [ | |
| "fe5ec357.03dc4" | |
| ] | |
| ] | |
| }, | |
| { | |
| "id": "e7c0fff4.2eab5", | |
| "type": "pushover api", | |
| "z": "866a2010.a3d2f", | |
| "keys": "8ea7487b.14b4f8", | |
| "title": "Alarm Status", | |
| "name": "Alarm Status R", | |
| "x": 1200, | |
| "y": 340, | |
| "wires": [] | |
| }, | |
| { | |
| "id": "cbd5429d.1e186", | |
| "type": "hubitat hsm-setter", | |
| "z": "866a2010.a3d2f", | |
| "name": "Disarm", | |
| "server": "21cafcc5.b5a984", | |
| "state": "disarmAll", | |
| "x": 620, | |
| "y": 380, | |
| "wires": [ | |
| [ | |
| "7407e712.361d18" | |
| ] | |
| ] | |
| }, | |
| { | |
| "id": "21cafcc5.b5a984", | |
| "type": "hubitat config", | |
| "z": "", | |
| "name": "Hubitat-LAN", | |
| "usetls": false, | |
| "host": "192.168.1.30", | |
| "port": "80", | |
| "appId": "360", | |
| "nodeRedServer": "http://192.168.1.2:1880", | |
| "webhookPath": "/hubitat/webhook-lan", | |
| "autoRefresh": true, | |
| "useWebsocket": false | |
| }, | |
| { | |
| "id": "b3ffec8b.aa42d", | |
| "type": "pushover-keys", | |
| "z": "", | |
| "name": "B's Pushover" | |
| }, | |
| { | |
| "id": "8ea7487b.14b4f8", | |
| "type": "pushover-keys", | |
| "z": "", | |
| "name": "R's Pushover" | |
| } | |
| ] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment