[
  {
    "id": "dimmer_group",
    "type": "group",
    "style": {
      "stroke": "#999999",
      "stroke-opacity": "1",
      "fill": "none",
      "fill-opacity": "1",
      "label": true,
      "label-position": "nw",
      "color": "#a4a4a4"
    },
    "nodes": [
      "inject_dimmer_50",
      "inject_dimmer_100",
      "debug_status",
      "debug_dimming_feedback",
      "debug_dimming_cmd",
      "debug_cmd_on",
      "function_gradual_dim",
      "inject_gradual_dim",
      "comment_dimmer_logic",
      "e58369bc304b4448",
      "fe606e44aa7778b9",
      "c9a4759314aa2e56",
      "10c0f01d835d3a47",
      "8e1b053c0b5da49f",
      "3c78b9e4617a98bc",
      "6f5394e3439d8586",
      "e2a9b1d45f579dd1",
      "8fa49246e74a03c8",
      "48b2473fad6809e6",
      "3234c8ae95580a72"
    ],
    "x": 174,
    "y": 1199,
    "w": 1072,
    "h": 462
  },
  {
    "id": "inject_dimmer_50",
    "type": "inject",
    "g": "dimmer_group",
    "name": "Dim 50%",
    "props": [
      {
        "p": "payload"
      }
    ],
    "repeat": "",
    "crontab": "",
    "once": false,
    "onceDelay": "0",
    "topic": "",
    "payload": "50",
    "payloadType": "num",
    "x": 280,
    "y": 1440,
    "wires": [
      [
        "e2a9b1d45f579dd1"
      ]
    ]
  },
  {
    "id": "inject_dimmer_100",
    "type": "inject",
    "g": "dimmer_group",
    "name": "Dim 100%",
    "props": [
      {
        "p": "payload"
      }
    ],
    "repeat": "",
    "crontab": "",
    "once": false,
    "onceDelay": "0",
    "topic": "",
    "payload": "100",
    "payloadType": "num",
    "x": 280,
    "y": 1480,
    "wires": [
      [
        "e2a9b1d45f579dd1"
      ]
    ]
  },
  {
    "id": "debug_status",
    "type": "debug",
    "g": "dimmer_group",
    "name": "2 · Status feedback",
    "active": true,
    "tosidebar": true,
    "console": false,
    "tostatus": false,
    "complete": "true",
    "targetType": "full",
    "statusVal": "",
    "statusType": "auto",
    "x": 1090,
    "y": 1400,
    "wires": []
  },
  {
    "id": "debug_dimming_feedback",
    "type": "debug",
    "g": "dimmer_group",
    "name": "4 · Dimming feedback",
    "active": true,
    "tosidebar": true,
    "console": false,
    "tostatus": false,
    "complete": "true",
    "targetType": "full",
    "statusVal": "",
    "statusType": "auto",
    "x": 1100,
    "y": 1480,
    "wires": []
  },
  {
    "id": "debug_dimming_cmd",
    "type": "debug",
    "g": "dimmer_group",
    "name": "3 · Dimming setpoint",
    "active": true,
    "tosidebar": true,
    "console": false,
    "tostatus": false,
    "complete": "true",
    "targetType": "full",
    "statusVal": "",
    "statusType": "auto",
    "x": 1100,
    "y": 1440,
    "wires": []
  },
  {
    "id": "debug_cmd_on",
    "type": "debug",
    "g": "dimmer_group",
    "name": "1 · Switch On/OFF",
    "active": true,
    "tosidebar": true,
    "console": false,
    "tostatus": false,
    "complete": "true",
    "targetType": "full",
    "statusVal": "",
    "statusType": "auto",
    "x": 1090,
    "y": 1360,
    "wires": []
  },
  {
    "id": "function_gradual_dim",
    "type": "function",
    "g": "dimmer_group",
    "name": "Gradual Dimming",
    "func": "// Ramp the dimmer from 0 to 100 % in steps of 10, one step every 500 ms\nfor (let level = 0; level <= 100; level += 10) {\n    setTimeout(() => {\n        node.send({ inputTarget: \"Dimming setpoint\", payload: level });\n        node.status({ fill: \"yellow\", shape: \"dot\", text: level + \"%\" });\n    }, level * 50);\n}\nreturn null;",
    "outputs": 1,
    "timeout": 0,
    "noerr": 0,
    "initialize": "",
    "finalize": "",
    "libs": [],
    "x": 690,
    "y": 1620,
    "wires": [
      [
        "e58369bc304b4448"
      ]
    ]
  },
  {
    "id": "inject_gradual_dim",
    "type": "inject",
    "g": "dimmer_group",
    "name": "Start Gradual Dim",
    "props": [],
    "repeat": "",
    "crontab": "",
    "once": false,
    "onceDelay": "0",
    "topic": "",
    "x": 450,
    "y": 1620,
    "wires": [
      [
        "function_gradual_dim"
      ]
    ]
  },
  {
    "id": "comment_dimmer_logic",
    "type": "comment",
    "g": "dimmer_group",
    "name": "Communication Dimmer",
    "info": "## Dimmer node\nDevice: double-click the device node and choose the device of your installation, then Deploy.\n\n### Input targets\n- `Switch On/OFF` — command, true / false\n- `Status feedback` — feedback, true / false\n- `Dimming setpoint` — command, 0-100 %\n- `Dimming feedback` — feedback, 0-100 %\n\n### Outputs\n1. Switch On/OFF · 2. Status feedback · 3. Dimming setpoint · 4. Dimming feedback\n\n### Rules (node-red-cgen-widget-nodes 1.15)\n- `msg.inputTarget` must match a name above exactly (case-sensitive). Use an **Input Target** node to pick it from a list. A message with a missing or unknown target is ignored.\n- A message from the flow is sent to the server and also leaves on the output of the same name.\n- Outputs also fire when the device changes elsewhere: a **command** output when the app, a scenario, an automation or another flow commands it (only when the value changes), a **feedback** output each time the device reports a value.\n- Writing a feedback / status target updates the value HyperVisu shows; nothing is sent to the device. Use it with VIRTUAL devices.",
    "x": 510,
    "y": 1240,
    "wires": []
  },
  {
    "id": "e58369bc304b4448",
    "type": "widget-Dimmer",
    "g": "dimmer_group",
    "dropdownRoom": "",
    "dropdownCategory": "",
    "dropdownWidget": "",
    "displayName": "Dimmer (set device)",
    "x": 780,
    "y": 1420,
    "wires": [
      [
        "debug_cmd_on"
      ],
      [
        "debug_status"
      ],
      [
        "debug_dimming_cmd"
      ],
      [
        "debug_dimming_feedback"
      ]
    ]
  },
  {
    "id": "fe606e44aa7778b9",
    "type": "inject",
    "g": "dimmer_group",
    "name": "ON",
    "props": [
      {
        "p": "payload"
      }
    ],
    "repeat": "",
    "crontab": "",
    "once": false,
    "onceDelay": "0",
    "topic": "",
    "payload": "true",
    "payloadType": "bool",
    "x": 310,
    "y": 1280,
    "wires": [
      [
        "10c0f01d835d3a47"
      ]
    ]
  },
  {
    "id": "c9a4759314aa2e56",
    "type": "inject",
    "g": "dimmer_group",
    "name": "OFF",
    "props": [
      {
        "p": "payload"
      }
    ],
    "repeat": "",
    "crontab": "",
    "once": false,
    "onceDelay": "0",
    "topic": "",
    "payload": "false",
    "payloadType": "bool",
    "x": 300,
    "y": 1320,
    "wires": [
      [
        "10c0f01d835d3a47"
      ]
    ]
  },
  {
    "id": "10c0f01d835d3a47",
    "type": "hypervisu-input-target",
    "g": "dimmer_group",
    "selectedWidget": "6",
    "selectedInput": "Switch On/OFF",
    "displayName": "Input Target",
    "x": 500,
    "y": 1300,
    "wires": [
      [
        "e58369bc304b4448"
      ]
    ]
  },
  {
    "id": "8e1b053c0b5da49f",
    "type": "hypervisu-input-target",
    "g": "dimmer_group",
    "selectedWidget": "6",
    "selectedInput": "Status feedback",
    "displayName": "Input Target",
    "x": 490,
    "y": 1380,
    "wires": [
      [
        "e58369bc304b4448"
      ]
    ]
  },
  {
    "id": "3c78b9e4617a98bc",
    "type": "inject",
    "g": "dimmer_group",
    "name": "ON",
    "props": [
      {
        "p": "payload"
      }
    ],
    "repeat": "",
    "crontab": "",
    "once": false,
    "onceDelay": "0",
    "topic": "",
    "payload": "true",
    "payloadType": "bool",
    "x": 300,
    "y": 1360,
    "wires": [
      [
        "8e1b053c0b5da49f"
      ]
    ]
  },
  {
    "id": "6f5394e3439d8586",
    "type": "inject",
    "g": "dimmer_group",
    "name": "OFF",
    "props": [
      {
        "p": "payload"
      }
    ],
    "repeat": "",
    "crontab": "",
    "once": false,
    "onceDelay": "0",
    "topic": "",
    "payload": "false",
    "payloadType": "bool",
    "x": 300,
    "y": 1400,
    "wires": [
      [
        "8e1b053c0b5da49f"
      ]
    ]
  },
  {
    "id": "e2a9b1d45f579dd1",
    "type": "hypervisu-input-target",
    "g": "dimmer_group",
    "selectedWidget": "6",
    "selectedInput": "Dimming setpoint",
    "displayName": "Input Target",
    "x": 490,
    "y": 1460,
    "wires": [
      [
        "e58369bc304b4448"
      ]
    ]
  },
  {
    "id": "8fa49246e74a03c8",
    "type": "hypervisu-input-target",
    "g": "dimmer_group",
    "selectedWidget": "6",
    "selectedInput": "Dimming feedback",
    "displayName": "Input Target",
    "x": 490,
    "y": 1520,
    "wires": [
      [
        "e58369bc304b4448"
      ]
    ]
  },
  {
    "id": "48b2473fad6809e6",
    "type": "inject",
    "g": "dimmer_group",
    "name": "Dim 50%",
    "props": [
      {
        "p": "payload"
      }
    ],
    "repeat": "",
    "crontab": "",
    "once": false,
    "onceDelay": "0",
    "topic": "",
    "payload": "50",
    "payloadType": "num",
    "x": 280,
    "y": 1520,
    "wires": [
      [
        "8fa49246e74a03c8"
      ]
    ]
  },
  {
    "id": "3234c8ae95580a72",
    "type": "inject",
    "g": "dimmer_group",
    "name": "Dim 100%",
    "props": [
      {
        "p": "payload"
      }
    ],
    "repeat": "",
    "crontab": "",
    "once": false,
    "onceDelay": "0",
    "topic": "",
    "payload": "100",
    "payloadType": "num",
    "x": 280,
    "y": 1560,
    "wires": [
      [
        "8fa49246e74a03c8"
      ]
    ]
  }
]