[{"id":"abe0cd5c.e4eb6","type":"template","z":"e33ba1b1.d4532","name":"","field":"payload","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"put:/homeegrams/585/actions/1539?message={{payload}}","output":"str","x":960,"y":80,"wires":[["639fad52.c9ee84"]]},{"id":"639fad52.c9ee84","type":"link out","z":"e33ba1b1.d4532","name":"","links":["b0803220.40bed"],"x":1100,"y":80,"wires":[]},{"id":"f9934298.666fd","type":"delay","z":"e33ba1b1.d4532","name":"","pauseType":"delay","timeout":"2","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":920,"y":40,"wires":[["70933105.d6b9c"]]},{"id":"70933105.d6b9c","type":"template","z":"e33ba1b1.d4532","name":"","field":"payload","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"put:/homeegrams/585?play=1","output":"str","x":1080,"y":40,"wires":[["639fad52.c9ee84"]]},{"id":"5a033afd.574fd4","type":"link in","z":"e33ba1b1.d4532","name":"","links":["1771ce71.325312"],"x":315,"y":20,"wires":[["9b6ffccc.91e0b"]]},{"id":"9b6ffccc.91e0b","type":"function","z":"e33ba1b1.d4532","name":"nicht Verfügbar","func":"const nodes = global.get('homee.nodes');\nvar zaehlerein = 0;\nvar zaehleraus = 0;\nvar zaehler3=0;\nvar nichterreichbar=\"\";\nvar aktualisiert = \"\";\ntest =nodes;\nif((msg.payload.node && ((msg.payload.node.state === 2)||(msg.payload.node.state ===12)))||msg.payload === true){\ntest.forEach(function(id){\n name = id.name;\n komponente = decodeURIComponent(name);\n test1 = id.state;\nif(test1 === 1 ) {zaehlerein++}\nif(test1 === 2 ) {if(nichterreichbar.length > 1 ){nichterreichbar =nichterreichbar + \"und\"}nichterreichbar = nichterreichbar +\" \"+ komponente+\" \";zaehleraus++}\nif(test1 === 12 ){if(aktualisiert.length > 1 ){aktualisiert =aktualisiert + \"und\"}aktualisiert = aktualisiert +\" \"+ komponente+\" \";zaehler3++}\n \n})\nnode.status({fill:\"green\",shape:\"ring\",text:`Verfügbar: ${zaehlerein} nicht Verfügbar:${zaehleraus}`})\nif(zaehleraus === 1){erreichger = \"Gerät ist nicht erreichbar\"} else erreichger = \"Geräte sind nicht erreichbar\";\nif(zaehler3 === 1){aktualger = \"Gerät wird aktualisiert\"} else aktualger = \"Geräte werden aktualisiert\";\nreturn{\"payload\":`${zaehleraus} ${erreichger} - ${nichterreichbar} und ${zaehler3} ${aktualger} - ${aktualisiert}`,\"Nicht Verfügbar\":{\"Anzahl\":zaehleraus,\"Geraete\":nichterreichbar}}\n}","outputs":1,"noerr":0,"x":540,"y":20,"wires":[["f9934298.666fd","abe0cd5c.e4eb6"]]}]
Hier der Flow für Node Red dafür.
eine Erklärung werde ich dazu mal im Video zeigen.
Muss erstmal meinen homee nach dem versuchten update auf 2.28.1 zum leben erwecken.