Node Red Flows

  • Hallo,

    so seit 7 Tagen bin ich auch stolzer Besitzer einiger Shellys (4x Shelly1, 2x Shelly2.5, Shelly RGBW2) und habe auch schon bissel mit Node-Red und den Shellys rumgespielt. Mit Lieferung gleich den RasperbPi 3 mit CT-SmartHome neu aufgesetzt und mal mit Node-Red angefangen.

    Habe auch hier im Forum und Lexocon einige Hilfreiche Beiträge gefunden.

    Nun zu meinem eigendlichen anliegen. Wie wäre es wenn man hier ein Unterforum einrichten würde in der User ihre Flows posten können. Vielleicht kann man so eine nette Sammlungen fertiger Flows zusammenstellen oder Tips zu Verbesserungen seines Flows sammeln ...

    Habe mir hier z.B. mal eine Treppenhaus Zeitschaltung gebstelt:

    Kurzbeschreibung

    Bei einfachen Tastendruck geht das Licht für 45s an. Drückt man den Taster lang ("longPush) wird das Licht für 120s eingeschaltet.

    Durch die Einstellungen im Shelly: Don't activate if the button long pushed... erkenn man wenn der lange Timer läuft.

    Ist das Licht eingeschaltet kann man mit erneuten betätigen auch vor ablauf der Zeit wieder ausschalten.

    Falls mal der Raspery oder WLAN ausfällt wird nach 330s (Auto-off Timer im Shelly) ausgeschaltet.

    Im Dashboard kann man die Zeiten für shortpress und longpress festlegen.


    Einstellungen im Shelly 1:

    smarthome-forum.eu/attachment/11388/

    zusätzlich habe ich den Autooff Timer im Shelly auf 330s gestellt. (falls mal der Raspery ausfällt oder so geht das Licht halt nach xxx Sekunden trotzdem aus). Der Wert sollte aber grösser sein als der eingestellte Wert für den Langen Tastendruck im Dashboard


    Node-Red Flow

    smarthome-forum.eu/attachment/11387/

    Flow für Import

    TreppenhausZeitschaltung.txt

    Benötigte Nodes:

    node-red-contrib-stoptimer-varidelay 0.4.4


    so in der Art .... oder man legt eine Art Template an das man den als User ausfüllen kann .... den hätte man einen Thread mit Thema (zb. Treppenhaus Zeitschaltung Gonzoo) und gleich eine Übersicht und den Code um mal schnell zu testen.

    Ich denke mal man findete auch in Anderen HomeAutomation Foren was aber da ich mich gerade gut 7 Tage mit den Shellys beschäftige war meine erste anlaufstelle immer diese Seite / Forum.

    der Thread "NodeRed - wie arbeitet man mit den Nodes der "node-red-contrib-shelly 1.3.4" habe ich natürlich gelesen und war auch hilfreich nur mitlerweile finde ihn den bissel unübersichtlicht.

    Gruß

    Gonzoo


  • Hi,

    eine Anmerkung zu Deiner Treppenhaus-Schaltung. Ich habe mir Varidelay nicht angeschaut. Man kommt aber da alternativ auch mit Boardmitteln aus. Der Node heisst Trigger und reagiert auf Eingangssignale.

    pasted-from-clipboard.png

    Hier mal drei Anwendungsbeispiele. Da ich keine Shellie-Nodes, sondern MQTT verwende, habe ich mal Dashboard-Schalter genommen und ein Beispiel auch für die Einbindung in MQTT:

    Code
    [{"id":"c89eb5eb.00ca4","type":"trigger","z":"4666a31.181b5dc","name":"","op1":"","op2":"false","op1type":"nul","op2type":"bool","duration":"30","extend":true,"overrideDelay":false,"units":"s","reset":"","bytopic":"all","topic":"topic","outputs":1,"x":330,"y":160,"wires":[["baff6fb7.09b53"]]},{"id":"b0bb0ea1.acc1a8","type":"ui_button","z":"4666a31.181b5dc","name":"","group":"53129805.226e7","order":0,"width":0,"height":0,"passthru":false,"label":"button","tooltip":"","color":"","bgcolor":"","icon":"","payload":"true","payloadType":"bool","topic":"","x":130,"y":200,"wires":[["c89eb5eb.00ca4","baff6fb7.09b53"]]},{"id":"baff6fb7.09b53","type":"change","z":"4666a31.181b5dc","name":"","rules":[{"t":"change","p":"payload","pt":"msg","from":"true","fromt":"bool","to":"Ein","tot":"str"},{"t":"change","p":"payload","pt":"msg","from":"false","fromt":"bool","to":"Aus","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":580,"y":200,"wires":[["df30ddd6.cf0048"]]},{"id":"df30ddd6.cf0048","type":"ui_text","z":"4666a31.181b5dc","group":"53129805.226e7","order":1,"width":0,"height":0,"name":"","label":"Status","format":"{{msg.payload}}","layout":"row-spread","x":750,"y":200,"wires":[]},{"id":"681ccb88.39b63c","type":"ui_switch","z":"4666a31.181b5dc","name":"","label":"Schalter","tooltip":"","group":"7186b8ef.3f83c8","order":0,"width":0,"height":0,"passthru":true,"decouple":"false","topic":"","style":"","onvalue":"true","onvalueType":"bool","onicon":"","oncolor":"","offvalue":"false","offvalueType":"bool","officon":"","offcolor":"","x":140,"y":300,"wires":[["98db4f0f.6ffe5"]]},{"id":"78c21256.8c3c04","type":"trigger","z":"4666a31.181b5dc","name":"","op1":"","op2":"false","op1type":"nul","op2type":"bool","duration":"30","extend":true,"overrideDelay":false,"units":"s","reset":"","bytopic":"all","topic":"topic","outputs":1,"x":730,"y":300,"wires":[["681ccb88.39b63c"]]},{"id":"98db4f0f.6ffe5","type":"switch","z":"4666a31.181b5dc","name":"","property":"payload","propertyType":"msg","rules":[{"t":"false"},{"t":"else"}],"checkall":"false","repair":false,"outputs":2,"x":290,"y":300,"wires":[["7e52a70e.8af768"],["78c21256.8c3c04"]]},{"id":"7e52a70e.8af768","type":"change","z":"4666a31.181b5dc","name":"Reset","rules":[{"t":"set","p":"reset","pt":"msg","to":"true","tot":"bool"}],"action":"","property":"","from":"","to":"","reg":false,"x":470,"y":280,"wires":[["78c21256.8c3c04"]]},{"id":"6c4bc8f4.847c38","type":"mqtt in","z":"4666a31.181b5dc","name":"Relay","topic":"/shellies/MACMACMACinput/0","qos":"2","datatype":"auto","broker":"8a487c6a.154158","x":130,"y":460,"wires":[["f40eca90.5eee58"]]},{"id":"e4c1d248.ccad1","type":"mqtt out","z":"4666a31.181b5dc","name":"Relay","topic":"/shellies/MACMACMAC/relay/0/command","qos":"","retain":"","broker":"8a487c6a.154158","x":750,"y":560,"wires":[]},{"id":"f40eca90.5eee58","type":"json","z":"4666a31.181b5dc","name":"","property":"payload","action":"obj","pretty":false,"x":250,"y":460,"wires":[["29a80aaa.67035e"]]},{"id":"d3208ed6.0f5b","type":"json","z":"4666a31.181b5dc","name":"","property":"payload","action":"","pretty":false,"x":630,"y":560,"wires":[["e4c1d248.ccad1"]]},{"id":"29a80aaa.67035e","type":"switch","z":"4666a31.181b5dc","name":"","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"0","vt":"num"},{"t":"eq","v":"1","vt":"num"}],"checkall":"false","repair":false,"outputs":2,"x":370,"y":460,"wires":[["8b53022e.059f7"],["5f86eab6.015d34"]]},{"id":"5f86eab6.015d34","type":"trigger","z":"4666a31.181b5dc","name":"","op1":"","op2":"off","op1type":"nul","op2type":"str","duration":"30","extend":true,"overrideDelay":false,"units":"s","reset":"","bytopic":"all","topic":"topic","outputs":1,"x":730,"y":460,"wires":[["d3208ed6.0f5b"]]},{"id":"8b53022e.059f7","type":"change","z":"4666a31.181b5dc","name":"Reset","rules":[{"t":"set","p":"reset","pt":"msg","to":"true","tot":"bool"}],"action":"","property":"","from":"","to":"","reg":false,"x":530,"y":420,"wires":[["5f86eab6.015d34"]]},{"id":"53129805.226e7","type":"ui_group","name":"TriggerButton","tab":"6b8a9624.e3eb38","order":1,"disp":true,"width":"6","collapse":false},{"id":"7186b8ef.3f83c8","type":"ui_group","name":"Switch","tab":"6b8a9624.e3eb38","order":2,"disp":true,"width":"6","collapse":false},{"id":"8a487c6a.154158","type":"mqtt-broker","name":"localhost","broker":"localhost","port":"1883","clientid":"","usetls":false,"compatmode":false,"keepalive":"60","cleansession":true,"birthTopic":"","birthQos":"0","birthPayload":"","closeTopic":"","closeQos":"0","closePayload":"","willTopic":"","willQos":"0","willPayload":""},{"id":"6b8a9624.e3eb38","type":"ui_tab","name":"Test","icon":"dashboard","disabled":false,"hidden":false}]

    Inventar: Node-Red (Master, Docker-basiert) mit RFXCom Transceiver u.a. für Somfy

    Raspberry-Matic Zentrale mit ca. 65 Aktoren/Sensoren/Schalter

    Mosqitto MQTT-Broker (Docker-basiert) für u.a. 3*Shelly 2.5, 1*Shelly RGBW2, 4*Shelly 1, 2*Shellybutton 1, 3*Shelly HT, 2* Shelly Door Window 2, 5*Shelly Vintage, Octoprint

    InfluxDB und Grafana (beides Docker-basiert)