@alex1986 Im Prinzip musst Du halt beim Initialisieren mal entscheiden, was - wenn NR neu gestartet wurde - beim 1. Mal Glastaster drücken passieren soll. Wenn mal eine Richtung feststeht, dann ist es easy das wieder umzustellen.
Nehmen wir mal an Du initialisiert grundsätzlich am Anfang den letzten Zustand als runter fahren, dann würde es beim nächsten Mal hochfahren. Da es praktisch ist sowas mit booleschen Variablen zu machen, würde es so aussehen:
Hier mal das Beispiel, wie man mit einer Flowvariablen einen Toogle Switch implementiert:
3ee62472-5316-436e-83a1-222ee05020e9-image.png
Spoiler
[
{
"id": "504b8c47.572874",
"type": "inject",
"z": "54b226bc.0793e8",
"name": "",
"props": [
{
"p": "payload"
},
{
"p": "topic",
"vt": "str"
}
],
"repeat": "",
"crontab": "",
"once": true,
"onceDelay": 0.1,
"topic": "runter",
"payload": "true",
"payloadType": "bool",
"x": 470,
"y": 3040,
"wires": [
[
"1ca043ed.a3177c"
]
]
},
{
"id": "1ca043ed.a3177c",
"type": "change",
"z": "54b226bc.0793e8",
"name": "",
"rules": [
{
"t": "set",
"p": "JalousieRunter",
"pt": "flow",
"to": "payload",
"tot": "msg"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 700,
"y": 3040,
"wires": [
[]
]
},
{
"id": "891061ad.a031a",
"type": "inject",
"z": "54b226bc.0793e8",
"name": "beliebiger Trigger (toogle)",
"props": [
{
"p": "payload"
},
{
"p": "topic",
"vt": "str"
}
],
"repeat": "",
"crontab": "",
"once": false,
"onceDelay": 0.1,
"topic": "",
"payload": "",
"payloadType": "date",
"x": 410,
"y": 3140,
"wires": [
[
"76f8af8f.f3d4"
]
]
},
{
"id": "76f8af8f.f3d4",
"type": "change",
"z": "54b226bc.0793e8",
"name": "hole voherigen Zustand",
"rules": [
{
"t": "set",
"p": "payload",
"pt": "msg",
"to": "JalousieRunter",
"tot": "flow"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 690,
"y": 3140,
"wires": [
[
"bfdf5e68.b1959"
]
]
},
{
"id": "ebd3e8c8.b704d8",
"type": "debug",
"z": "54b226bc.0793e8",
"name": "Aktion",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "payload",
"targetType": "msg",
"statusVal": "",
"statusType": "auto",
"x": 1110,
"y": 3180,
"wires": []
},
{
"id": "bfdf5e68.b1959",
"type": "change",
"z": "54b226bc.0793e8",
"name": "setze Gegenteil",
"rules": [
{
"t": "set",
"p": "payload",
"pt": "msg",
"to": "$not(payload)",
"tot": "jsonata"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 920,
"y": 3140,
"wires": [
[
"bbc264dc.3b1728",
"ebd3e8c8.b704d8"
]
]
},
{
"id": "bbc264dc.3b1728",
"type": "change",
"z": "54b226bc.0793e8",
"name": "speichere neuen Zustand in flow",
"rules": [
{
"t": "set",
"p": "JalousieRunter",
"pt": "flow",
"to": "payload",
"tot": "msg"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 1190,
"y": 3100,
"wires": [
[]
]
}
]
Den Inhalt Deiner Flowvariablen siehst Du im Kontextmenü (aktualisieren):
0630361e-e284-4adf-bbfc-6da24dc4d19b-image.png