homee-dimmen-mit-FT55

Mit diesen Flow kannst du direkt mit dem FT55 Taster (Enocean) hoch- und runterdimmen. Ich habe dazu einen Fibaro UP Dimmer(Zwave) benutzt.

[{"id":"3920d1ac.d85bde","type":"function","z":"eeb0b50.5800748","name":"Dimmer","func":"var nodeid = 0; // die node ID vom Dimmer in homee\nvar attributid =0; // die attribut id des Dimmer in homee\nvar Dimmer = global.get('Dimmer');\nvar count1 = msg.payload;\nvar count = context.get('count')||0;\n\n\nglobal.set ('dimmcounter',count);\nif( count > 100){count = 98}\nif(count < 4){count=4} \ncount += count1;\ncontext.set('count',count);\nif (msg.payload && Dimmer === 1) \n// im nächsten Schritt wird der Wert an homee gesendet \n{ \n    return {payload: \"PUT:/nodes/\"+nodeid+\"/attributes/\"+attributid+\"/?target_value=\"+ JSON.stringify(count)}\n    \n}\n","outputs":1,"noerr":0,"x":1040,"y":400,"wires":[["ed4c66fe.e21fd8","73cacf2e.26bc2"]]},{"id":"a0320438.a78328","type":"function","z":"eeb0b50.5800748","name":"Status Taster und Dimmer abrufen","func":"var StatusTaster = global.get('StatusTaster');\nvar Dimmer = global.get('Dimmer');\nif (StatusTaster === 1 && Dimmer === 1)\n{return {payload: -2}} // die -2 ist der Wert um wieviel runtergedimmt wird\nif (StatusTaster === 2 && Dimmer === 1)\n{return {payload: 2}} // die 2 ist der Wert um wieviel hochgedimmt wird\n","outputs":1,"noerr":0,"x":720,"y":400,"wires":[["3920d1ac.d85bde","191d71b.6ad428e"]]},{"id":"f123b23.d88f45","type":"function","z":"eeb0b50.5800748","name":"Status des Tasters speichern","func":"global.set ('StatusTaster',msg.payload)\nif (msg.payload === 0 )\n{ global.set ('Dimmer',0)}","outputs":1,"noerr":0,"x":700,"y":360,"wires":[[]]},{"id":"191d71b.6ad428e","type":"delay","z":"eeb0b50.5800748","name":"Dimmgeschwindigkeit","pauseType":"delayv","timeout":"300","timeoutUnits":"milliseconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"milliseconds","drop":false,"x":700,"y":440,"wires":[["a0320438.a78328"]]},{"id":"487c7959.3ef6b8","type":"delay","z":"eeb0b50.5800748","name":"Dauer des Tastendruck für Dimmer","pauseType":"delay","timeout":"1","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":540,"y":520,"wires":[["dff239b6.d2d928"]]},{"id":"dff239b6.d2d928","type":"function","z":"eeb0b50.5800748","name":"Dimmer aktivieren","func":"var StatusTaster = global.get('StatusTaster');\nif (msg.payload && StatusTaster === 1 || 2) \nglobal.set('Dimmer',1)\nreturn{payload: 1} ","outputs":1,"noerr":0,"x":820,"y":520,"wires":[["191d71b.6ad428e"]]},{"id":"ceab2393.9d28d","type":"delay","z":"eeb0b50.5800748","name":"Dauer für das Ausschalten der Lampe","pauseType":"delay","timeout":"1100","timeoutUnits":"milliseconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":550,"y":580,"wires":[["fe19e42b.1d4128"]]},{"id":"fe19e42b.1d4128","type":"function","z":"eeb0b50.5800748","name":"Lampe ausschalten","func":"var nodeid = 0; // die node ID vom Dimmer in homee\nvar attributid =0; // die attribut id des Dimmer in homee\nvar StatusTaster = global.get('StatusTaster');\nif ( msg.payload === 1 && StatusTaster === 0)\n{\n    return {payload: \"PUT:/nodes/\"+nodeid+\"/attributes/\"+attributid+\"/?target_value=0\"}\n    \n}\n","outputs":1,"noerr":0,"x":830,"y":580,"wires":[["73cacf2e.26bc2"]]},{"id":"7ae3017f.83078","type":"function","z":"eeb0b50.5800748","name":"Umwandeln des Tastersignal ","func":"var taster = 000;// hier kommt die Attribut ID des Tasters hin\nif (msg.payload.attribute && msg.payload.attribute.id === taster && msg.payload.attribute.current_value === 1){\nreturn {payload: 1}}\nif (msg.payload.attribute && msg.payload.attribute.id === taster && msg.payload.attribute.current_value === 2){\nreturn {payload: 0}}\nif (msg.payload.attribute && msg.payload.attribute.id === taster && msg.payload.attribute.current_value === 0){\nreturn {payload: 2}}","outputs":1,"noerr":0,"x":260,"y":380,"wires":[["f123b23.d88f45","a0320438.a78328","487c7959.3ef6b8","ceab2393.9d28d"]]},{"id":"ed4c66fe.e21fd8","type":"function","z":"eeb0b50.5800748","name":"Sicherheitsabschaltung","func":"var count = global.get('dimmcounter');\nif (count >100 || count <4) {\nreturn {payload: 0}}\n","outputs":1,"noerr":0,"x":690,"y":320,"wires":[["f123b23.d88f45"]]},{"id":"73cacf2e.26bc2","type":"homee","z":"eeb0b50.5800748","name":"","host":"","x":700,"y":200,"wires":[["7ae3017f.83078"]]}]

Flow Info

Created 6 years, 6 months ago
Rating: not yet rated

Owner

Actions

Rate:

Node Types

Core
  • delay (x3)
  • function (x7)
Other

Tags

Copy this flow JSON to your clipboard and then import into Node-RED using the Import From > Clipboard (Ctrl-I) menu option