Die Werte kommen von einem Device was bei Iobroker über den Zigbee Adapter verbunden ist.
Ich habe es jetzt mit einem neuen Flow und mit einfachen mitteln getestet und habe es hinbekommen Meine gewünschte Funktion ist da, kannst ja mal drüber schauen Danke!!!
[
{
"id": "0331d71a0156cca2",
"type": "tab",
"label": "Flow 1",
"disabled": false,
"info": "",
"env": []
},
{
"id": "c593fa8ed6d159ad",
"type": "inject",
"z": "0331d71a0156cca2",
"name": "",
"props": [
{
"p": "payload"
}
],
"repeat": "",
"crontab": "",
"once": false,
"onceDelay": 0.1,
"topic": "",
"payload": "10",
"payloadType": "num",
"x": 190,
"y": 80,
"wires": [
[
"f674129b675fe767"
]
]
},
{
"id": "819cbff5dcea3d1d",
"type": "inject",
"z": "0331d71a0156cca2",
"name": "",
"props": [
{
"p": "payload"
}
],
"repeat": "",
"crontab": "",
"once": false,
"onceDelay": 0.1,
"topic": "",
"payload": "20",
"payloadType": "num",
"x": 190,
"y": 160,
"wires": [
[
"9689a488f5d352c2"
]
]
},
{
"id": "f674129b675fe767",
"type": "function",
"z": "0331d71a0156cca2",
"name": "A",
"func": "flow.set(\"A\", msg.payload);\n\nvar A = flow.get(\"A\") || 0;\n\nreturn msg;",
"outputs": 1,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 390,
"y": 80,
"wires": [
[
"f9c71b2360065af5"
]
]
},
{
"id": "9689a488f5d352c2",
"type": "function",
"z": "0331d71a0156cca2",
"name": "B",
"func": "flow.set(\"B\", msg.payload);\n\nvar B = flow.get(\"B\") || 0;\n\nreturn msg;",
"outputs": 1,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 390,
"y": 160,
"wires": [
[
"f9c71b2360065af5"
]
]
},
{
"id": "f9c71b2360065af5",
"type": "debug",
"z": "0331d71a0156cca2",
"name": "debug 24",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "payload",
"targetType": "msg",
"statusVal": "",
"statusType": "auto",
"x": 560,
"y": 120,
"wires": []
},
{
"id": "7bf852c0ae949147",
"type": "function",
"z": "0331d71a0156cca2",
"name": "Vergleichen / Bedinungen",
"func": "var A = flow.get(\"A\") || 0;\nvar B = flow.get(\"B\") || 0;\n\n\nif (B < 5) {\n B = 0\n}\nelse if (B > 5 && A > 5) {\n B = 1\n}\n\n\nmsg.payload = {\"attribute\":{\"id\":1111, \"value\": B}};\nreturn msg;",
"outputs": 1,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 350,
"y": 300,
"wires": [
[
"c0871a0fe0812e08"
]
]
},
{
"id": "c0871a0fe0812e08",
"type": "debug",
"z": "0331d71a0156cca2",
"name": "debug 25",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "payload",
"targetType": "msg",
"statusVal": "",
"statusType": "auto",
"x": 560,
"y": 300,
"wires": []
},
{
"id": "3a5037c6af7a4bb0",
"type": "comment",
"z": "0331d71a0156cca2",
"name": "Variablen anlegen",
"info": "",
"x": 290,
"y": 40,
"wires": []
},
{
"id": "3b1326057444cc0c",
"type": "inject",
"z": "0331d71a0156cca2",
"name": "",
"props": [],
"repeat": "",
"crontab": "",
"once": false,
"onceDelay": 0.1,
"topic": "",
"x": 150,
"y": 300,
"wires": [
[
"7bf852c0ae949147"
]
]
},
{
"id": "d39eedcee0ef670e",
"type": "comment",
"z": "0331d71a0156cca2",
"name": "Variablen - Bedinungen mit einer Zahl",
"info": "",
"x": 330,
"y": 260,
"wires": []
}
]