Aktion erst ausführen wenn mehrere Bedingungen erfüllt sind

Node-RED als CCU3/RaspberryMatic Addon, WebApp, HomeKit, ...

Moderator: Co-Administratoren

Antworten
Maxvil
Beiträge: 23
Registriert: 03.10.2017, 11:27

Aktion erst ausführen wenn mehrere Bedingungen erfüllt sind

Beitrag von Maxvil » 13.07.2019, 13:42

Hallo zusammen,
ich bin in den letzten Tagen auf RedMatic gestoßen und versuche mich gerade hier einzuarbeiten. Einige Flows habe ich auch erfolgreich von den CCU Programmen übertragen. Jetzt komme ich aber grad nicht weiter.
Ich möchte folgendes erreichen:

Eine CCU Variable (Typ Logikwert) soll, wenn irgendein Fenster geöffnet wird auf "WAHR" gesetzt werden. Das habe ich hinbekommen.
Jetzt soll die gleiche Variable aber erst auf "FALSCH" gesetzt werden, wenn ALLE 4 Fenster (HM-Sec-SC-2) geschlossen wurden.

Den Flow habe ich direkt mit angehängt.

Code: Alles auswählen

[{"id":"d5c4b295.0de98","type":"tab","label":"Fesnter geschlossen","disabled":false,"info":""},{"id":"a4e7f928.937608","type":"ccu-rpc-event","z":"d5c4b295.0de98","name":"TFK Fenster Hobbyraum hinten links","iface":"","ccuConfig":"38263145.35ea0e","rooms":"","roomsRx":"str","functions":"","functionsRx":"str","device":"","deviceRx":"str","deviceName":"","deviceNameRx":"str","deviceType":"","deviceTypeRx":"str","channel":"","channelRx":"str","channelName":"TFK Hobby Dachfenster hinten links","channelNameRx":"str","channelType":"","channelTypeRx":"str","channelIndex":"","channelIndexRx":"str","datapoint":"","datapointRx":"str","change":false,"working":false,"cache":false,"topic":"${CCU}/${Interface}/${channelName}/${datapoint}","x":260,"y":160,"wires":[["fb69cca0.fdeb9"]]},{"id":"4950a438.ab825c","type":"ccu-rpc-event","z":"d5c4b295.0de98","name":"TFK Fenster Hobbyraum hinten rechts","iface":"","ccuConfig":"38263145.35ea0e","rooms":"","roomsRx":"str","functions":"","functionsRx":"str","device":"","deviceRx":"str","deviceName":"","deviceNameRx":"str","deviceType":"","deviceTypeRx":"str","channel":"","channelRx":"str","channelName":"TFK Hobby Dachfenster hinten rechts","channelNameRx":"str","channelType":"","channelTypeRx":"str","channelIndex":"","channelIndexRx":"str","datapoint":"","datapointRx":"str","change":false,"working":false,"cache":false,"topic":"${CCU}/${Interface}/${channelName}/${datapoint}","x":270,"y":220,"wires":[["fb69cca0.fdeb9"]]},{"id":"aed66f16.a853f","type":"ccu-rpc-event","z":"d5c4b295.0de98","name":"TFK Fenster Hobbyraum vorne links","iface":"","ccuConfig":"38263145.35ea0e","rooms":"","roomsRx":"str","functions":"","functionsRx":"str","device":"","deviceRx":"str","deviceName":"","deviceNameRx":"str","deviceType":"","deviceTypeRx":"str","channel":"","channelRx":"str","channelName":"TFK Hobby Dachfenster vorne links","channelNameRx":"str","channelType":"","channelTypeRx":"str","channelIndex":"","channelIndexRx":"str","datapoint":"","datapointRx":"str","change":false,"working":false,"cache":false,"topic":"${CCU}/${Interface}/${channelName}/${datapoint}","x":260,"y":280,"wires":[["fb69cca0.fdeb9"]]},{"id":"224fbcc.4261044","type":"ccu-rpc-event","z":"d5c4b295.0de98","name":"TFK Fenster Hobbyraum vorne rechts","iface":"","ccuConfig":"38263145.35ea0e","rooms":"","roomsRx":"str","functions":"","functionsRx":"str","device":"","deviceRx":"str","deviceName":"","deviceNameRx":"str","deviceType":"","deviceTypeRx":"str","channel":"","channelRx":"str","channelName":"TFK Hobby Dachfenster vorne rechts","channelNameRx":"str","channelType":"","channelTypeRx":"str","channelIndex":"","channelIndexRx":"str","datapoint":"","datapointRx":"str","change":false,"working":false,"cache":false,"topic":"${CCU}/${Interface}/${channelName}/${datapoint}","x":270,"y":340,"wires":[["fb69cca0.fdeb9"]]},{"id":"fb69cca0.fdeb9","type":"ccu-sysvar","z":"d5c4b295.0de98","name":"Fenster Dach Hobby auf oder zu","ccuConfig":"38263145.35ea0e","topic":"ReGaHSS/${Name}","change":true,"cache":true,"x":1390,"y":240,"wires":[[]]},{"id":"79674274.e651bc","type":"comment","z":"d5c4b295.0de98","name":"4 HM Tür & Fensterkontakte (HM-Sec-SC-2)","info":"","x":250,"y":100,"wires":[]},{"id":"661e90a6.bcee","type":"comment","z":"d5c4b295.0de98","name":"Systemvariable soll auf \"WAHR\" gesetzt werden wenn irgendein Fenster offen ist","info":"","x":1380,"y":160,"wires":[]},{"id":"2dc5aa45.ade0d6","type":"comment","z":"d5c4b295.0de98","name":"Systemvariable soll auf \"FALSCH\" gesetzt werden wenn ALLE Fenster geschlossen sind","info":"","x":1400,"y":460,"wires":[]},{"id":"cef203a8.b76b2","type":"ccu-sysvar","z":"d5c4b295.0de98","name":"Fenster Dach Hobby auf oder zu","ccuConfig":"38263145.35ea0e","topic":"ReGaHSS/${Name}","change":true,"cache":true,"x":1410,"y":560,"wires":[[]]},{"id":"4211152f.da31fc","type":"ccu-rpc-event","z":"d5c4b295.0de98","name":"TFK Fenster Hobbyraum hinten links","iface":"","ccuConfig":"38263145.35ea0e","rooms":"","roomsRx":"str","functions":"","functionsRx":"str","device":"","deviceRx":"str","deviceName":"","deviceNameRx":"str","deviceType":"","deviceTypeRx":"str","channel":"","channelRx":"str","channelName":"TFK Hobby Dachfenster hinten links","channelNameRx":"str","channelType":"","channelTypeRx":"str","channelIndex":"","channelIndexRx":"str","datapoint":"","datapointRx":"str","change":false,"working":false,"cache":false,"topic":"${CCU}/${Interface}/${channelName}/${datapoint}","x":260,"y":480,"wires":[[]]},{"id":"bac9f770.3aa4a8","type":"ccu-rpc-event","z":"d5c4b295.0de98","name":"TFK Fenster Hobbyraum hinten rechts","iface":"","ccuConfig":"38263145.35ea0e","rooms":"","roomsRx":"str","functions":"","functionsRx":"str","device":"","deviceRx":"str","deviceName":"","deviceNameRx":"str","deviceType":"","deviceTypeRx":"str","channel":"","channelRx":"str","channelName":"TFK Hobby Dachfenster hinten rechts","channelNameRx":"str","channelType":"","channelTypeRx":"str","channelIndex":"","channelIndexRx":"str","datapoint":"","datapointRx":"str","change":false,"working":false,"cache":false,"topic":"${CCU}/${Interface}/${channelName}/${datapoint}","x":270,"y":540,"wires":[[]]},{"id":"a14eb6b3.8b02a8","type":"ccu-rpc-event","z":"d5c4b295.0de98","name":"TFK Fenster Hobbyraum vorne links","iface":"","ccuConfig":"38263145.35ea0e","rooms":"","roomsRx":"str","functions":"","functionsRx":"str","device":"","deviceRx":"str","deviceName":"","deviceNameRx":"str","deviceType":"","deviceTypeRx":"str","channel":"","channelRx":"str","channelName":"TFK Hobby Dachfenster vorne links","channelNameRx":"str","channelType":"","channelTypeRx":"str","channelIndex":"","channelIndexRx":"str","datapoint":"","datapointRx":"str","change":false,"working":false,"cache":false,"topic":"${CCU}/${Interface}/${channelName}/${datapoint}","x":260,"y":600,"wires":[[]]},{"id":"7d44c8ce.09c528","type":"ccu-rpc-event","z":"d5c4b295.0de98","name":"TFK Fenster Hobbyraum vorne rechts","iface":"","ccuConfig":"38263145.35ea0e","rooms":"","roomsRx":"str","functions":"","functionsRx":"str","device":"","deviceRx":"str","deviceName":"","deviceNameRx":"str","deviceType":"","deviceTypeRx":"str","channel":"","channelRx":"str","channelName":"TFK Hobby Dachfenster vorne rechts","channelNameRx":"str","channelType":"","channelTypeRx":"str","channelIndex":"","channelIndexRx":"str","datapoint":"","datapointRx":"str","change":false,"working":false,"cache":false,"topic":"${CCU}/${Interface}/${channelName}/${datapoint}","x":270,"y":660,"wires":[[]]},{"id":"38263145.35ea0e","type":"ccu-connection","z":"","name":"localhost","host":"localhost","regaEnabled":true,"bcrfEnabled":true,"iprfEnabled":true,"virtEnabled":true,"bcwiEnabled":false,"cuxdEnabled":true,"regaPoll":true,"regaInterval":"30","rpcPingTimeout":"60","rpcInitAddress":"127.0.0.1","rpcServerHost":"127.0.0.1","rpcBinPort":"2047","rpcXmlPort":"2048","queueTimeout":"5000","queuePause":"250","contextStore":""}]
Wie kann ich also in RedMatic die Variable erst auf "FALSCH" setzen wenn alle 4 Fenster geschlossen wurden?

