In the two articles Sonoff 433Mhz RF Bridge with Tasmota Firmware flashing and Tasmota – Configure Sonoff 433Mhz RF bridge and teach sockets explains how to prepare the Sonoff RF Bridge for use with Tasmota firmware. The advantage of this is that you can now control the RF Bridge directly from NodeRed even without Sonoff's cloud-based service.
What the actual control of the RF Bridge from NodeRed could look like is explained in the following article.
Safety instructions
I know the following notes are always kind of annoying and seem unnecessary. Unfortunately, many people who knew "better" have lost eyes, fingers or other things due to carelessness or injured themselves. Data loss is almost negligible in comparison, but even these can be really annoying. Therefore, please take five minutes to read the safety instructions. Because even the coolest project is not worth injury or other trouble.
https://www.nerdiy.de/sicherheitshinweise/
Affiliate links/advertising links
The links to online shops listed here are so-called affiliate links. If you click on such an affiliate link and make a purchase via this link, Nerdiy.de will receive a commission from the relevant online shop or provider. The price does not change for you. If you make your purchases via these links, you support Nerdiy.de in being able to offer other useful projects in the future. 🙂
Requirements
Helpful articles:
So that you can adopt this configuration, NodeRed should of course already be installed. In addition, the Sonoff RF Bridge should already be prepared.
How to prepare this and a RaspberryPi for it and then install NodeRed on it is described in the following articles.
RaspberryPi – setup for nerdiys!
RaspberryPi – The first configuration!
RaspberryPi – Control the RaspberryPi via SSH
NodeRed – Installing NodeRed on the RaspberryPi
NodeRed – Install new nodes
NodeRed - import and export node code
Sonoff 433Mhz RF Bridge with Tasmota Firmware flashing
Tasmota – Configure Sonoff 433Mhz RF bridge and teach sockets
NodeRed - Create a user interface with dashboard nodes
Required tool:
-no-
Required material:
In the following list you will find all the parts you need to implement this article.
Log into the NodeRed configuration interface
Before you can edit your NodeRed configuration, you must - if activated - first log into the NodeRed configuration interface.
Import node code
In dem folgenden Node-Code ist die Konfiguration enthalten die es Euch ermöglicht bis zu acht Funksteckdosen zu steuern. Dabei ist der Einschalt- und Ausschalt-Befehl jeder Steckdose jeweils einem „FunkButton“(siehe dazu die erwähnen anderen RF Bridge Artikel) zugeordnet.
When you press one of the dashboard switches, either one or the other radio button is pressed.
Außerdem ist im Editor auch eine Anlern-Funktion verfügbar. Dazu muss jeweils die „startLearning“ Injection-Node neben den betreffenden „rfkeys“ betätigt werden. Der Anlernvorgang läuft dann wie in dem Artikel Tasmota – Configure Sonoff 433Mhz RF bridge and teach sockets described.
Node code:
[{"id":"e147a276.af17b","type":"switch","z":"85a0e2c7.3de75","name":"","property":"payload","propertyType":" msg","rules":[{"t":"eq","v":"true","vt":"jsonata"},{"t":"eq","v":"false" ,"vt":"jsonata"}],"checkall":"true","repair":false,"outputs":2,"x":370,"y":260,"wires":[[" d163b7a3.bb9c48"],["cee09e4c.21d6b"]]},{"id":"78c28256.128d9c","type":"mqtt out","z":"85a0e2c7.3de75","name": "rfkey4","topic":"cmnd/RfBridge/rfkey4","qos":"2","retain":"","broker":"b0640582.a49538","x":730,"y" :280,"wires":[]},{"id":"176ed701.494aa9","type":"mqtt out","z":"85a0e2c7.3de75","name":"rfkey3"," topic":"cmnd/RfBridge/rfkey3","qos":"2","retain":"","broker":"b0640582.a49538","x":730,"y":240,"wires ":[]},{"id":"d163b7a3.bb9c48","type":"change","z":"85a0e2c7.3de75","name":"deletePayload","rules":[{" t":"set","p":"payload","pt":"msg","to":"","tot":"str"}],"action":"","property" :"","from":"","to":"","reg":false,"x":560,"y":240,"wires":[["176ed701.494aa9"]]} ,{"id":"cee09e4c.21d6b","type":"change","z":"85a0e2c7.3de75","na me":"deletePayload","rules":[{"t":"set","p":"payload","pt":"msg","to":"","tot":"str "}],"action":"","property":"","from":"","to":"","reg":false,"x":560,"y":280, "wires":[["78c28256.128d9c"]]},{"id":"cce0e599.7753d8","type":"switch","z":"85a0e2c7.3de75","name":"" ,"property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"1","vt":"num"},{" t":"eq","v":"0","vt":"num"}],"checkall":"true","repair":false,"outputs":2,"x":370 ,"y":100,"wires":[["e07ddde5.c1ae9"],["5ebb9f0.1a7006"]]},{"id":"d983158b.e970e8","type":"mqtt out", "z":"85a0e2c7.3de75","name":"rfkey2","topic":"cmnd/RfBridge/rfkey2","qos":"2","retain":"","broker":" b0640582.a49538","x":730,"y":120,"wires":[]},{"id":"e6e1fdc4.aad2b","type":"mqtt out","z":" 85a0e2c7.3de75","name":"rfkey1","topic":"cmnd/RfBridge/rfkey1","qos":"2","retain":"","broker":"b0640582.a49538", "x":730,"y":80,"wires":[]},{"id":"e07ddde5.c1ae9","type":"change","z":"85a0e2c7.3de75"," name":"deletePayload","rules":[{"t":"set","p":"payload","pt":"msg","to":"","tot":"st r"}],"action":"","property":"","from":"","to":"","reg":false,"x":560,"y":80 ,"wires":[["e6e1fdc4.aad2b"]]},{"id":"5ebb9f0.1a7006","type":"change","z":"85a0e2c7.3de75","name":" deletePayload","rules":[{"t":"set","p":"payload","pt":"msg","to":"","tot":"str"}], "action":"","property":"","from":"","to":"","reg":false,"x":560,"y":120,"wires": [["d983158b.e970e8"]]},{"id":"d3934097.a0d6a","type":"switch","z":"85a0e2c7.3de75","name":"","property" :"payload","propertyType":"msg","rules":[{"t":"eq","v":"true","vt":"jsonata"},{"t":" eq","v":"false","vt":"jsonata"}],"checkall":"true","repair":false,"outputs":2,"x":370,"y" :420,"wires":[["350d2090.6f2c8"],["73c351ef.54443"]]},{"id":"27bbe04e.77bb5","type":"mqtt out","z": "85a0e2c7.3de75","name":"rfkey6","topic":"cmnd/RfBridge/rfkey6","qos":"2","retain":"","broker":"b0640582.a49538" ,"x":730,"y":440,"wires":[]},{"id":"b8be8cbb.b50e8","type":"mqtt out","z":"85a0e2c7.3de75" ,"name":"rfkey5","topic":"cmnd/RfBridge/rfkey5","qos":"2","retain":"","broker":"b064058 2.a49538","x":730,"y":400,"wires":[]},{"id":"350d2090.6f2c8","type":"change","z":"85a0e2c7 .3de75","name":"deletePayload","rules":[{"t":"set","p":"payload","pt":"msg","to":""," tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":560," y":400,"wires":[["b8be8cbb.b50e8"]]},{"id":"73c351ef.54443","type":"change","z":"85a0e2c7.3de75"," name":"deletePayload","rules":[{"t":"set","p":"payload","pt":"msg","to":"","tot":"str "}],"action":"","property":"","from":"","to":"","reg":false,"x":560,"y":440, "wires":[["27bbe04e.77bb5"]]},{"id":"c05ff2fe.a086c","type":"inject","z":"85a0e2c7.3de75","name":"On ","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"onceDelay":0.1, "x":370,"y":380,"wires":[["350d2090.6f2c8"]]},{"id":"d38dfaef.b16878","type":"inject","z": "85a0e2c7.3de75","name":"Off","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"", "once":false,"onceDelay":0.1,"x":370,"y":460,"wires":[["73c351ef.54443"]]},{"id":"2153677d.3e2ec8 ","type":"switch","z":"85a0e2c7.3de75","name":"","property":"payload","propertyType":"msg","rules":[{" t":"eq","v":"true","vt":"jsonata"},{"t":"eq","v":"false","vt":"jsonata"}] ,"checkall":"true","repair":false,"outputs":2,"x":370,"y":580,"wires":[["b9fa042d.859af8"],["ef94f3d. 4edc41"]]},{"id":"e2ae277f.cea408","type":"mqtt out","z":"85a0e2c7.3de75","name":"rfkey8","topic":"cmnd /RfBridge/rfkey8","qos":"2","retain":"","broker":"b0640582.a49538","x":730,"y":600,"wires":[]} ,{"id":"866f0df3.fbd51","type":"mqtt out","z":"85a0e2c7.3de75","name":"rfkey7","topic":"cmnd/RfBridge/rfkey7" ,"qos":"2","retain":"","broker":"b0640582.a49538","x":730,"y":560,"wires":[]},{"id" :"b9fa042d.859af8","type":"change","z":"85a0e2c7.3de75","name":"deletePayload","rules":[{"t":"set","p" :"payload","pt":"msg","to":"","tot":"str"}],"action":"","property":"","from":"" ,"to":"","reg":false,"x":560,"y":560,"wires":[["866f0df3.fbd51"]]},{"id":"ef94f3d.4edc41 ","type":"change","z":"85a0e2c7.3de75","name":"deletePayload","rul es":[{"t":"set","p":"payload","pt":"msg","to":"","tot":"str"}],"action": "","property":"","from":"","to":"","reg":false,"x":560,"y":600,"wires":[["e2ae277f .cea408"]]},{"id":"42949be6.f069c4","type":"inject","z":"85a0e2c7.3de75","name":"startLearning","topic":"" ,"payload":"2","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":570," y":520,"wires":[["866f0df3.fbd51"]]},{"id":"1724b816.f2dae8","type":"ui_switch","z":"85a0e2c7.3de75"," name":"","label":"Socket1 On/off","group":"fc2f2879.ca14f8","order":15,"width":0,"height":0,"passthru":true ,"decouple":"false","topic":"","style":"","onvalue":"true","onvalueType":"bool","onicon":"","oncolor": "","offvalue":"false","offvalueType":"bool","officon":"","offcolor":"","x":180,"y":100,"wires":[ ["cce0e599.7753d8"]]},{"id":"2dd5b519.cf0ada","type":"ui_switch","z":"85a0e2c7.3de75","name":"","label": "Socket2 On/off","group":"fc2f2879.ca14f8","order":16,"width":0,"height":0,"passthru":true,"decouple":"false"," topic":"","style":"" ,"onvalue":"true","onvalueType":"bool","onicon":"","oncolor":"","offvalue":"false","offvalueType":"bool","officon" :"","offcolor":"","x":180,"y":260,"wires":[["e147a276.af17b"]]},{"id":"b190894a.45af98"," type":"ui_switch","z":"85a0e2c7.3de75","name":"","label":"Socket3 On/off","group":"fc2f2879.ca14f8","order":17 ,"width":0,"height":0,"passthru":true,"decouple":"false","topic":"","style":"","onvalue":"true"," onvalueType":"bool","onicon":"","oncolor":"","offvalue":"false","offvalueType":"bool","officon":"","offcolor":"" ,"x":180,"y":420,"wires":[["d3934097.a0d6a"]]},{"id":"7c9553f2.a1f12c","type":"ui_switch","z" :"85a0e2c7.3de75","name":"","label":"Socket4 On/off","group":"fc2f2879.ca14f8","order":18,"width":0,"height" :0,"passthru":true,"decouple":"false","topic":"","style":"","onvalue":"true","onvalueType":"bool","onicon" :"","oncolor":"","offvalue":"false","offvalueType":"bool","officon":"","offcolor":"","x":180,"y" :580,"wires":[["2153677d.3e2ec8"]]},{"id":"159a8f08.263f21","type":"switch" ,"z":"85a0e2c7.3de75","name":"","property":"payload","propertyType":"msg","rules":[{"t":"eq","v ":"true","vt":"jsonata"},{"t":"eq","v":"false","vt":"jsonata"}],"checkall":"true", "repair":false,"outputs":2,"x":1190,"y":100,"wires":[["4d2cd0cc.7c157"],["17f1e098.93ad9f"]]},{"id ":"1d9521f1.53b97e","type":"mqtt out","z":"85a0e2c7.3de75","name":"rfkey10","topic":"cmnd/RfBridge/rfkey10","qos" :"2","retain":"","broker":"b0640582.a49538","x":1560,"y":120,"wires":[]},{"id":"83c3b0fb. cd413","type":"mqtt out","z":"85a0e2c7.3de75","name":"rfkey9","topic":"cmnd/RfBridge/rfkey9","qos":"2", "retain":"","broker":"b0640582.a49538","x":1550,"y":80,"wires":[]},{"id":"4d2cd0cc.7c157","type ":"change","z":"85a0e2c7.3de75","name":"deletePayload","rules":[{"t":"set","p":"payload","pt": "msg","to":"","tot":"str"}],"action":"","property":"","from":"","to":""," reg":false,"x":1380,"y":80,"wires":[["83c3b0fb.cd413"]]},{"id":"17f1e098.93ad9f","type":"change" ,"z":"85a0e2c7.3de75","name":"deletePayload","rules":[{"t":"se t","p":"payload","pt":"msg","to":"","tot":"str"}],"action":"","property":"", "from":"","to":"","reg":false,"x":1380,"y":120,"wires":[["1d9521f1.53b97e"]]},{"id ":"b3acb73.9112148","type":"ui_switch","z":"85a0e2c7.3de75","name":"","label":"Socket5 On/off","group":"fc2f2879 .ca14f8","order":14,"width":0,"height":0,"passthru":true,"decouple":"false","topic":"","style":"", "onvalue":"true","onvalueType":"bool","onicon":"","oncolor":"","offvalue":"false","offvalueType":"bool","officon": "","offcolor":"","x":1000,"y":100,"wires":[["159a8f08.263f21"]]},{"id":"bd33b831.e9f3a8","type ":"switch","z":"85a0e2c7.3de75","name":"","property":"payload","propertyType":"msg","rules":[{"t":" eq","v":"true","vt":"jsonata"},{"t":"eq","v":"false","vt":"jsonata"}],"checkall" :"true","repair":false,"outputs":2,"x":1190,"y":260,"wires":[["35d273b9.ddaffc"],["f5825eab.2f556"]] },{"id":"7d8e5d28.23a814","type":"mqtt out","z":"85a0e2c7.3de75","name":"rfkey12","topic":"cmnd/RfBridge/rfkey12 ","qos":"2","retain":"","broker": "b0640582.a49538","x":1560,"y":280,"wires":[]},{"id":"57ac0ccb.424164","type":"mqtt out","z": "85a0e2c7.3de75","name":"rfkey11","topic":"cmnd/RfBridge/rfkey11","qos":"2","retain":"","broker":"b0640582.a49538" ,"x":1560,"y":240,"wires":[]},{"id":"35d273b9.ddaffc","type":"change","z":"85a0e2c7.3de75", "name":"deletePayload","rules":[{"t":"set","p":"payload","pt":"msg","to":"","tot":" str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1380,"y":240 ,"wires":[["57ac0ccb.424164"]]},{"id":"f5825eab.2f556","type":"change","z":"85a0e2c7.3de75","name":" deletePayload","rules":[{"t":"set","p":"payload","pt":"msg","to":"","tot":"str"}], "action":"","property":"","from":"","to":"","reg":false,"x":1380,"y":280,"wires": [["7d8e5d28.23a814"]]},{"id":"321594d6.cd72ac","type":"ui_switch","z":"85a0e2c7.3de75","name":"","label" :"Socket6 On/off","group":"fc2f2879.ca14f8","order":14,"width":0,"height":0,"passthru":true,"decouple":"false", "topic":"","style":"","onvalue":"true","onvalueType":"bool","o nicon":"","oncolor":"","offvalue":"false","offvalueType":"bool","officon":"","offcolor":"","x":1000," y":260,"wires":[["bd33b831.e9f3a8"]]},{"id":"2f77ddc5.90ace2","type":"mqtt out","z":"85a0e2c7.3de75", "name":"rfkey13","topic":"cmnd/RfBridge/rfkey13","qos":"2","retain":"","broker":"b0640582.a49538","x":1560 ,"y":400,"wires":[]},{"id":"9c3cddc3.ca54d","type":"mqtt out","z":"85a0e2c7.3de75","name":" rfkey14","topic":"cmnd/RfBridge/rfkey14","qos":"2","retain":"","broker":"b0640582.a49538","x":1560,"y": 440,"wires":[]},{"id":"b37224f8.495ba8","type":"switch","z":"85a0e2c7.3de75","name":"","property": "payload","propertyType":"msg","rules":[{"t":"eq","v":"true","vt":"jsonata"},{"t":"eq ","v":"false","vt":"jsonata"}],"checkall":"true","repair":false,"outputs":2,"x":1190,"y": 420,"wires":[["9b517b14.dacb48"],["c31e33c1.ad813"]]},{"id":"9b517b14.dacb48","type":"change","z":"85a0e2c7 .3de75","name":"deletePayload","rules":[{"t":"set","p":"payload","pt":"msg","to":""," tot":"str"}],"action":"","property ":"","from":"","to":"","reg":false,"x":1380,"y":400,"wires":[["2f77ddc5.90ace2"]] },{"id":"c31e33c1.ad813","type":"change","z":"85a0e2c7.3de75","name":"deletePayload","rules":[{"t":" set","p":"payload","pt":"msg","to":"","tot":"str"}],"action":"","property":"", "from":"","to":"","reg":false,"x":1380,"y":440,"wires":[["9c3cddc3.ca54d"]]},{"id ":"24f017fd.046528","type":"ui_switch","z":"85a0e2c7.3de75","name":"","label":"Socket7 On/off","group":"fc2f2879 .ca14f8","order":13,"width":0,"height":0,"passthru":true,"decouple":"false","topic":"","style":"", "onvalue":"true","onvalueType":"bool","onicon":"","oncolor":"","offvalue":"false","offvalueType":"bool","officon": "","offcolor":"","x":1000,"y":420,"wires":[["b37224f8.495ba8"]]},{"id":"c60358d3.8d7138","type ":"mqtt out","z":"85a0e2c7.3de75","name":"rfkey15","topic":"cmnd/RfBridge/rfkey15","qos":"2","retain":" ","broker":"b0640582.a49538","x":1560,"y":560,"wires":[]},{"id":"350828ac.655ee8","type":"mqtt out ","z":"85a0e2c7.3de75","name":"rfkey16"," topic":"cmnd/RfBridge/rfkey16","qos":"2","retain":"","broker":"b0640582.a49538","x":1560,"y":600,"wires ":[]},{"id":"aebec679.5ab078","type":"switch","z":"85a0e2c7.3de75","name":"","property":"payload", "propertyType":"msg","rules":[{"t":"eq","v":"true","vt":"jsonata"},{"t":"eq","v ":"false","vt":"jsonata"}],"checkall":"true","repair":false,"outputs":2,"x":1190,"y":580,"wires ":[["640931dc.d4c14"],["d2c61d3e.9630b"]]},{"id":"640931dc.d4c14","type":"change","z":"85a0e2c7.3de75", "name":"deletePayload","rules":[{"t":"set","p":"payload","pt":"msg","to":"","tot":" str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1380,"y":560 ,"wires":[["c60358d3.8d7138"]]},{"id":"d2c61d3e.9630b","type":"change","z":"85a0e2c7.3de75","name":" deletePayload","rules":[{"t":"set","p":"payload","pt":"msg","to":"","tot":"str"}], "action":"","property":"","from":"","to":"","reg":false,"x":1380,"y":600,"wires": [["350828ac.655ee8"]]},{"id":"25d5a06b.210d1","type":"ui_switch","z":"85a0e2c7.3de75","name":""," label":"Socket8 On/off","group":"fc2f2879.ca14f8","order":13,"width":0,"height":0,"passthru":true,"decouple":"false ","topic":"","style":"","onvalue":"true","onvalueType":"bool","onicon":"","oncolor":"","offvalue": "false","offvalueType":"bool","officon":"","offcolor":"","x":1000,"y":580,"wires":[["aebec679.5ab078"] ]},{"id":"a2ebd0cf.27bdd","type":"inject","z":"85a0e2c7.3de75","name":"startLearning","topic":"","payload" :"2","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":570,"y":640 ,"wires":[["e2ae277f.cea408"]]},{"id":"8284ddc1.d8915","type":"inject","z":"85a0e2c7.3de75","name":" startLearning","topic":"","payload":"2","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay": 0.1,"x":570,"y":480,"wires":[["27bbe04e.77bb5"]]},{"id":"ba60eb83.4b95c8","type":"inject","z ":"85a0e2c7.3de75","name":"startLearning","topic":"","payload":"2","payloadType":"str","repeat":"","crontab": "","once":false,"onceDelay":0.1,"x":1390,"y":40,"wires":[["83c3b0fb.cd413" ]]},{"id":"f093de6c.73531","type":"inject","z":"85a0e2c7.3de75","name":"startLearning","topic":"","payload ":"2","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":1390,"y": 160,"wires":[["1d9521f1.53b97e"]]},{"id":"c3bfdb1a.3da768","type":"inject","z":"85a0e2c7.3de75","name": "startLearning","topic":"","payload":"2","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay" :0.1,"x":1390,"y":200,"wires":[["57ac0ccb.424164"]]},{"id":"890bc90.0052d38","type":"inject"," z":"85a0e2c7.3de75","name":"startLearning","topic":"","payload":"2","payloadType":"str","repeat":"","crontab" :"","once":false,"onceDelay":0.1,"x":1390,"y":320,"wires":[["7d8e5d28.23a814"]]},{"id":"cec0bd12 .7c803","type":"inject","z":"85a0e2c7.3de75","name":"startLearning","topic":"","payload":"2","payloadType":" str","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":1390,"y":360,"wires":[["2f77ddc5. 90ace2"]]},{"id":"48bbc301.34783c","type":"inject","z":"85a0e2c7.3de75","name":"start Learning","topic":"","payload":"2","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay": 0.1,"x":1390,"y":480,"wires":[["9c3cddc3.ca54d"]]},{"id":"9b6ca9d1.0a6838","type":"inject","z ":"85a0e2c7.3de75","name":"startLearning","topic":"","payload":"2","payloadType":"str","repeat":"","crontab": "","once":false,"onceDelay":0.1,"x":570,"y":40,"wires":[["e6e1fdc4.aad2b"]]},{"id":"68b7290a. 1f1118","type":"inject","z":"85a0e2c7.3de75","name":"startLearning","topic":"","payload":"2","payloadType":"str ","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":570,"y":160,"wires":[["d983158b.e970e8 "]]},{"id":"75cb1e74.b91b9","type":"inject","z":"85a0e2c7.3de75","name":"startLearning","topic":""," payload":"2","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":570,"y" :200,"wires":[["176ed701.494aa9"]]},{"id":"7957560f.2acd18","type":"inject","z":"85a0e2c7.3de75","name" :"startLearning","topic":"","payload":"2","payloadType":"str","repeat":"","crontab":"","on ce":false,"onceDelay":0.1,"x":570,"y":320,"wires":[["78c28256.128d9c"]]},{"id":"83be3b00.44b988"," type":"inject","z":"85a0e2c7.3de75","name":"startLearning","topic":"","payload":"2","payloadType":"str","repeat ":"","crontab":"","once":false,"onceDelay":0.1,"x":570,"y":360,"wires":[["b8be8cbb.b50e8"]]} ,{"id":"f3a51dca.efc73","type":"inject","z":"85a0e2c7.3de75","name":"On","topic":"","payload":" ","payloadType":"date","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":370,"y":220,"wires ":[["d163b7a3.bb9c48"]]},{"id":"1408fffa.6a576","type":"inject","z":"85a0e2c7.3de75","name":"On", "topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x ":370,"y":60,"wires":[["e07ddde5.c1ae9"]]},{"id":"883f22f2.f5fed","type":"inject","z":"85a0e2c7 .3de75","name":"On","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once ":false,"onceDelay":0.1,"x":370,"y":540,"wires":[["b9fa042d.859af8"]]},{"id":"72e8f63a.9934c8","type ":"inject","z":"8 5a0e2c7.3de75","name":"On","topic":"","payload":"","payloadType":"date","repeat":"","crontab":""," once":false,"onceDelay":0.1,"x":1190,"y":60,"wires":[["4d2cd0cc.7c157"]]},{"id":"e5b82da3.0b1e6"," type":"inject","z":"85a0e2c7.3de75","name":"On","topic":"","payload":"","payloadType":"date","repeat" :"","crontab":"","once":false,"onceDelay":0.1,"x":1190,"y":220,"wires":[["35d273b9.ddaffc"]]}, {"id":"8bbbd5f2.140c78","type":"inject","z":"85a0e2c7.3de75","name":"On","topic":"","payload":"" ,"payloadType":"date","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":1190,"y":380,"wires" :[["9b517b14.dacb48"]]},{"id":"c87235cf.86dac8","type":"inject","z":"85a0e2c7.3de75","name":"On"," topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x" :1190,"y":540,"wires":[["640931dc.d4c14"]]},{"id":"e3ccc391.bcf7f","type":"inject","z":"85a0e2c7. 3de75","name":"Off","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once" :false,"onceDelay":0. 1,"x":370,"y":140,"wires":[["5ebb9f0.1a7006"]]},{"id":"f26e4793.080618","type":"inject","z ":"85a0e2c7.3de75","name":"Off","topic":"","payload":"","payloadType":"date","repeat":"","crontab":" ","once":false,"onceDelay":0.1,"x":370,"y":300,"wires":[["cee09e4c.21d6b"]]},{"id":"b8016add.69fe38 ","type":"inject","z":"85a0e2c7.3de75","name":"Off","topic":"","payload":"","payloadType":"date", "repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":370,"y":620,"wires":[["ef94f3d.4edc41"] ]},{"id":"257528d.30313d8","type":"inject","z":"85a0e2c7.3de75","name":"Off","topic":"","payload" :"","payloadType":"date","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":1190,"y":140, "wires":[["17f1e098.93ad9f"]]},{"id":"976a27b3.c8a938","type":"inject","z":"85a0e2c7.3de75","name":"Off ","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"onceDelay":0.1, "x":1190,"y":300,"wires":[["f5825eab.2f556"]]},{"id":"7b4af0bf.6361b","type":"inject","z": "85a0e2c7.3de75","name":"Off", "topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x ":1190,"y":460,"wires":[["c31e33c1.ad813"]]},{"id":"f55973ab.06d8","type":"inject","z":"85a0e2c7 .3de75","name":"Off","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once ":false,"onceDelay":0.1,"x":1190,"y":620,"wires":[["d2c61d3e.9630b"]]},{"id":"b0640582.a49538","type ":"mqtt-broker","z":"","name":"Server-Mqtt","broker":"server.fritz.box","port":"1883","clientid":" ","usetls":false,"compatmode":true,"keepalive":"60","cleansession":true,"birthTopic":"","birthQos":"0","birthPayload":"", "closeTopic":"","closeQos":"0","closePayload":"","willTopic":"","willQos":"0","willPayload":""},{"id": "fc2f2879.ca14f8","type":"ui_group","z":"","name":"Light","tab":"d651a8eb.fefb38","disp":true,"width":" 6","collapse":false},{"id":"d651a8eb.fefb38","type":"ui_tab","z":"","name":"Home","icon":"dashboard "}]
Have fun with the project
I hope everything worked as described for you. If not or you have questions or suggestions please let me know in the comments. I will then add this to the article if necessary.
Ideas for new projects are always welcome. 🙂
PS Many of these projects - especially the hardware projects - cost a lot of time and money. Of course I do this because I enjoy it, but if you think it's cool that I share the information with you, I would be happy about a small donation to the coffee fund. 🙂
Good day,
first of all thanks for the code.
I only have 1 problem here, after importing, the sockets 1 -8 do not appear for me, but unknown; ui switch.
It seems that Red Node is missing the corresponding module.
Or am I doing something wrong?!
Which ones still need to be installed?
Thanks very much!
Hey Michael,
You've done everything right. 🙂 At the time I wrote the article, I didn't write which additional nodes are required for this.
The node "node-red-dashboard" is required for this. You can find more information about this in this article https://nerdiy.de/nodered-mit-dashboard-nodes-eine-benutzeroberflaeche-erstellen/
I hope everything works out. 🙂
Best regards
Fabian
Hi Fabian,
First of all, your posts are super informative and written with a lot of passion. TOP!
I had already figured that out with the dashboard.
I'll read through your instructions on how to do this.
A little bit about my project:
I have 3 RF PIR sensors and various RF remote controls here.
These should later be able to switch on several existing Shellys in the garden via Node.
I have already been able to learn the codes via the console but also via your flow.
Mqtt receiving the codes also works.
Thank you again for that.
What I can't do yet is that the Shellys are switched on via Node as soon as a key is received.
Maybe you have another tip here? Somehow I'm missing the right interface between RF Bridge and Shellys.
Thanks very much!
Hey Michael,
Thanks very much. Glad to read that the work paid off. 🙂
So if I understood correctly, you are already receiving the codes from the radio remote controls and now you "only" want to forward this signal to the Shellys?
Did you flash the Shellys with Tasmota or if not connected the MQTT client (of the Shellys) to your server? 🙂
If so, all you really have to do is set up a forwarding, right?
Best regards
Fabian
Hi,
Yes, that's exactly how it is.
Signals are all received, learning also works.
The Shellys here in the house all run on original firmware.
It is both possible to address / switch them via MQTT but also via Shelly Node.
Here I am in the process of switching to MQTT in the node, as this is simply more flexible and opens up even more possibilities. So 1 test Shelly is already registered on the MQTT server, that works wonderfully.
What I'm missing is the bridge between the two systems, like you said, the forwarding.
So a node that receives the corresponding RFKEY and then msg. on or off sends via MQTT.
You can tinker with the existing Alexa Home connection in between 🙂
I'm kind of stuck there.
Thanks very much!
Hi Michael,
if I understood it correctly, you actually only need the "change" node. This receives a message and can assign a new value to msg.payload.
In principle it could look like this:
[Power on command from remote control]->[change node: msg.payload=on]->[Redirect to shelly]
The same then again for the switch-off command. 🙂
I hope you can understand what I mean. 🙂
Best regards
Fabian
Hi Fabian,
finally I got a usable result applicable over HTTP as well as over MQTT.
I also had to add a filter that splits the signals from the RF remote control.
Since several signals are sent with one keystroke.
You can have a look at that 😉
With your consent, the flow can be shared. Maybe it will be of help to one or the other.
I took over your learning nodes because it's super handy.
I hope that is ok.
Thank you again!
And the flow:
[{"id":"a5966690.fab85″,"type":"tab","label":"Flow 2 RF Bridge","disabled":false,"info":""},{"id": "8a54e2d8.b9da58″,"type":"debug","z":"a5966690.fab85″,"name":"","active":true,"tosidebar":true,"console":false," tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":770,"y":1040,"wires ":[]},{"id":"78c28256.128d9c","type":"mqtt out","z":"a5966690.fab85","name":"rfkey4","topic":"cmnd /RfBridge/rfkey4","qos":"2","retain":"","broker":"2feb2429.245e84","x":290,"y":240,"wires":[]} ,{"id":"176ed701.494aa9","type":"mqtt out","z":"a5966690.fab85","name":"rfkey3","topic":"cmnd/RfBridge/rfkey3" ,"qos":"2","retain":"","broker":"2feb2429.245e84","x":290,"y":180,"wires":[]},{"id" :"d983158b.e970e8","type":"mqtt out","z":"a5966690.fab85","name":"rfkey2","topic":"cmnd/RfBridge/rfkey2","qos": "2″,"retain":"","broker":"2feb2429.245e84″,"x":290,"y":120,"wires":[]},{"id":"e6e1fdc4.aad2b ","type":"mqtt out","z":"a5966690.fab85","name":"rfkey1","topic":"cmnd/RfBridge/rfkey1", "qos":"2","retain":"","broker":"2feb2429.245e84","x":290,"y":60,"wires":[]},{"id": "27bbe04e.77bb5","type":"mqtt out","z":"a5966690.fab85","name":"rfkey6","topic":"cmnd/RfBridge/rfkey6","qos":" 2″,"retain":"","broker":"2feb2429.245e84″,"x":290,"y":360,"wires":[]},{"id":"b8be8cbb.b50e8" ,"type":"mqtt out","z":"a5966690.fab85","name":"rfkey5","topic":"cmnd/RfBridge/rfkey5","qos":"2","retain ":"","broker":"2feb2429.245e84″,"x":290,"y":300,"wires":[]},{"id":"e2ae277f.cea408″,"type": "mqtt out","z":"a5966690.fab85","name":"rfkey8","topic":"cmnd/RfBridge/rfkey8","qos":"2","retain":"", "broker":"2feb2429.245e84","x":290,"y":480,"wires":[]},{"id":"866f0df3.fbd51","type":"mqtt out", "z":"a5966690.fab85","name":"rfkey7","topic":"cmnd/RfBridge/rfkey7","qos":"2","retain":"","broker":" 2feb2429.245e84","x":290,"y":420,"wires":[]},{"id":"42949be6.f069c4","type":"inject","z":"a5966690 .fab85″,"name":"startLearning","repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":" 2″,"payloadType":"s tr","x":130,"y":420,"wires":[["866f0df3.fbd51"]]},{"id":"233fbe11.5cd2da","type":"mqtt out", "z":"a5966690.fab85","name":"rfkey10","topic":"cmnd/RfBridge/rfkey10","qos":"2","retain":"","broker":" 2feb2429.245e84″,"x":640,"y":120,"wires":[]},{"id":"204c4bab.3ab5a4″,"type":"mqtt out","z":" a5966690.fab85","name":"rfkey9","topic":"cmnd/RfBridge/rfkey9","qos":"2","retain":"","broker":"2feb2429.245e84", "x":630,"y":60,"wires":[]},{"id":"f750bbd7.d8dbf8","type":"mqtt out","z":"a5966690.fab85", "name":"rfkey12","topic":"cmnd/RfBridge/rfkey12","qos":"2","retain":"","broker":"2feb2429.245e84","x":640 ,"y":240,"wires":[]},{"id":"fc1cfb8.b038608″,"type":"mqtt out","z":"a5966690.fab85″,"name":" rfkey11","topic":"cmnd/RfBridge/rfkey11","qos":"2","retain":"","broker":"2feb2429.245e84","x":640,"y": 180,"wires":[]},{"id":"a0163ac.409f048","type":"mqtt out","z":"a5966690.fab85","name":"rfkey13","topic ":"cmnd/RfBridge/rfkey13","qos":"2","retain":"","broker":"2feb2429.245e84","x":640,"y":300,"wires" :[]},{"id":"1 59d7acc.0b8045","type":"mqtt out","z":"a5966690.fab85","name":"rfkey14","topic":"cmnd/RfBridge/rfkey14","qos":"2 ″,"retain":"","broker":"2feb2429.245e84″,"x":640,"y":360,"wires":[]},{"id":"e570aeb8.182bd8″, "type":"mqtt out","z":"a5966690.fab85","name":"rfkey15","topic":"cmnd/RfBridge/rfkey15","qos":"2","retain" :"","broker":"2feb2429.245e84″,"x":640,"y":420,"wires":[]},{"id":"3ab75646.4111a2″,"type":" mqtt out","z":"a5966690.fab85","name":"rfkey16","topic":"cmnd/RfBridge/rfkey16","qos":"2","retain":""," broker":"2feb2429.245e84","x":640,"y":480,"wires":[]},{"id":"a2ebd0cf.27bdd","type":"inject","z ":"a5966690.fab85","name":"startLearning","repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","" payload":"2","payloadType":"str","x":130,"y":480,"wires":[["e2ae277f.cea408"]]},{"id":"8284ddc1. d8915″,"type":"inject","z":"a5966690.fab85″,"name":"startLearning","repeat":"","crontab":"","once":false," onceDelay":0.1,"topic":"","payload":"2″,"payloadType":"str","x":130,"y":360,"wires":[["27b be04e.77bb5"]]},{"id":"ba60eb83.4b95c8″,"type":"inject","z":"a5966690.fab85","name":"startLearning","repeat":" ","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"2″,"payloadType":"str","x":470, "y":60,"wires":[["204c4bab.3ab5a4"]]},{"id":"f093de6c.73531","type":"inject","z":"a5966690.fab85", "name":"startLearning","repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"2″," payloadType":"str","x":470,"y":120,"wires":[["233fbe11.5cd2da"]]},{"id":"c3bfdb1a.3da768″,"type":" inject","z":"a5966690.fab85","name":"startLearning","repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic" :"","payload":"2″,"payloadType":"str","x":470,"y":180,"wires":[["fc1cfb8.b038608"]]},{"id ":"890bc90.0052d38","type":"inject","z":"a5966690.fab85","name":"startLearning","repeat":"","crontab":"","once ":false,"onceDelay":0.1,"topic":"","payload":"2″,"payloadType":"str","x":470,"y":240,"wires":[ ["f750bbd7.d8dbf8"]]},{"id":"cec0bd12.7c803","type":"inject","z":"a5966690.fab85","name" :"startLearning","repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"2″,"payloadType": "str","x":470,"y":300,"wires":[["a0163ac.409f048"]]},{"id":"48bbc301.34783c","type":"inject", "z":"a5966690.fab85","name":"startLearning","props":[{"p":"payload","v":"2","vt":"str"},{ "p":"topic","v":"","vt":"string"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1 ,"topic":"","payload":"2″,"payloadType":"str","x":470,"y":360,"wires":[["159d7acc.0b8045"]]} ,{"id":"9b6ca9d1.0a6838","type":"inject","z":"a5966690.fab85","name":"startLearning","repeat":"","crontab":" ","once":false,"onceDelay":0.1,"topic":"","payload":"2","payloadType":"str","x":130,"y":60," wires":[["e6e1fdc4.aad2b"]]},{"id":"68b7290a.1f1118","type":"inject","z":"a5966690.fab85","name":"startLearning" ,"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"2″,"payloadType":"str", "x":130,"y":120,"wires":[["d983158b.e970e8"]]},{"id":"75cb1e74.b91b9″,"type":"inject","z": "a5966690.fab85″,"name":"s tartLearning","repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"2″,"payloadType":"str ","x":130,"y":180,"wires":[["176ed701.494aa9"]]},{"id":"7957560f.2acd18","type":"inject","z ":"a5966690.fab85","name":"startLearning","repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","" payload":"2","payloadType":"str","x":130,"y":240,"wires":[["78c28256.128d9c"]]},{"id":"83be3b00. 44b988″,"type":"inject","z":"a5966690.fab85″,"name":"startLearning","repeat":"","crontab":"","once":false," onceDelay":0.1,"topic":"","payload":"2″,"payloadType":"str","x":130,"y":300,"wires":[["b8be8cbb.b50e8 "]]},{"id":"83796195.4cbd78","type":"change","z":"a5966690.fab85","name":"ON VIA HTTP","rules":[{" t":"set","p":"payload","pt":"msg","to":"on","tot":"str"}],"action":"","property ":"","from":"","to":"","reg":false,"x":660,"y":700,"wires":[["b29c50c1.60af38"]] },{"id":"aefa120e.08cec8","type":"mqtt in","z":"a5966690.fab85","name":"","topic":"tele/RfBridge/RESULT" ,"qos":"2″,"datatype":"au to","broker":"2feb2429.245e84″,"x":180,"y":760,"wires":[["4412f309.c8dd0c","8a54e2d8.b9da58″]]},{"id" :"9ad5229.c043c6″,"type":"inject","z":"a5966690.fab85″,"name":"ON","props":[{"p":"payload"},{" p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"", "payload":"on","payloadType":"str","x":650,"y":740,"wires":[["b29c50c1.60af38"]]},{"id":"b29c50c1 .60af38","type":"function","z":"a5966690.fab85","name":"turn relay on/off","func":"var x = msg.payload;\nvar IP = \"192.168.178.103\";\nmsg.url= \"http://\"+ IP + \"/relay/0\";\n\nmsg.payload = \"turn=\" + x;\ nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":880,"y":760,"wires":[[" e2fe56f9.77e258"]]},{"id":"f381d688.c77088″,"type":"inject","z":"a5966690.fab85″,"name":"OFF","repeat":" ","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"off","payloadType":"str","x":650, "y":780,"wires":[["b29c50c1.60af38"]]},{"id":"e2fe56f9.77e258","type":"http request","z":"a5966690.fab85" ,"Surname":" ","method":"POST","ret":"obj","paytoqs":"ignore","url":"","tls":"","persist":false,"proxy": "","authType":"","x":1070,"y":760,"wires":[["8a54e2d8.b9da58"]]},{"id":"4412f309.c8dd0c","type ":"switch","z":"a5966690.fab85″,"name":"FILTER RF SIGNAL","property":"payload","propertyType":"msg","rules":[{"t ":"cont","v":"\"RfKey\":1″,"vt":"str"},{"t":"cont","v":"\"RfKey\":2 ″,"vt":"str"}],"checkall":"true","repair":false,"outputs":2,"x":430,"y":760,"wires":[[ "1e42d44f.ed73ec"],["ae7ef696.85c208"]]},{"id":"b722adfd.a9572","type":"change","z":"a5966690.fab85","name": "OFF VIA HTTP","rules":[{"t":"set","p":"payload","pt":"msg","to":"off","tot":"str "}],"action":"","property":"","from":"","to":"","reg":false,"x":660,"y":820, "wires":[["b29c50c1.60af38"]]},{"id":"faddf7fe.33081","type":"mqtt out","z":"a5966690.fab85","name":" ","topic":"shellies/Nils/relay/0/command","qos":"2″,"retain":"false","broker":"2feb2429.245e84″,"x":1430, "y":760,"wires":[]},{"id":"1e42d44f.ed73ec","type":"change","z":"a5966690.fab85 ″,"name":"ON VIA MQTT","rules":[{"t":"set","p":"payload","pt":"msg","to":"on", "tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":660, "y":660,"wires":[["faddf7fe.33081"]]},{"id":"ae7ef696.85c208","type":"change","z":"a5966690.fab85", "name":"OFF VIA MQTT","rules":[{"t":"set","p":"payload","pt":"msg","to":"off","tot ":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":660,"y ":860,"wires":[["faddf7fe.33081"]]},{"id":"481b88e6.de22d8","type":"mqtt in","z":"a5966690.fab85"," name":"Shelly ID Reader","topic":"shellies/#","qos":"2″,"datatype":"auto","broker":"2feb2429.245e84","x":1080 ,"y":940,"wires":[["c22df741.ef5f9"]]},{"id":"31db797e.3f6f66","type":"inject","z":"a5966690.fab85" ,"name":"startLearning","props":[{"p":"payload","v":"2″,"vt":"str"},{"p":"topic"," v":"","vt":"string"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","" payload":"2","payloadType":"str","x":470,"y":420,"wires":[["e570aeb8.182bd8"]]},{"id":"f64ee4de. 532a9″,“ty pe":"inject","z":"a5966690.fab85","name":"startLearning","props":[{"p":"payload","v":"2","vt" :"str"},{"p":"topic","v":"","vt":"string"}],"repeat":"","crontab":"","once": false,"onceDelay":0.1,"topic":"","payload":"2″,"payloadType":"str","x":470,"y":480,"wires":[[" 3ab75646.4111a2"]]},{"id":"c22df741.ef5f9″,"type":"debug","z":"a5966690.fab85″,"name":"","active":true, "tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":1340,"y" :940,"wires":[]},{"id":"2feb2429.245e84","type":"mqtt-broker","name":"PI MQTT","broker":"192.168.178.71" ,"port":"1883","clientid":"","usetls":false,"compatmode":true,"keepalive":"60","cleansession":true,"birthTopic":""," birthQos":"0","birthPayload":"","closeTopic":"","closeQos":"0","closePayload":"","willTopic":"","willQos":"0" ,"willPayload":""}]
Hey Michael,
great, glad to hear it. Of course I would like to include that. Unfortunately I can't import the code. I believe this is because the comment function filters some of the values here.
Can you send me the code again via pastebin or via e-mail/contact form? 🙂
Many thanks in advance and best regards
Fabian