EnOcean - Switch actuator

Hello
At the moment I can read signals from EnOcean sensors (pushbuttons). Is there also a possibility to switch actuators (e.g. blind actuator Eltako FSB61NP-230V) via Nodered and read the status back? If someone of you has an example, that would be great!

Is there no way to switch enocean actuators via nodered?

Have you searched the forum?
What did you use for your keyword(s)
What have you tried?

Thanks for your message
I have used the following search terms:
-> enocean actuators
-> enocean switch

I had the most success with this:

but only the readout of sensors is discussed there

@steinerma yes see the docs
https://flows.nodered.org/flow/1f0dd4b46e783c6306fc5fc8f8584630

@iiLaw Thanks for your message
i had already integrated this flow. I can successfully read sensors with it. Unfortunately , I am not able to control an actuator with it from node-red. Is there somewhere an example flow?

Doing a quick google search, I don't find anything where NR can control an enocean actuator. I did find this white paper - Raspberry Pi talks EnOcean which might help you out

But you will have to workout how to have Node-red work with what it describes.

@steinerma so you put the actuator into Learn and hit LNR inject to Link the EnOcean USB transceiver to the Actuator?

Also you might find have a copy of DolphinView useful Development Tools for EnOcean Modules | EnOcean - Support | EnOcean though that would require an additional USB transceiver

1 Like

This is my flow for managing a dimmer based on the time an enocean switch is pressed.
Hope it helps :slight_smile:
regards
Johannes