Danke und LG
Marcus
444 Kanäle in 116 Geräten:

Maxvil
Beiträge: 23
Registriert: 03.10.2017, 11:27

Re: Aktion erst ausführen wenn mehrere Bedingungen erfüllt sind

Beitrag von Maxvil » 13.07.2019, 14:41

So hab noch ein wenig weiter getüftelt. Vorläufig habe ich es über den Statistic Knoten zum laufen gebracht.

Der zählt die geöffneten und geschlossenen Fenster. Je nach Wert

bei == 0 schreibt er die Variable auf Falsch

bei >=1 schreibt er die Variable auf Wahr

Hier nochmal der geänderte Flow.

Code: Alles auswählen

[{"id":"d5c4b295.0de98","type":"tab","label":"Fesnter geschlossen","disabled":false,"info":""},{"id":"79674274.e651bc","type":"comment","z":"d5c4b295.0de98","name":"Hobby Dachfenster auf oder zu","info":"","x":190,"y":60,"wires":[]},{"id":"661e90a6.bcee","type":"comment","z":"d5c4b295.0de98","name":"Systemvariable wird auf \"WAHR\" gesetzt werden wenn irgendein Fenster offen ist","info":"","x":960,"y":320,"wires":[]},{"id":"2dc5aa45.ade0d6","type":"comment","z":"d5c4b295.0de98","name":"Systemvariable wird auf \"FALSCH\" gesetzt werden wenn ALLE Fenster geschlossen sind","info":"","x":970,"y":80,"wires":[]},{"id":"cef203a8.b76b2","type":"ccu-sysvar","z":"d5c4b295.0de98","name":"Fenster Dach Hobby auf oder zu","ccuConfig":"38263145.35ea0e","topic":"ReGaHSS/${Name}","change":true,"cache":true,"x":1290,"y":200,"wires":[[]]},{"id":"4211152f.da31fc","type":"ccu-rpc-event","z":"d5c4b295.0de98","name":"TFK Fenster Hobbyraum hinten links","iface":"","ccuConfig":"38263145.35ea0e","rooms":"","roomsRx":"str","functions":"","functionsRx":"str","device":"","deviceRx":"str","deviceName":"","deviceNameRx":"str","deviceType":"","deviceTypeRx":"str","channel":"","channelRx":"str","channelName":"TFK Hobby Dachfenster hinten links","channelNameRx":"str","channelType":"","channelTypeRx":"str","channelIndex":"","channelIndexRx":"str","datapoint":"","datapointRx":"str","change":true,"working":false,"cache":true,"topic":"${CCU}/${Interface}/${channelName}/${datapoint}","x":200,"y":120,"wires":[["60266a53.d501f4"]]},{"id":"bac9f770.3aa4a8","type":"ccu-rpc-event","z":"d5c4b295.0de98","name":"TFK Fenster Hobbyraum hinten rechts","iface":"","ccuConfig":"38263145.35ea0e","rooms":"","roomsRx":"str","functions":"","functionsRx":"str","device":"","deviceRx":"str","deviceName":"","deviceNameRx":"str","deviceType":"","deviceTypeRx":"str","channel":"","channelRx":"str","channelName":"TFK Hobby Dachfenster hinten rechts","channelNameRx":"str","channelType":"","channelTypeRx":"str","channelIndex":"","channelIndexRx":"str","datapoint":"","datapointRx":"str","change":true,"working":false,"cache":true,"topic":"${CCU}/${Interface}/${channelName}/${datapoint}","x":210.00008010864258,"y":179.99997329711914,"wires":[["60266a53.d501f4"]]},{"id":"a14eb6b3.8b02a8","type":"ccu-rpc-event","z":"d5c4b295.0de98","name":"TFK Fenster Hobbyraum vorne links","iface":"","ccuConfig":"38263145.35ea0e","rooms":"","roomsRx":"str","functions":"","functionsRx":"str","device":"","deviceRx":"str","deviceName":"","deviceNameRx":"str","deviceType":"","deviceTypeRx":"str","channel":"","channelRx":"str","channelName":"TFK Hobby Dachfenster vorne links","channelNameRx":"str","channelType":"","channelTypeRx":"str","channelIndex":"","channelIndexRx":"str","datapoint":"","datapointRx":"str","change":true,"working":false,"cache":true,"topic":"${CCU}/${Interface}/${channelName}/${datapoint}","x":200.00008010864258,"y":239.99997329711914,"wires":[["60266a53.d501f4"]]},{"id":"7d44c8ce.09c528","type":"ccu-rpc-event","z":"d5c4b295.0de98","name":"TFK Fenster Hobbyraum vorne rechts","iface":"","ccuConfig":"38263145.35ea0e","rooms":"","roomsRx":"str","functions":"","functionsRx":"str","device":"","deviceRx":"str","deviceName":"","deviceNameRx":"str","deviceType":"","deviceTypeRx":"str","channel":"","channelRx":"str","channelName":"TFK Hobby Dachfenster vorne rechts","channelNameRx":"str","channelType":"","channelTypeRx":"str","channelIndex":"","channelIndexRx":"str","datapoint":"","datapointRx":"str","change":true,"working":false,"cache":true,"topic":"${CCU}/${Interface}/${channelName}/${datapoint}","x":212.85722732543945,"y":302.85708808898926,"wires":[["60266a53.d501f4"]]},{"id":"60266a53.d501f4","type":"combine-statistic","z":"d5c4b295.0de98","name":"","topic":"","operator":"sum","falsy":"include","defer":250,"timeout":0,"distinction":"topic","x":560,"y":200,"wires":[["e2ed8f2f.817d6"]]},{"id":"e2ed8f2f.817d6","type":"switch","z":"d5c4b295.0de98","name":"sum","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"0","vt":"num"},{"t":"gte","v":"1","vt":"num"}],"checkall":"true","repair":false,"outputs":2,"x":730,"y":200,"wires":[["dc69bfe6.eca32"],["6df63f73.8e645"]]},{"id":"6df63f73.8e645","type":"change","z":"d5c4b295.0de98","name":"Fenster offen","rules":[{"t":"set","p":"payload","pt":"msg","to":"true","tot":"bool"}],"action":"","property":"","from":"","to":"","reg":false,"x":950,"y":260,"wires":[["cef203a8.b76b2"]]},{"id":"dc69bfe6.eca32","type":"change","z":"d5c4b295.0de98","name":"Fenster geschlossen","rules":[{"t":"set","p":"payload","pt":"msg","to":"false","tot":"bool"}],"action":"","property":"","from":"","to":"","reg":false,"x":940,"y":140,"wires":[["cef203a8.b76b2"]]},{"id":"38263145.35ea0e","type":"ccu-connection","z":"","name":"localhost","host":"localhost","regaEnabled":true,"bcrfEnabled":true,"iprfEnabled":true,"virtEnabled":true,"bcwiEnabled":false,"cuxdEnabled":true,"regaPoll":true,"regaInterval":"30","rpcPingTimeout":"60","rpcInitAddress":"127.0.0.1","rpcServerHost":"127.0.0.1","rpcBinPort":"2047","rpcXmlPort":"2048","queueTimeout":"5000","queuePause":"250","contextStore":""}]
Falls jemand von euch eine bessere Variante kennt würde ich mich freuen wenn ihr mir die mitteilen könntet.

Danke und LG
Marcus
444 Kanäle in 116 Geräten:

Antworten

Zurück zu „RedMatic“