[
  {
    "id": "edgelor-second",
    "type": "tab",
    "label": "EDGELOR second learning flow",
    "disabled": false,
    "info": "Synthetic values only. No physical input, output, network service or credentials."
  },
  {
    "id": "edg2-inject",
    "type": "inject",
    "z": "edgelor-second",
    "name": "Raw value",
    "props": [
      {
        "p": "payload"
      },
      {
        "p": "topic",
        "vt": "str"
      }
    ],
    "repeat": "",
    "crontab": "",
    "once": false,
    "onceDelay": 0.1,
    "topic": "",
    "payload": "255",
    "payloadType": "num",
    "x": 140,
    "y": 120,
    "wires": [
      [
        "edg2-scale"
      ]
    ]
  },
  {
    "id": "edg2-scale",
    "type": "function",
    "z": "edgelor-second",
    "name": "Scale and validate",
    "func": "const raw = Number(msg.payload);\nif (String(msg.payload).trim() === \"\" || !Number.isFinite(raw)) {\n  node.error(\"Invalid raw value\", msg);\n  return null;\n}\nmsg.payload = { temperature: raw / 10, unit: \"\u00b0C\" };\nreturn msg;",
    "outputs": 1,
    "noerr": 0,
    "initialize": "",
    "finalize": "",
    "libs": [],
    "x": 340,
    "y": 120,
    "wires": [
      [
        "edg2-switch"
      ]
    ]
  },
  {
    "id": "edg2-switch",
    "type": "switch",
    "z": "edgelor-second",
    "name": "Temperature >= 30",
    "property": "payload.temperature",
    "propertyType": "msg",
    "rules": [
      {
        "t": "gte",
        "v": "30",
        "vt": "num"
      },
      {
        "t": "else"
      }
    ],
    "checkall": "true",
    "repair": false,
    "outputs": 2,
    "x": 570,
    "y": 120,
    "wires": [
      [
        "edg2-high"
      ],
      [
        "edg2-normal"
      ]
    ]
  },
  {
    "id": "edg2-high",
    "type": "debug",
    "z": "edgelor-second",
    "name": "High",
    "active": true,
    "tosidebar": true,
    "console": false,
    "tostatus": false,
    "complete": "payload",
    "targetType": "msg",
    "x": 790,
    "y": 100,
    "wires": []
  },
  {
    "id": "edg2-normal",
    "type": "debug",
    "z": "edgelor-second",
    "name": "Normal",
    "active": true,
    "tosidebar": true,
    "console": false,
    "tostatus": false,
    "complete": "payload",
    "targetType": "msg",
    "x": 790,
    "y": 160,
    "wires": []
  },
  {
    "id": "edg2-catch",
    "type": "catch",
    "z": "edgelor-second",
    "name": "Invalid value",
    "scope": [
      "edg2-scale"
    ],
    "uncaught": false,
    "x": 350,
    "y": 260,
    "wires": [
      [
        "edg2-error"
      ]
    ]
  },
  {
    "id": "edg2-error",
    "type": "debug",
    "z": "edgelor-second",
    "name": "Validation error",
    "active": true,
    "tosidebar": true,
    "console": false,
    "tostatus": false,
    "complete": "payload",
    "targetType": "msg",
    "x": 600,
    "y": 260,
    "wires": []
  }
]
