[{"id":"6214e953.18aab8","type":"function","z":"8e420576.72ba58","name":"Attribut current_value","func":"const attributes = global.get('homee.attributes');\nmsg = {payload: (attributes.find(attribute => attribute.id === 348)).current_value }\nreturn msg","outputs":1,"noerr":0,"x":620,"y":1100,"wires":[["e95b4b91.329378"]]},{"id":"333628a2.c5f3a8","type":"inject","z":"8e420576.72ba58","name":"","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":440,"y":1100,"wires":[["6214e953.18aab8"]]},{"id":"e95b4b91.329378","type":"debug","z":"8e420576.72ba58","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":810,"y":1100,"wires":[]}]
Leider war ich beim switch node etwas auf dem Holzweg.
Daher hier eine Funktion zur Suche des eines Attributes und zur Ausgabe des current_value.
Hier eine Alternative Funktion als Switch Node.
[{"id":"6214e953.18aab8","type":"function","z":"8e420576.72ba58","name":"Attribut current_value","func":"const attributes = global.get('homee.attributes');\nif((attributes.find(attribute => attribute.id === 348)).current_value === 0){return msg}","outputs":1,"noerr":0,"x":620,"y":1100,"wires":[["e95b4b91.329378"]]},{"id":"333628a2.c5f3a8","type":"inject","z":"8e420576.72ba58","name":"","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":440,"y":1100,"wires":[["6214e953.18aab8"]]},{"id":"e95b4b91.329378","type":"debug","z":"8e420576.72ba58","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":810,"y":1100,"wires":[]}]
Du musst nur die Attribut ID und den value eintragen und schon werden nur die Nachrichten durchgelassen wenn deine Vorgabe wahr ist.
VG