[{"id":"82d5fab.7df0f08","type":"subflow","name":"Rocker down","info":"","category":"","in":[{"x":100,"y":40,"wires":[{"id":"7bba0bcd.6ebcd4"}]}],"out":[{"x":980,"y":740,"wires":[{"id":"afade003.1faff","port":0},{"id":"893c8381.5c569","port":0},{"id":"a5bf9d31.a1b1e","port":0},{"id":"8e2db757.aeddb8","port":0},{"id":"86a265fe.308048","port":0},{"id":"e2898fe.af4cb7","port":0},{"id":"b54c5af.db0f5a8","port":0},{"id":"70174c96.908da4","port":0},{"id":"15b3af3c.9565f1","port":0},{"id":"297142d8.38ea8e","port":0},{"id":"56456234.20557c","port":0}]}],"env":[],"color":"#DDAA99"},{"id":"afade003.1faff","type":"function","z":"82d5fab.7df0f08","name":"","func":"msg.payload = 90;\nif (global.get('stop')){\n    global.set('stop', false);\n    return null;\n}\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":220,"y":160,"wires":[["55428fce.726c4"]]},{"id":"55428fce.726c4","type":"delay","z":"82d5fab.7df0f08","name":"","pauseType":"delay","timeout":"500","timeoutUnits":"milliseconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":260,"y":220,"wires":[["893c8381.5c569"]]},{"id":"893c8381.5c569","type":"function","z":"82d5fab.7df0f08","name":"","func":"msg.payload = 80;\nif (global.get('stop')){\n    global.set('stop', false);\n    return null;\n}\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":220,"y":280,"wires":[["b420b8d1.099448"]]},{"id":"b420b8d1.099448","type":"delay","z":"82d5fab.7df0f08","name":"","pauseType":"delay","timeout":"500","timeoutUnits":"milliseconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":260,"y":340,"wires":[["a5bf9d31.a1b1e"]]},{"id":"a5bf9d31.a1b1e","type":"function","z":"82d5fab.7df0f08","name":"","func":"msg.payload = 70;\nif (global.get('stop')){\n    global.set('stop', false);    \n    return null;\n}\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":220,"y":400,"wires":[["800cbd23.a7138"]]},{"id":"800cbd23.a7138","type":"delay","z":"82d5fab.7df0f08","name":"","pauseType":"delay","timeout":"500","timeoutUnits":"milliseconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":260,"y":460,"wires":[["8e2db757.aeddb8"]]},{"id":"8e2db757.aeddb8","type":"function","z":"82d5fab.7df0f08","name":"","func":"msg.payload = 60;\nif (global.get('stop')){\n    global.set('stop', false);    \n    return null;\n}\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":220,"y":520,"wires":[["f6547ff0.f490e"]]},{"id":"f6547ff0.f490e","type":"delay","z":"82d5fab.7df0f08","name":"","pauseType":"delay","timeout":"500","timeoutUnits":"milliseconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":260,"y":580,"wires":[["86a265fe.308048"]]},{"id":"86a265fe.308048","type":"function","z":"82d5fab.7df0f08","name":"","func":"msg.payload = 50;\nif (global.get('stop')){\n    global.set('stop', false);    \n    return null;\n}\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":220,"y":640,"wires":[["870e101f.8244a"]]},{"id":"e2898fe.af4cb7","type":"function","z":"82d5fab.7df0f08","name":"","func":"msg.payload = 40;\nif (global.get('stop')){\n    global.set('stop', false);    \n    return null;\n}\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":220,"y":760,"wires":[["5b2989a4.c36258"]]},{"id":"870e101f.8244a","type":"delay","z":"82d5fab.7df0f08","name":"","pauseType":"delay","timeout":"500","timeoutUnits":"milliseconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":260,"y":700,"wires":[["e2898fe.af4cb7"]]},{"id":"5b2989a4.c36258","type":"delay","z":"82d5fab.7df0f08","name":"","pauseType":"delay","timeout":"500","timeoutUnits":"milliseconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":260,"y":820,"wires":[["b54c5af.db0f5a8"]]},{"id":"b54c5af.db0f5a8","type":"function","z":"82d5fab.7df0f08","name":"","func":"msg.payload = 30;\nif (global.get('stop')){\n    global.set('stop', false);    \n    return null;\n}\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":220,"y":880,"wires":[["3043c6c1.4d021a"]]},{"id":"3043c6c1.4d021a","type":"delay","z":"82d5fab.7df0f08","name":"","pauseType":"delay","timeout":"500","timeoutUnits":"milliseconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":260,"y":940,"wires":[["70174c96.908da4"]]},{"id":"70174c96.908da4","type":"function","z":"82d5fab.7df0f08","name":"","func":"msg.payload = 20;\nif (global.get('stop')){\n    global.set('stop', false);    \n    return null;\n}\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":220,"y":1000,"wires":[["f8712b70.5290f8"]]},{"id":"f8712b70.5290f8","type":"delay","z":"82d5fab.7df0f08","name":"","pauseType":"delay","timeout":"500","timeoutUnits":"milliseconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":260,"y":1060,"wires":[["15b3af3c.9565f1"]]},{"id":"15b3af3c.9565f1","type":"function","z":"82d5fab.7df0f08","name":"","func":"msg.payload = 10;\nif (global.get('stop')){\n    global.set('stop', false);    \n    return null;\n}\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":220,"y":1120,"wires":[["5773e176.0ab3d"]]},{"id":"5773e176.0ab3d","type":"delay","z":"82d5fab.7df0f08","name":"","pauseType":"delay","timeout":"500","timeoutUnits":"milliseconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":260,"y":1180,"wires":[["297142d8.38ea8e"]]},{"id":"297142d8.38ea8e","type":"function","z":"82d5fab.7df0f08","name":"","func":"msg.payload = 0;\nglobal.set('stop', false);\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":220,"y":1248,"wires":[[]]},{"id":"7bba0bcd.6ebcd4","type":"delay","z":"82d5fab.7df0f08","name":"","pauseType":"delay","timeout":"250","timeoutUnits":"milliseconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":260,"y":40,"wires":[["56456234.20557c"]]},{"id":"56456234.20557c","type":"function","z":"82d5fab.7df0f08","name":"","func":"msg1 = {};\nmsg2 = {};\n\nif (global.get('stop')){\n    global.set('stop', false);\n    msg1.payload = 0;\n    msg2 = null;\n    return [msg1,msg2];\n}\nelse{\n    msg1 = null;\n    msg2.payload = 1;\n    return [msg1,msg2];    \n}","outputs":2,"noerr":0,"initialize":"","finalize":"","x":440,"y":40,"wires":[[],["32c1a03f.4afcb"]]},{"id":"32c1a03f.4afcb","type":"delay","z":"82d5fab.7df0f08","name":"","pauseType":"delay","timeout":"250","timeoutUnits":"milliseconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":260,"y":100,"wires":[["afade003.1faff"]]},{"id":"12fa8aef.c82795","type":"subflow","name":"Rocker-up","info":"","category":"","in":[{"x":120,"y":60,"wires":[{"id":"a3319f3d.8bc3b"}]}],"out":[{"x":1000,"y":760,"wires":[{"id":"2f5c71a7.90a6ce","port":0},{"id":"1aa6a17b.e932df","port":0},{"id":"9dd8782a.828398","port":0},{"id":"faeb137.c6542f","port":0},{"id":"e0b4505b.7db86","port":0},{"id":"1efc3609.793cca","port":0},{"id":"84a1acaf.43afe","port":0},{"id":"88bc40f6.864fc","port":0},{"id":"cd84b939.e10578","port":0},{"id":"83396e0a.cb8b5","port":0},{"id":"cfd65aac.ee2e98","port":0}]}],"env":[],"color":"#DDAA99"},{"id":"2f5c71a7.90a6ce","type":"function","z":"12fa8aef.c82795","name":"","func":"msg.payload = 10;\nif (global.get('stop')){\n    global.set('stop', false);\n    return null;\n}\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":260,"y":180,"wires":[["4168111.f23c9f"]]},{"id":"a3319f3d.8bc3b","type":"delay","z":"12fa8aef.c82795","name":"","pauseType":"delay","timeout":"250","timeoutUnits":"milliseconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":300,"y":60,"wires":[["cfd65aac.ee2e98"]]},{"id":"4168111.f23c9f","type":"delay","z":"12fa8aef.c82795","name":"","pauseType":"delay","timeout":"500","timeoutUnits":"milliseconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":300,"y":240,"wires":[["1aa6a17b.e932df"]]},{"id":"1aa6a17b.e932df","type":"function","z":"12fa8aef.c82795","name":"","func":"msg.payload = 20;\nif (global.get('stop')){\n    global.set('stop', false);\n    return null;\n}\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":260,"y":300,"wires":[["926eb31a.2ac9a"]]},{"id":"926eb31a.2ac9a","type":"delay","z":"12fa8aef.c82795","name":"","pauseType":"delay","timeout":"500","timeoutUnits":"milliseconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":300,"y":360,"wires":[["9dd8782a.828398"]]},{"id":"9dd8782a.828398","type":"function","z":"12fa8aef.c82795","name":"","func":"msg.payload = 30;\nif (global.get('stop')){\n    global.set('stop', false);    \n    return null;\n}\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":260,"y":420,"wires":[["91d820e.4d7ffe"]]},{"id":"91d820e.4d7ffe","type":"delay","z":"12fa8aef.c82795","name":"","pauseType":"delay","timeout":"500","timeoutUnits":"milliseconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":300,"y":480,"wires":[["faeb137.c6542f"]]},{"id":"faeb137.c6542f","type":"function","z":"12fa8aef.c82795","name":"","func":"msg.payload = 40;\nif (global.get('stop')){\n    global.set('stop', false);    \n    return null;\n}\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":260,"y":540,"wires":[["c2b5b188.4a4e2"]]},{"id":"c2b5b188.4a4e2","type":"delay","z":"12fa8aef.c82795","name":"","pauseType":"delay","timeout":"500","timeoutUnits":"milliseconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":300,"y":600,"wires":[["e0b4505b.7db86"]]},{"id":"e0b4505b.7db86","type":"function","z":"12fa8aef.c82795","name":"","func":"msg.payload = 50;\nif (global.get('stop')){\n    global.set('stop', false);    \n    return null;\n}\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":260,"y":660,"wires":[["ec3a1e11.98218"]]},{"id":"1efc3609.793cca","type":"function","z":"12fa8aef.c82795","name":"","func":"msg.payload = 60;\nif (global.get('stop')){\n    global.set('stop', false);    \n    return null;\n}\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":260,"y":780,"wires":[["3ffff39b.3345bc"]]},{"id":"ec3a1e11.98218","type":"delay","z":"12fa8aef.c82795","name":"","pauseType":"delay","timeout":"500","timeoutUnits":"milliseconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":300,"y":720,"wires":[["1efc3609.793cca"]]},{"id":"3ffff39b.3345bc","type":"delay","z":"12fa8aef.c82795","name":"","pauseType":"delay","timeout":"500","timeoutUnits":"milliseconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":300,"y":840,"wires":[["84a1acaf.43afe"]]},{"id":"84a1acaf.43afe","type":"function","z":"12fa8aef.c82795","name":"","func":"msg.payload = 70;\nif (global.get('stop')){\n    global.set('stop', false);    \n    return null;\n}\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":260,"y":900,"wires":[["771a1399.11082c"]]},{"id":"771a1399.11082c","type":"delay","z":"12fa8aef.c82795","name":"","pauseType":"delay","timeout":"500","timeoutUnits":"milliseconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":300,"y":960,"wires":[["88bc40f6.864fc"]]},{"id":"88bc40f6.864fc","type":"function","z":"12fa8aef.c82795","name":"","func":"msg.payload = 80;\nif (global.get('stop')){\n    global.set('stop', false);    \n    return null;\n}\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":260,"y":1020,"wires":[["d9ef944c.b98208"]]},{"id":"d9ef944c.b98208","type":"delay","z":"12fa8aef.c82795","name":"","pauseType":"delay","timeout":"500","timeoutUnits":"milliseconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":300,"y":1080,"wires":[["cd84b939.e10578"]]},{"id":"cd84b939.e10578","type":"function","z":"12fa8aef.c82795","name":"","func":"msg.payload = 90;\nif (global.get('stop')){\n    global.set('stop', false);    \n    return null;\n}\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":260,"y":1140,"wires":[["33535e27.6b4b92"]]},{"id":"33535e27.6b4b92","type":"delay","z":"12fa8aef.c82795","name":"","pauseType":"delay","timeout":"500","timeoutUnits":"milliseconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":300,"y":1200,"wires":[["83396e0a.cb8b5"]]},{"id":"83396e0a.cb8b5","type":"function","z":"12fa8aef.c82795","name":"","func":"msg.payload = 100;\nglobal.set('stop', false);\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":260,"y":1268,"wires":[[]]},{"id":"cfd65aac.ee2e98","type":"function","z":"12fa8aef.c82795","name":"","func":"msg1 = {};\nmsg2 = {};\n\nif (global.get('stop')){\n    global.set('stop', false);\n    msg1.payload = 100;\n    msg2 = null;\n    return [msg1,msg2];\n}\nelse{\n    msg1 = null;\n    msg2.payload = 1;\n    return [msg1,msg2];    \n}","outputs":2,"noerr":0,"initialize":"","finalize":"","x":500,"y":60,"wires":[[],["6654b02.083115"]]},{"id":"6654b02.083115","type":"delay","z":"12fa8aef.c82795","name":"","pauseType":"delay","timeout":"250","timeoutUnits":"milliseconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":300,"y":120,"wires":[["2f5c71a7.90a6ce"]]},{"id":"f866dee6.c52a7","type":"tab","label":"enocean SW","disabled":false,"info":""},{"id":"60dc60af.f0fd3","type":"link in","z":"f866dee6.c52a7","name":"","links":["55ce40f9.1d604"],"x":135,"y":340,"wires":[["e08dcf73.5d1e2","5cf6a329.b598ec","cd20f38c.4a965","e4b8d277.42ff8"]]},{"id":"e08dcf73.5d1e2","type":"debug","z":"f866dee6.c52a7","name":"","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":370,"y":40,"wires":[]},{"id":"c014f3d0.73cbb","type":"switch","z":"f866dee6.c52a7","name":"SW 1","property":"payload.R1.value","propertyType":"msg","rules":[{"t":"eq","v":"3","vt":"num"}],"checkall":"true","repair":false,"outputs":1,"x":510,"y":160,"wires":[["ce4c4b52.ab7a08"]]},{"id":"fa824dbb.47009","type":"switch","z":"f866dee6.c52a7","name":"SW 2","property":"payload.R1.value","propertyType":"msg","rules":[{"t":"eq","v":"2","vt":"num"}],"checkall":"true","repair":false,"outputs":1,"x":510,"y":200,"wires":[["bee07575.5491e8"]]},{"id":"c1361141.2f8ad","type":"debug","z":"f866dee6.c52a7","name":"","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":910,"y":200,"wires":[]},{"id":"d390bf13.018d6","type":"switch","z":"f866dee6.c52a7","name":"SW 3","property":"payload.R1.value","propertyType":"msg","rules":[{"t":"eq","v":"1","vt":"num"}],"checkall":"true","repair":false,"outputs":1,"x":510,"y":240,"wires":[["5415b2ec.f6a9dc"]]},{"id":"c1dc5fa7.86774","type":"switch","z":"f866dee6.c52a7","name":"SW 4","property":"payload.R1.value","propertyType":"msg","rules":[{"t":"eq","v":"0","vt":"num"}],"checkall":"true","repair":false,"outputs":1,"x":510,"y":280,"wires":[["51dbffa.ab6d"]]},{"id":"bee07575.5491e8","type":"switch","z":"f866dee6.c52a7","name":"pressed","property":"payload.EB.description","propertyType":"msg","rules":[{"t":"eq","v":"pressed","vt":"str"}],"checkall":"true","repair":false,"outputs":1,"x":640,"y":200,"wires":[["2f4cb7c.7102e48"]]},{"id":"5415b2ec.f6a9dc","type":"switch","z":"f866dee6.c52a7","name":"pressed","property":"payload.EB.description","propertyType":"msg","rules":[{"t":"eq","v":"pressed","vt":"str"}],"checkall":"true","repair":false,"outputs":1,"x":640,"y":240,"wires":[["6614674a.988618"]]},{"id":"51dbffa.ab6d","type":"switch","z":"f866dee6.c52a7","name":"pressed","property":"payload.EB.description","propertyType":"msg","rules":[{"t":"eq","v":"pressed","vt":"str"}],"checkall":"true","repair":false,"outputs":1,"x":640,"y":280,"wires":[["e2ad2b9b.4e0738"]]},{"id":"5cf6a329.b598ec","type":"switch","z":"f866dee6.c52a7","name":"","property":"meta.name","propertyType":"msg","rules":[{"t":"eq","v":"EGWZ-SW1","vt":"str"},{"t":"eq","v":"EGWZ-SW2","vt":"str"}],"checkall":"true","repair":false,"outputs":2,"x":260,"y":340,"wires":[["c014f3d0.73cbb","fa824dbb.47009","d390bf13.018d6","c1dc5fa7.86774","89a8c3fc.55e3f"],["45597fe8.90d"]]},{"id":"cd20f38c.4a965","type":"debug","z":"f866dee6.c52a7","name":"","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"meta","targetType":"msg","statusVal":"","statusType":"auto","x":380,"y":120,"wires":[]},{"id":"e4b8d277.42ff8","type":"debug","z":"f866dee6.c52a7","name":"","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":390,"y":80,"wires":[]},{"id":"ce4c4b52.ab7a08","type":"switch","z":"f866dee6.c52a7","name":"pressed","property":"payload.EB.description","propertyType":"msg","rules":[{"t":"eq","v":"pressed","vt":"str"}],"checkall":"true","repair":false,"outputs":1,"x":640,"y":160,"wires":[["9308ff64.9ac9c"]]},{"id":"9308ff64.9ac9c","type":"change","z":"f866dee6.c52a7","name":"Text 1","rules":[{"t":"set","p":"payload","pt":"msg","to":"Taste 1 pressed","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":770,"y":160,"wires":[["823176c7.07c588"]]},{"id":"2f4cb7c.7102e48","type":"change","z":"f866dee6.c52a7","name":"Text 2","rules":[{"t":"set","p":"payload","pt":"msg","to":"Taste 2 pressed","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":770,"y":200,"wires":[["c1361141.2f8ad"]]},{"id":"823176c7.07c588","type":"debug","z":"f866dee6.c52a7","name":"","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":910,"y":160,"wires":[]},{"id":"89a8c3fc.55e3f","type":"function","z":"f866dee6.c52a7","name":"","func":"switch (msg.payload.EB.description) {\n    case \"pressed\":\n        context.set(\"pressed\",Date.now());\n        break;\n    case \"released\":\n        const pressed = context.get(\"pressed\") || false;\n        if (!pressed) {\n            break;\n        } else {\n            const diff = Date.now() - context.get(\"pressed\");\n            node.send({payload:diff,topic:0});\n            flow.set(\"pressed\", false);\n            break;\n        }\n}\nreturn null;\n","outputs":1,"noerr":0,"initialize":"","finalize":"","x":520,"y":320,"wires":[["d8430b51.ae9918"]]},{"id":"4c6c3433.319a1c","type":"debug","z":"f866dee6.c52a7","name":"","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":890,"y":360,"wires":[]},{"id":"d8430b51.ae9918","type":"function","z":"f866dee6.c52a7","name":"","func":"msg.diff = \"for \" + msg.payload + \"ms\";\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":660,"y":320,"wires":[["4c6c3433.319a1c","946b9e23.44d05"]]},{"id":"6614674a.988618","type":"subflow:12fa8aef.c82795","z":"f866dee6.c52a7","name":"","x":790,"y":240,"wires":[["65ab4ab3.8ae494"]]},{"id":"946b9e23.44d05","type":"change","z":"f866dee6.c52a7","name":"","rules":[{"t":"set","p":"stop","pt":"global","to":"true","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":930,"y":320,"wires":[[]]},{"id":"e2ad2b9b.4e0738","type":"subflow:82d5fab.7df0f08","z":"f866dee6.c52a7","name":"","x":790,"y":280,"wires":[["65ab4ab3.8ae494"]]},{"id":"65ab4ab3.8ae494","type":"function","z":"f866dee6.c52a7","name":"","func":"let brightness = msg.payload.toString();\nmsg.method = \"POST\";\nmsg.url = \"http://10.0.0.85/color/0?turn=on&white=\"+ brightness;\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":960,"y":260,"wires":[["8d51468b.f9df98"]]},{"id":"8d51468b.f9df98","type":"http request","z":"f866dee6.c52a7","name":"","method":"use","ret":"txt","paytoqs":"ignore","url":"","tls":"","persist":false,"proxy":"","authType":"","x":1130,"y":260,"wires":[[]]},{"id":"76962ba3.f6dad4","type":"switch","z":"f866dee6.c52a7","name":"whichButton","property":"payload.R1.value","propertyType":"msg","rules":[{"t":"eq","v":"2","vt":"str"},{"t":"eq","v":"3","vt":"str"},{"t":"eq","v":"0","vt":"str"},{"t":"eq","v":"1","vt":"str"}],"checkall":"true","repair":false,"outputs":4,"x":650,"y":540,"wires":[["a3ea5442.76bf1"],["1f514644.87a692"],["47908b5.dd86ef4"],["c37fb8f9.2fe508"]]},{"id":"a3ea5442.76bf1","type":"function","z":"f866dee6.c52a7","name":"6 left down","func":"switch (msg.payload.EB.description) {\n    case \"pressed\":\n        context.set(\"pressed\",true);\n        let rounds = 0;\n        const repeat = setInterval(()=>{\n            if (context.get(\"pressed\") === false || rounds === 20) { clearInterval(repeat); }\n            node.send({payload:\"pressed\",topic:\"down\"})\n            rounds += 1;\n        },250)\n        break;\n    case \"released\":\n        const pressed = context.get(\"pressed\") || false;\n        if (!pressed) {\n            break;\n        } else {\n            context.set(\"pressed\", false);\n            break;\n        }\n}\nreturn null;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":870,"y":540,"wires":[["8b78ed6.ec25d1"]]},{"id":"45597fe8.90d","type":"switch","z":"f866dee6.c52a7","name":"pressed/released","property":"payload.EB.description","propertyType":"msg","rules":[{"t":"eq","v":"pressed","vt":"str"},{"t":"eq","v":"released","vt":"str"}],"checkall":"true","repair":false,"outputs":2,"x":430,"y":600,"wires":[["76962ba3.f6dad4"],["47908b5.dd86ef4","c37fb8f9.2fe508","a3ea5442.76bf1","1f514644.87a692"]]},{"id":"1f514644.87a692","type":"function","z":"f866dee6.c52a7","name":"5 left up","func":"switch (msg.payload.EB.description) {\n    case \"pressed\":\n        context.set(\"pressed\",true);\n        let rounds = 0;\n        const repeat = setInterval(()=>{\n            if (context.get(\"pressed\") === false || rounds === 20) { clearInterval(repeat); }\n            node.send({payload:\"pressed\",topic:\"up\"})\n            rounds += 1;\n        },250)\n        break;\n    case \"released\":\n        const pressed = context.get(\"pressed\") || false;\n        if (!pressed) {\n            break;\n        } else {\n            context.set(\"pressed\", false);\n            break;\n        }\n}\nreturn null;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":860,"y":580,"wires":[["8b78ed6.ec25d1"]]},{"id":"47908b5.dd86ef4","type":"function","z":"f866dee6.c52a7","name":" 8 right down","func":"switch (msg.payload.EB.description) {\n    case \"pressed\":\n        context.set(\"pressed\",true);\n        let rounds = 0;\n        const repeat = setInterval(()=>{\n            if (context.get(\"pressed\") === false || rounds === 10) { clearInterval(repeat); }\n            node.send({payload:\"pressed\",topic:\"down\"})\n            rounds += 1;\n        },500)\n        break;\n    case \"released\":\n        const pressed = context.get(\"pressed\") || false;\n        if (!pressed) {\n            break;\n        } else {\n            context.set(\"pressed\", false);\n            break;\n        }\n}\nreturn null;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":870,"y":620,"wires":[["feefbd4e.0bb268"]]},{"id":"c37fb8f9.2fe508","type":"function","z":"f866dee6.c52a7","name":" 7 right up","func":"switch (msg.payload.EB.description) {\n    case \"pressed\":\n        context.set(\"pressed\",true);\n        let rounds = 0;\n        const repeat = setInterval(()=>{\n            if (context.get(\"pressed\") === false || rounds === 10) { clearInterval(repeat); }\n            node.send({payload:\"pressed\",topic:\"up\"})\n            rounds += 1;\n        },500)\n        break;\n    case \"released\":\n        const pressed = context.get(\"pressed\") || false;\n        if (!pressed) {\n            break;\n        } else {\n            context.set(\"pressed\", false);\n            break;\n        }\n}\nreturn null;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":860,"y":660,"wires":[["feefbd4e.0bb268"]]},{"id":"edc1496a.315e6","type":"debug","z":"f866dee6.c52a7","name":"","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":1210,"y":640,"wires":[]},{"id":"feefbd4e.0bb268","type":"function","z":"f866dee6.c52a7","name":"right state","func":"let state = flow.get(\"Rocker1RightState\") || 0;\nswitch (msg.topic) {\n    case \"up\":\n        if (state < 100) {\n            state += 10;\n            node.send({payload:state});\n        }\n        break;\n    case \"down\":\n        if (state > 0) {\n            state -= 10;\n            node.send({payload:state});\n        }\n        break;\n}\nflow.set(\"Rocker1RightState\", state);\nreturn null;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":1040,"y":640,"wires":[["edc1496a.315e6","aaeae2e8.e095c"]]},{"id":"f201122b.77f9a8","type":"debug","z":"f866dee6.c52a7","name":"","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":1210,"y":560,"wires":[]},{"id":"8b78ed6.ec25d1","type":"function","z":"f866dee6.c52a7","name":"left state","func":"let state = flow.get(\"Rocker1LeftState\") || 0;\nswitch (msg.topic) {\n    case \"up\":\n        if (state < 100) {\n            state += 10;\n            node.send({payload:state});\n        }\n        break;\n    case \"down\":\n        if (state > 0) {\n            state -= 10;\n            node.send({payload:state});\n        }\n        break;\n}\nflow.set(\"Rocker1LeftState\", state);\nreturn null;","outputs":1,"noerr":0,"x":1040,"y":560,"wires":[["f201122b.77f9a8","aaeae2e8.e095c"]]},{"id":"aaeae2e8.e095c","type":"function","z":"f866dee6.c52a7","name":"","func":"let brightness = msg.payload.toString();\nmsg.method = \"POST\";\nmsg.url = \"http://10.0.0.85/color/0?turn=on&white=\"+ brightness;\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":1200,"y":600,"wires":[["21ea3930.9c5a16"]]},{"id":"21ea3930.9c5a16","type":"http request","z":"f866dee6.c52a7","name":"","method":"use","ret":"txt","paytoqs":"ignore","url":"","tls":"","persist":false,"proxy":"","authType":"","x":1370,"y":600,"wires":[[]]},{"id":"a6f95544.15e098","type":"http request","z":"f866dee6.c52a7","name":"","method":"GET","ret":"txt","paytoqs":"ignore","url":"http://10.0.0.58/relay/0?turn=on","tls":"","persist":false,"proxy":"","authType":"","x":1130,"y":160,"wires":[[]]},{"id":"77e423d5.3279dc","type":"http request","z":"f866dee6.c52a7","name":"","method":"GET","ret":"txt","paytoqs":"ignore","url":"http://10.0.0.58/relay/0?turn=off","tls":"","persist":false,"proxy":"","authType":"","x":1130,"y":200,"wires":[[]]},{"id":"1cb52584.6d1d2a","type":"function","z":"f866dee6.c52a7","name":"set RGBW2 on off","func":"msg.method = \"POST\";\nif (msg.payload === \"on\"){\n    msg.url = \"http://10.0.0.85/color/0?turn=on\";\n}\nelse if (msg.payload === \"off\"){\n    msg.url = \"http://10.0.0.85/color/0?turn=off\";\n}\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":1030,"y":460,"wires":[["8351abe9.c38228"]]},{"id":"8351abe9.c38228","type":"http request","z":"f866dee6.c52a7","name":"","method":"use","ret":"txt","paytoqs":"ignore","url":"","tls":"","persist":false,"proxy":"","authType":"","x":1230,"y":460,"wires":[[]]},{"id":"8ef78dfa.1406","type":"change","z":"f866dee6.c52a7","name":"off","rules":[{"t":"set","p":"payload","pt":"msg","to":"off","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":850,"y":440,"wires":[["1cb52584.6d1d2a"]]},{"id":"e2fa347a.7df738","type":"change","z":"f866dee6.c52a7","name":"on","rules":[{"t":"set","p":"payload","pt":"msg","to":"on","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":850,"y":480,"wires":[["1cb52584.6d1d2a"]]}]````
1 Like

Thanks for all your replays!

Presumably, the error is not far now. When I click on the two buttons "on" and "off", this is output to me in the debug.

What I don't understand: the message objects look the same as when I press the button on the NodOn SIN-2-2-01. However, the NodOn does not switch when I switch it via NodeRed.

and here ist the flow:

[{"id":"a5e956de.749b68","type":"tab","label":"Flow 2","disabled":false,"info":""},{"id":"f23f04f5.51e628","type":"enocean-in","z":"a5e956de.749b68","serialport":"cfcf4fbc.4250e","name":"in","x":90,"y":100,"wires":[["ca588d44.5387d"]]},{"id":"ca588d44.5387d","type":"enocean-actor","z":"a5e956de.749b68","name":"Aktor 1","channel":"1","adt":false,"x":380,"y":100,"wires":[["8741c76e.8ffdd8"],["fbdde8aa.bc7da8"]]},{"id":"539b496c.88c8c8","type":"inject","z":"a5e956de.749b68","name":"LRN","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"{\"type\":\"LRN\",\"duration\":30}","payloadType":"json","x":90,"y":160,"wires":[["ca588d44.5387d"]]},{"id":"8741c76e.8ffdd8","type":"debug","z":"a5e956de.749b68","name":"","active":true,"tosidebar":true,"console":false,"tostatus":true,"complete":"true","targetType":"full","statusVal":"payload","statusType":"auto","x":970,"y":80,"wires":[]},{"id":"fdc10fd0.cb5ff","type":"inject","z":"a5e956de.749b68","name":"on","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"{\"meta\":{\"eep\":\"d2-01-12\",\"channel\":1,\"type\":\"radio-erp1\",\"data\":1},\"data\":{\"CMD\":{\"value\":1},\"I/O\":{\"value\":1},\"OV\":{\"value\":100}}}","payloadType":"json","x":730,"y":200,"wires":[["fbdde8aa.bc7da8","50475f0af4abd251"]]},{"id":"cb982957.07f248","type":"inject","z":"a5e956de.749b68","name":"off","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"{\"meta\":{\"eep\":\"d2-01-12\",\"channel\":1,\"type\":\"radio-erp1\",\"data\":1},\"data\":{\"CMD\":{\"value\":1},\"I/O\":{\"value\":0},\"OV\":{\"value\":0}}}","payloadType":"json","x":730,"y":240,"wires":[["fbdde8aa.bc7da8","50475f0af4abd251"]]},{"id":"8b144f59.4041c","type":"inject","z":"a5e956de.749b68","name":"request state","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"{\"meta\":{\"eep\":\"d2-01-12\",\"channel\":1,\"type\":\"data\",\"data\":3},\"data\":{\"CMD\":{\"value\":3},\"I/O\":{\"value\":30}}}","payloadType":"json","x":700,"y":280,"wires":[["fbdde8aa.bc7da8"]]},{"id":"da4ebd30.77203","type":"inject","z":"a5e956de.749b68","name":"request external interface","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"{\"meta\":{\"eep\":\"d2-01-12\",\"channel\":1,\"type\":\"data\",\"data\":3},\"data\":{\"CMD\":{\"value\":12},\"I/O\":{\"value\":30}}}","payloadType":"json","x":660,"y":320,"wires":[["fbdde8aa.bc7da8"]]},{"id":"1f9d94dc.02bb7b","type":"inject","z":"a5e956de.749b68","name":"delay off 2s","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"{\"meta\":{\"eep\":\"d2-01-12\",\"channel\":1,\"type\":\"data\",\"data\":11},\"data\":{\"CMD\":{\"value\":11},\"I/O\":{\"value\":30},\"AOT\":{\"value\":20}}}","payloadType":"json","x":710,"y":360,"wires":[["fbdde8aa.bc7da8"]]},{"id":"92304e02c052f0c7","type":"inject","z":"a5e956de.749b68","name":"manuell teach in","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"{\"type\":\"LRN\",\"senderId\":\"050846db\",\"eep\":\"d2-01-12\",\"name\":\"LichtAktor\"}","payloadType":"json","x":120,"y":220,"wires":[["ca588d44.5387d"]]},{"id":"59492d8aa44bfc19","type":"debug","z":"a5e956de.749b68","name":"msg.payload of Output","active":true,"tosidebar":true,"console":false,"tostatus":true,"complete":"payload","targetType":"msg","statusVal":"payload","statusType":"auto","x":1280,"y":160,"wires":[]},{"id":"fbdde8aa.bc7da8","type":"enocean-out","z":"a5e956de.749b68","serialport":"cfcf4fbc.4250e","name":"","logOutput":true,"x":980,"y":160,"wires":[["59492d8aa44bfc19"]]},{"id":"50475f0af4abd251","type":"debug","z":"a5e956de.749b68","name":"msg-payload of buttons","active":true,"tosidebar":true,"console":false,"tostatus":true,"complete":"payload","targetType":"msg","statusVal":"payload","statusType":"auto","x":1290,"y":220,"wires":[]},{"id":"cfcf4fbc.4250e","type":"enocean-config-node","serialport":"/dev/ttyUSB0"}]

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.