[
  {
    "id": "849b64eb6782ebfd",
    "type": "group",
    "style": {
      "stroke": "#999999",
      "stroke-opacity": "1",
      "fill": "none",
      "fill-opacity": "1",
      "label": true,
      "label-position": "nw",
      "color": "#a4a4a4"
    },
    "nodes": [
      "20c02820f7e24aa1",
      "f3dd540b1e24f1b0",
      "0d3235bc0e1728e8",
      "af91a291bd6d4f54",
      "21f7185db2db438e",
      "5664f9ca5c3ea22b",
      "3f5589228dc4ea40",
      "be57933df7c05aba",
      "5463f2d53a202cdc",
      "4e816f7b061bb811",
      "e07c08ee10a3942e",
      "b7f055389ce45117",
      "a71ca5328e2da183",
      "69f425e41eb424ea",
      "03c8baaca2984935",
      "031fdea3a47467e2",
      "5a0fa4ca142ed9ec",
      "63e108849b15a246",
      "fad8d684c47735e1",
      "8c251634649cb5cb"
    ],
    "x": 144,
    "y": 1679,
    "w": 1042,
    "h": 462
  },
  {
    "id": "20c02820f7e24aa1",
    "type": "inject",
    "g": "849b64eb6782ebfd",
    "name": "Set Red",
    "props": [
      {
        "p": "payload"
      }
    ],
    "repeat": "",
    "crontab": "",
    "once": false,
    "onceDelay": "0",
    "topic": "",
    "payload": "{\"red\":255,\"green\":0,\"blue\":0}",
    "payloadType": "json",
    "x": 260,
    "y": 1940,
    "wires": [
      [
        "fad8d684c47735e1"
      ]
    ]
  },
  {
    "id": "f3dd540b1e24f1b0",
    "type": "inject",
    "g": "849b64eb6782ebfd",
    "name": "Set Blue",
    "props": [
      {
        "p": "payload"
      }
    ],
    "repeat": "",
    "crontab": "",
    "once": false,
    "onceDelay": "0",
    "topic": "",
    "payload": "{\"red\":0,\"green\":0,\"blue\":255}",
    "payloadType": "json",
    "x": 260,
    "y": 1980,
    "wires": [
      [
        "fad8d684c47735e1"
      ]
    ]
  },
  {
    "id": "0d3235bc0e1728e8",
    "type": "inject",
    "g": "849b64eb6782ebfd",
    "name": "Set Green",
    "props": [
      {
        "p": "payload"
      }
    ],
    "repeat": "",
    "crontab": "",
    "once": false,
    "onceDelay": "0",
    "topic": "",
    "payload": "{\"red\":0,\"green\":255,\"blue\":0}",
    "payloadType": "json",
    "x": 260,
    "y": 2040,
    "wires": [
      [
        "8c251634649cb5cb"
      ]
    ]
  },
  {
    "id": "af91a291bd6d4f54",
    "type": "inject",
    "g": "849b64eb6782ebfd",
    "name": "Set White",
    "props": [
      {
        "p": "payload"
      }
    ],
    "repeat": "",
    "crontab": "",
    "once": false,
    "onceDelay": "0",
    "topic": "",
    "payload": "{\"red\":255,\"green\":255,\"blue\":255}",
    "payloadType": "json",
    "x": 260,
    "y": 2080,
    "wires": [
      [
        "8c251634649cb5cb"
      ]
    ]
  },
  {
    "id": "21f7185db2db438e",
    "type": "debug",
    "g": "849b64eb6782ebfd",
    "name": "2 · Status feedback",
    "active": true,
    "tosidebar": true,
    "console": false,
    "tostatus": false,
    "complete": "payload",
    "targetType": "msg",
    "statusVal": "",
    "statusType": "auto",
    "x": 1050,
    "y": 1820,
    "wires": []
  },
  {
    "id": "5664f9ca5c3ea22b",
    "type": "debug",
    "g": "849b64eb6782ebfd",
    "name": "4 · RGB feedback",
    "active": true,
    "tosidebar": true,
    "console": false,
    "tostatus": false,
    "complete": "payload",
    "targetType": "msg",
    "statusVal": "",
    "statusType": "auto",
    "x": 1050,
    "y": 1900,
    "wires": []
  },
  {
    "id": "3f5589228dc4ea40",
    "type": "debug",
    "g": "849b64eb6782ebfd",
    "name": "3 · RGB setpoint",
    "active": true,
    "tosidebar": true,
    "console": false,
    "tostatus": false,
    "complete": "payload",
    "targetType": "msg",
    "statusVal": "",
    "statusType": "auto",
    "x": 1050,
    "y": 1860,
    "wires": []
  },
  {
    "id": "be57933df7c05aba",
    "type": "debug",
    "g": "849b64eb6782ebfd",
    "name": "1 · Switch On/OFF",
    "active": true,
    "tosidebar": true,
    "console": false,
    "tostatus": false,
    "complete": "payload",
    "targetType": "msg",
    "statusVal": "",
    "statusType": "auto",
    "x": 1050,
    "y": 1780,
    "wires": []
  },
  {
    "id": "5463f2d53a202cdc",
    "type": "function",
    "g": "849b64eb6782ebfd",
    "name": "Color Cycle",
    "func": "// Cycle through colors\nlet colors = [\n    {red: 255, green: 0, blue: 0},     // Red\n    {red: 255, green: 165, blue: 0},  // Orange\n    {red: 255, green: 255, blue: 0},  // Yellow\n    {red: 0, green: 255, blue: 0},    // Green\n    {red: 0, green: 0, blue: 255},    // Blue\n    {red: 128, green: 0, blue: 128},  // Purple\n    {red: 255, green: 255, blue: 255} // White\n];\n\nlet currentIndex = context.get('colorIndex') || 0;\nlet color = colors[currentIndex];\n\n// Move to next color\ncurrentIndex = (currentIndex + 1) % colors.length;\ncontext.set('colorIndex', currentIndex);\n\n// Create message\nmsg.inputTarget = \"RGB setpoint\";\nmsg.payload = color;\n\nnode.status({\n    fill: \"yellow\",\n    shape: \"dot\", \n    text: \"Color \" + (currentIndex + 1)\n});\n\nreturn msg;",
    "outputs": 1,
    "timeout": 0,
    "noerr": 0,
    "initialize": "",
    "finalize": "",
    "libs": [],
    "x": 770,
    "y": 2100,
    "wires": [
      [
        "b7f055389ce45117"
      ]
    ]
  },
  {
    "id": "4e816f7b061bb811",
    "type": "inject",
    "g": "849b64eb6782ebfd",
    "name": "Next Color",
    "props": [],
    "repeat": "",
    "crontab": "",
    "once": false,
    "onceDelay": "0",
    "topic": "",
    "x": 520,
    "y": 2100,
    "wires": [
      [
        "5463f2d53a202cdc"
      ]
    ]
  },
  {
    "id": "e07c08ee10a3942e",
    "type": "comment",
    "g": "849b64eb6782ebfd",
    "name": "Communication RGB Dimmer",
    "info": "## RGB 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- `RGB setpoint` — command, an object {\"red\":0-255,\"green\":0-255,\"blue\":0-255}\n- `RGB feedback` — feedback, same format\n\n### Outputs\n1. Switch On/OFF · 2. Status feedback · 3. RGB setpoint · 4. RGB 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": 350,
    "y": 1720,
    "wires": []
  },
  {
    "id": "b7f055389ce45117",
    "type": "widget-RGBDimmer",
    "g": "849b64eb6782ebfd",
    "dropdownRoom": "",
    "dropdownCategory": "",
    "dropdownWidget": "",
    "displayName": "RGB Dimmer (set device)",
    "x": 800,
    "y": 1840,
    "wires": [
      [
        "be57933df7c05aba"
      ],
      [
        "21f7185db2db438e"
      ],
      [
        "3f5589228dc4ea40"
      ],
      [
        "5664f9ca5c3ea22b"
      ]
    ]
  },
  {
    "id": "a71ca5328e2da183",
    "type": "inject",
    "g": "849b64eb6782ebfd",
    "name": "ON",
    "props": [
      {
        "p": "payload"
      }
    ],
    "repeat": "",
    "crontab": "",
    "once": false,
    "onceDelay": "0",
    "topic": "",
    "payload": "true",
    "payloadType": "bool",
    "x": 250,
    "y": 1760,
    "wires": [
      [
        "03c8baaca2984935"
      ]
    ]
  },
  {
    "id": "69f425e41eb424ea",
    "type": "inject",
    "g": "849b64eb6782ebfd",
    "name": "OFF",
    "props": [
      {
        "p": "payload"
      }
    ],
    "repeat": "",
    "crontab": "",
    "once": false,
    "onceDelay": "0",
    "topic": "",
    "payload": "false",
    "payloadType": "bool",
    "x": 240,
    "y": 1800,
    "wires": [
      [
        "03c8baaca2984935"
      ]
    ]
  },
  {
    "id": "03c8baaca2984935",
    "type": "hypervisu-input-target",
    "g": "849b64eb6782ebfd",
    "selectedWidget": "7",
    "selectedInput": "Switch On/OFF",
    "displayName": "Input Target",
    "x": 520,
    "y": 1760,
    "wires": [
      [
        "b7f055389ce45117"
      ]
    ]
  },
  {
    "id": "031fdea3a47467e2",
    "type": "hypervisu-input-target",
    "g": "849b64eb6782ebfd",
    "selectedWidget": "7",
    "selectedInput": "Status feedback",
    "displayName": "Input Target",
    "x": 510,
    "y": 1840,
    "wires": [
      [
        "b7f055389ce45117"
      ]
    ]
  },
  {
    "id": "5a0fa4ca142ed9ec",
    "type": "inject",
    "g": "849b64eb6782ebfd",
    "name": "ON",
    "props": [
      {
        "p": "payload"
      }
    ],
    "repeat": "",
    "crontab": "",
    "once": false,
    "onceDelay": "0",
    "topic": "",
    "payload": "true",
    "payloadType": "bool",
    "x": 240,
    "y": 1840,
    "wires": [
      [
        "031fdea3a47467e2"
      ]
    ]
  },
  {
    "id": "63e108849b15a246",
    "type": "inject",
    "g": "849b64eb6782ebfd",
    "name": "OFF",
    "props": [
      {
        "p": "payload"
      }
    ],
    "repeat": "",
    "crontab": "",
    "once": false,
    "onceDelay": "0",
    "topic": "",
    "payload": "false",
    "payloadType": "bool",
    "x": 240,
    "y": 1880,
    "wires": [
      [
        "031fdea3a47467e2"
      ]
    ]
  },
  {
    "id": "fad8d684c47735e1",
    "type": "hypervisu-input-target",
    "g": "849b64eb6782ebfd",
    "selectedWidget": "7",
    "selectedInput": "RGB setpoint",
    "displayName": "Input Target",
    "x": 530,
    "y": 1900,
    "wires": [
      [
        "b7f055389ce45117"
      ]
    ]
  },
  {
    "id": "8c251634649cb5cb",
    "type": "hypervisu-input-target",
    "g": "849b64eb6782ebfd",
    "selectedWidget": "7",
    "selectedInput": "RGB feedback",
    "displayName": "Input Target",
    "x": 540,
    "y": 1980,
    "wires": [
      [
        "b7f055389ce45117"
      ]
    ]
  }
]