[
 {
  "id": "t1",
  "type": "tab",
  "label": "0-10V Einspeisung"
 },
 {
  "id": "in1",
  "type": "smartpi-input",
  "z": "t1",
  "name": "Leistung",
  "indicator": "p",
  "usetrigger": false,
  "x": 130,
  "y": 120,
  "wires": [
   [
    "fn1",
    "dbg1"
   ]
  ]
 },
 {
  "id": "fn1",
  "type": "function",
  "z": "t1",
  "name": "Einspeisung → 0-10V",
  "func": "// Leistung in W (Einspeisung negativ)\nconst p = msg.payload;\n\nif (p >= 0) {\n    // keine Einspeisung -> 0 V\n    msg.payload = 0;\n} else {\n    // 8000 W Einspeisung -> 10 V\n    msg.payload = Math.min(-p / 8000 * 10, 10);\n}\nreturn msg;",
  "outputs": 1,
  "x": 330,
  "y": 120,
  "wires": [
   [
    "ao1",
    "dbg2"
   ]
  ]
 },
 {
  "id": "ao1",
  "type": "smartpi-e.analog-out-010v",
  "z": "t1",
  "name": "Einspeisung",
  "address": "0x60",
  "channel": "1",
  "server": "http://127.0.0.1:1080",
  "readonly": false,
  "persist": false,
  "x": 540,
  "y": 120,
  "wires": [
   [
    "dbg3"
   ]
  ]
 },
 {
  "id": "dbg1",
  "type": "debug",
  "z": "t1",
  "name": "Leistung (W)",
  "active": true,
  "complete": "payload",
  "x": 330,
  "y": 200,
  "wires": []
 },
 {
  "id": "dbg2",
  "type": "debug",
  "z": "t1",
  "name": "Sollwert (V)",
  "active": true,
  "complete": "payload",
  "x": 540,
  "y": 200,
  "wires": []
 },
 {
  "id": "dbg3",
  "type": "debug",
  "z": "t1",
  "name": "Modul (V)",
  "active": true,
  "complete": "payload",
  "x": 760,
  "y": 120,
  "wires": []
 }
]