[
  {
    "id": "digital_input_group",
    "type": "group",
    "style": {
      "stroke": "#999999",
      "stroke-opacity": "1",
      "fill": "none",
      "fill-opacity": "1",
      "label": true,
      "label-position": "nw",
      "color": "#a4a4a4"
    },
    "nodes": [
      "inject_door_open",
      "inject_door_closed",
      "inject_motion_detected",
      "inject_motion_clear",
      "debug_digital_value",
      "function_door_simulator",
      "inject_door_sim",
      "comment_digital_logic",
      "8cc9cd937f88543a",
      "1fbdb6ba8a2d75e6"
    ],
    "x": 134,
    "y": 3299,
    "w": 932,
    "h": 322
  },
  {
    "id": "inject_door_open",
    "type": "inject",
    "g": "digital_input_group",
    "name": "Door Open",
    "props": [
      {
        "p": "payload"
      }
    ],
    "repeat": "",
    "crontab": "",
    "once": false,
    "onceDelay": "0",
    "topic": "",
    "payload": "true",
    "payloadType": "bool",
    "x": 240,
    "y": 3420,
    "wires": [
      [
        "1fbdb6ba8a2d75e6"
      ]
    ]
  },
  {
    "id": "inject_door_closed",
    "type": "inject",
    "g": "digital_input_group",
    "name": "Door Closed",
    "props": [
      {
        "p": "payload"
      }
    ],
    "repeat": "",
    "crontab": "",
    "once": false,
    "onceDelay": "0",
    "topic": "",
    "payload": "false",
    "payloadType": "bool",
    "x": 250,
    "y": 3460,
    "wires": [
      [
        "8cc9cd937f88543a"
      ]
    ]
  },
  {
    "id": "inject_motion_detected",
    "type": "inject",
    "g": "digital_input_group",
    "name": "Motion Detected",
    "props": [
      {
        "p": "inputTarget",
        "v": "Digital Input",
        "vt": "str"
      },
      {
        "p": "payload",
        "v": "true",
        "vt": "bool"
      }
    ],
    "repeat": "",
    "crontab": "",
    "once": false,
    "onceDelay": "0",
    "topic": "",
    "x": 260,
    "y": 3500,
    "wires": [
      [
        "8cc9cd937f88543a"
      ]
    ]
  },
  {
    "id": "inject_motion_clear",
    "type": "inject",
    "g": "digital_input_group",
    "name": "Motion Clear",
    "props": [
      {
        "p": "inputTarget",
        "v": "Digital Input",
        "vt": "str"
      },
      {
        "p": "payload",
        "v": "false",
        "vt": "bool"
      }
    ],
    "repeat": "",
    "crontab": "",
    "once": false,
    "onceDelay": "0",
    "topic": "",
    "x": 250,
    "y": 3540,
    "wires": [
      [
        "8cc9cd937f88543a"
      ]
    ]
  },
  {
    "id": "debug_digital_value",
    "type": "debug",
    "g": "digital_input_group",
    "name": "1 · Feedback",
    "active": true,
    "tosidebar": true,
    "console": false,
    "tostatus": false,
    "complete": "true",
    "targetType": "full",
    "statusVal": "",
    "statusType": "auto",
    "x": 950,
    "y": 3480,
    "wires": []
  },
  {
    "id": "function_door_simulator",
    "type": "function",
    "g": "digital_input_group",
    "name": "Door Simulator",
    "func": "// Toggle the Digital Input device between true (open / detected) and false\nconst state = !context.get('state');\ncontext.set('state', state);\nmsg.inputTarget = \"Digital Input\";\nmsg.payload = state;\nnode.status({ fill: state ? \"red\" : \"green\", shape: \"dot\", text: state ? \"true\" : \"false\" });\nreturn msg;",
    "outputs": 1,
    "timeout": 0,
    "noerr": 0,
    "initialize": "",
    "finalize": "",
    "libs": [],
    "x": 460,
    "y": 3580,
    "wires": [
      [
        "8cc9cd937f88543a"
      ]
    ]
  },
  {
    "id": "inject_door_sim",
    "type": "inject",
    "g": "digital_input_group",
    "name": "Toggle Sensor",
    "props": [],
    "repeat": "",
    "crontab": "",
    "once": false,
    "onceDelay": "0",
    "topic": "",
    "x": 250,
    "y": 3580,
    "wires": [
      [
        "function_door_simulator"
      ]
    ]
  },
  {
    "id": "comment_digital_logic",
    "type": "comment",
    "g": "digital_input_group",
    "name": "Communication Digital Input",
    "info": "## Digital Input node\nDevice: double-click the device node and choose the device of your installation, then Deploy.\n\n### Input\ntrue / false in `msg.payload`. `msg.inputTarget` is optional (`Digital Input`).\n\n### Output\n1. Feedback — the state, each time the device reports one (also after a value written by this flow, once the server has stored it).",
    "x": 340,
    "y": 3340,
    "wires": []
  },
  {
    "id": "8cc9cd937f88543a",
    "type": "widget-DigitalInput",
    "g": "digital_input_group",
    "dropdownRoom": "",
    "dropdownCategory": "",
    "dropdownWidget": "",
    "displayName": "Digital Input (set device)",
    "x": 680,
    "y": 3480,
    "wires": [
      [
        "debug_digital_value"
      ]
    ]
  },
  {
    "id": "1fbdb6ba8a2d75e6",
    "type": "hypervisu-input-target",
    "g": "digital_input_group",
    "selectedWidget": "10",
    "selectedInput": "Digital Input",
    "displayName": "Input Target",
    "x": 450,
    "y": 3400,
    "wires": [
      [
        "8cc9cd937f88543a"
      ]
    ]
  }
]