+[{"id":"6868127e03a21157","type":"subflow","name":"Sensor","info":"","category":"","in":[{"x":140,"y":260,"wires":[{"id":"8861c075a05f8cb3"}]}],"out":[],"env":[],"meta":{},"color":"#C7E900","icon":"node-red/feed.svg","status":{"x":580,"y":280,"wires":[{"id":"dad060c1eac269e6","port":0}]}},{"id":"dad060c1eac269e6","type":"change","z":"6868127e03a21157","name":"enabled_var","rules":[{"t":"set","p":"enabled_var","pt":"flow","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":450,"y":280,"wires":[[]]},{"id":"8861c075a05f8cb3","type":"switch","z":"6868127e03a21157","name":"","property":"topic","propertyType":"msg","rules":[{"t":"eq","v":"motion","vt":"str"},{"t":"eq","v":"enabled","vt":"str"}],"checkall":"true","repair":false,"outputs":2,"x":270,"y":260,"wires":[["63d326fed1b3950b"],["dad060c1eac269e6"]]},{"id":"63d326fed1b3950b","type":"change","z":"6868127e03a21157","name":"motion_var","rules":[{"t":"set","p":"motion_var","pt":"flow","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":450,"y":240,"wires":[[]]},{"id":"55a74390e1c251fb","type":"subflow","name":"HUE Motion (Receiver)","info":"","category":"HUE v2","in":[{"x":40,"y":440,"wires":[{"id":"27fffc1774c07397"}]}],"out":[{"x":1090,"y":380,"wires":[{"id":"d03a5382fae59395","port":0},{"id":"321f867083c0e761","port":0}]},{"x":1090,"y":500,"wires":[{"id":"d03a5382fae59395","port":0},{"id":"321f867083c0e761","port":0},{"id":"ecfe4b625af78b92","port":0},{"id":"e3197255f3d59ca0","port":0}]}],"env":[{"name":"motion_ID","type":"str","value":"replace with discovered Motion Sensor ID"}],"meta":{},"color":"#C7E9C0","outputLabels":["motion","data"],"icon":"node-red/bridge-dash.svg"},{"id":"4f8d9c73725ad07b","type":"switch","z":"55a74390e1c251fb","name":"payload.motion.motion","property":"payload.data.0.motion.motion","propertyType":"msg","rules":[{"t":"true"},{"t":"false"}],"checkall":"true","repair":false,"outputs":2,"x":590,"y":400,"wires":[["d03a5382fae59395"],["321f867083c0e761"]]},{"id":"d03a5382fae59395","type":"change","z":"55a74390e1c251fb","name":"true","rules":[{"t":"set","p":"payload","pt":"msg","to":"true","tot":"bool"},{"t":"set","p":"topic","pt":"msg","to":"motion","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":830,"y":380,"wires":[[]]},{"id":"321f867083c0e761","type":"change","z":"55a74390e1c251fb","name":"false","rules":[{"t":"set","p":"payload","pt":"msg","to":"false","tot":"bool"},{"t":"set","p":"topic","pt":"msg","to":"motion","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":830,"y":420,"wires":[[]]},{"id":"27fffc1774c07397","type":"switch","z":"55a74390e1c251fb","name":"Motion Sensor ID","property":"payload.data.0.id","propertyType":"msg","rules":[{"t":"cont","v":"motion_ID","vt":"env"}],"checkall":"true","repair":false,"outputs":1,"x":190,"y":440,"wires":[["407d4a27886b89cb"]]},{"id":"407d4a27886b89cb","type":"rbe","z":"55a74390e1c251fb","name":"","func":"rbe","gap":"","start":"","inout":"out","septopics":true,"property":"payload","topi":"topic","x":370,"y":440,"wires":[["4f8d9c73725ad07b","ab6f3bb318571142"]]},{"id":"ab6f3bb318571142","type":"switch","z":"55a74390e1c251fb","name":"payload.data.0.enabled","property":"payload.data.0.enabled","propertyType":"msg","rules":[{"t":"true"},{"t":"false"}],"checkall":"true","repair":false,"outputs":2,"x":590,"y":480,"wires":[["ecfe4b625af78b92"],["e3197255f3d59ca0"]]},{"id":"ecfe4b625af78b92","type":"change","z":"55a74390e1c251fb","name":"true","rules":[{"t":"set","p":"payload","pt":"msg","to":"true","tot":"bool"},{"t":"set","p":"topic","pt":"msg","to":"enabled","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":830,"y":460,"wires":[[]]},{"id":"e3197255f3d59ca0","type":"change","z":"55a74390e1c251fb","name":"false","rules":[{"t":"set","p":"payload","pt":"msg","to":"false","tot":"bool"},{"t":"set","p":"topic","pt":"msg","to":"enabled","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":830,"y":500,"wires":[[]]},{"id":"ce92d5328de0babb","type":"tab","label":"Motion Sensor Update","disabled":false,"info":"","env":[]},{"id":"2af57fd228698d85","type":"subflow:55a74390e1c251fb","z":"ce92d5328de0babb","name":"","env":[{"name":"motion_ID","value":"add Sensor ID here","type":"str"}],"x":580,"y":520,"wires":[["531f181ef214f441","82cc9fe997d212d6"],["855a92da1897d417"]]},{"id":"855a92da1897d417","type":"subflow:6868127e03a21157","z":"ce92d5328de0babb","name":"","x":900,"y":580,"wires":[]},{"id":"613ad3f55cd7f053","type":"link in","z":"ce92d5328de0babb","name":"connection to EventStream","links":[],"x":330,"y":520,"wires":[["2af57fd228698d85"]],"l":true},{"id":"531f181ef214f441","type":"link out","z":"ce92d5328de0babb","name":"Motion Sensor Events (true / false)","mode":"link","links":[],"x":980,"y":460,"wires":[],"l":true},{"id":"82cc9fe997d212d6","type":"debug","z":"ce92d5328de0babb","name":"Motion","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":900,"y":420,"wires":[]},{"id":"641c87737011cbd6","type":"comment","z":"ce92d5328de0babb","name":"- Shows Sensor Enable / Disable state (true/false)","info":"","x":1020,"y":620,"wires":[]},{"id":"4b52c5ec87171be3","type":"comment","z":"ce92d5328de0babb","name":"Add Sensor ID here","info":"","x":570,"y":480,"wires":[]},{"id":"b90d6b734818e3c5","type":"comment","z":"ce92d5328de0babb","name":"- 2 Variables by default (flow, memory) both boolean","info":"","x":1030,"y":660,"wires":[]},{"id":"cad81179d5cc0012","type":"comment","z":"ce92d5328de0babb","name":"enable_var","info":"","x":900,"y":700,"wires":[]},{"id":"a136298253031d5e","type":"comment","z":"ce92d5328de0babb","name":"motion_var","info":"","x":1040,"y":700,"wires":[]},{"id":"7a4bf7f01b02b3e6","type":"comment","z":"ce92d5328de0babb","name":"(Edit the variable names if needed)","info":"","x":980,"y":740,"wires":[]},{"id":"b73eeb261d5a803e","type":"comment","z":"ce92d5328de0babb","name":"Comments - DOUBLE CLICK","info":"I use the Sensor Subflow node in every\nroom flow-tab. It is mostly informative. \n\nTHERE IS NO NEED TO CHANGE\nYOUR EXISTING FLOW. THIS IS NICE TO HAVE!\n\nIt makes in node-red easy to determine what \nstate the sensors have and also come with \nbuilt-in flow variables that can be used \nfor function nodes.\n\nVariable reminder:\n(you cant use more than one in the same flow-tab)\n\nMaybey you find this useful as well :)\nPlease edit for your requirements","x":960,"y":520,"wires":[]}]
0 commit comments