Skip to content

Shelly Relais zum Schalten von Leuchten

H. Klages edited this page Sep 23, 2020 · 17 revisions

Shelly Relais sind kostengünstige Relais (10 Euro), die in Unterputzdosen verbaut werden. Sie können über WLAN (REST API, MQTT) in die Hausautomation (ioBroker, FHEM, Node-RED, Alexa, ...) eingebunden werden.

Voraussetzungen: Freien Platz und Strom (Phase, Nulleiter) in der Lichtschalter-Unterputzdose

Welche Modelle gibt es: Shelly homepage

Meine Einsatzbereiche

1. Standard Lichtschalter mit standard LED Leuchte: Shelly 1

Die LED Leuchte wird über RedMatic und Alexa geschaltet. Der vorhandene Lichtschalter ist weiterhin funktionsfähig.

Vorteil: Automation zu geringen Kosten.

2. Homematic IP 2-fach Lichtschalter mit Standard LED Leuchte: Shelly 2.5

Da nicht genügend Platz in der Lichtschalter-Unterputzdose vorhanden war, wurde der Lichtschalter ausgebaut und durch einen Homematic IP 2-fach Schalter ersetzt. Dieser steuert das Deckenlicht und die Spiegelampe. Das Deckenlicht wird zusätzlich über einen Präsenzmelder und Alexa Kommandos aktiviert.

Vorteil: Automation mit Präsenzmelder und Alexa.

3. Homematic IP 6-fach Lichtschalter mit 3 Philips HUE Leuchten: Shelly 1

Es ist eine Leuchtenleiste mit drei Leuchten installiert. Je nach Nutzung wird nur eine oder mehrere Leuchten eingeschaltet - auch gedimmt (Hue Szenen) Über den 6-fach Schalter können die einzelnen Leuchten geschaltet plus Szenen aktiviert werden.

Vorteil: Beste Nutzung der drei Leuchten. Außerdem wird vermieden, dass versehentlich der Schalter betätigt wird und die HUE Lampe keinen Strom hat - somit nicht mehr schaltbar ist (das typische Philips Hue Problem).

Physische Installation der Shelly durch Elektriker.

Das Shelly1 Relais wird in die Lichtschalter-Unterputzdose verbaut. Anleitung

Das Shelly2.5 Relais wird analog verbaut. Anleitung Die beiden L Anschlusse werden intern überbrückt.

Software Installation für RedMatic (Node-RED) und MQTT

Die Shelly App bzw. die Shelly Cloud wird nicht genutzt.

MQTT wird in diesem Video gut erläutert: Shelly MQTT

  1. Installation RedMatic
  2. Als MQTT Broker/Server: node-red-contrib-aedes oder Mosquito, Homematic MQTT Add on, ...
  3. Homematic IP Scripte um die Kanäle für die Homematic IP Schalter zu aktivieren

Settings und flows Beispiel 1

Settings:

  • POWER ON DEFAULT MODE: Restore last mode
  • BUTTON TYPE: Edge Switch

Internet & Security

  • WIFI MODE - CLIENT: yes, mein WLAN, IP statisch: 192.168.178.204
  • ADVANCED - DEVELOPER SETTINGS: Enable MQTT, 192.168.178.25:1883
  • CLOUD: Disabled

Flow: [{"id":"e2f04485.a54c48","type":"mqtt in","z":"4a59ce31.c7bf3","name":"","topic":"shellies/shelly1-A4CF12F4221F/relay/0","qos":"2","datatype":"auto","broker":"608a29e6.968158","x":191,"y":2002,"wires":[["22099828.e20a88"]]},{"id":"22099828.e20a88","type":"rbe","z":"4a59ce31.c7bf3","name":"","func":"rbe","gap":"","start":"","inout":"out","property":"payload","x":415,"y":2002,"wires":[["39352df4.5fed22","ecd480eb.1ccd3"]]},{"id":"39352df4.5fed22","type":"ui_switch","z":"4a59ce31.c7bf3","name":"","label":"Büro","tooltip":"","group":"4cbff0bc.b38a3","order":5,"width":3,"height":1,"passthru":false,"decouple":"true","topic":"","style":"","onvalue":"on","onvalueType":"str","onicon":"wb_incandescent","oncolor":"var(--nr-dashboard-widgetBackgroundColor)","offvalue":"off","offvalueType":"str","officon":"wb_incandescent","offcolor":"var(--nr-dashboard-widgetTextColor)","x":551,"y":2002,"wires":[["34143ad0.ff9336"]]},{"id":"34143ad0.ff9336","type":"mqtt out","z":"4a59ce31.c7bf3","name":"","topic":"shellies/shelly1-A4CF12F4221F/relay/0/command","qos":"2","retain":"","broker":"608a29e6.968158","x":817,"y":2002,"wires":[]},{"id":"608a29e6.968158","type":"mqtt-broker","z":"","name":"ccuBroker","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":"4cbff0bc.b38a3","type":"ui_group","z":"","name":"Lichter","tab":"7effafe8.b39eb","order":1,"disp":true,"width":"9","collapse":false},{"id":"7effafe8.b39eb","type":"ui_tab","z":"","name":"Leuchten Schalter","icon":"fa-lightbulb-o","order":4,"disabled":false,"hidden":false}]

Settings und flows Beispiel 2

Settings:

  • DEVICE TYPE: Relay
  • POWER ON DEFAULT MODE: Restore last mode (both channels)
  • BUTTON TYPE: Detached Switch (both channels)

Internet & Security

  • WIFI MODE - CLIENT: yes, mein WLAN, IP statisch: 192.168.178.209
  • ADVANCED - DEVELOPER SETTINGS: Enable MQTT, 192.168.178.25:1883
  • CLOUD: Disabled

Flow: [{"id":"3dae6cf0.13a284","type":"mqtt in","z":"4a59ce31.c7bf3","name":"","topic":"shellies/shellyswitch25-98F4ABF2C975/relay/0","qos":"2","datatype":"auto","broker":"608a29e6.968158","x":221,"y":1856,"wires":[["4f82ce92.bc735"]]},{"id":"4f82ce92.bc735","type":"rbe","z":"4a59ce31.c7bf3","name":"","func":"rbe","gap":"","start":"","inout":"out","property":"payload","x":479,"y":1856,"wires":[["2d412698.125ffa","ecd480eb.1ccd3"]]},{"id":"478ac910.1645d8","type":"mqtt out","z":"4a59ce31.c7bf3","name":"","topic":"shellies/shellyswitch25-98F4ABF2C975/relay/0/command","qos":"2","retain":"","broker":"608a29e6.968158","x":893,"y":1856,"wires":[]},{"id":"3c6efbe9.494334","type":"mqtt in","z":"4a59ce31.c7bf3","name":"","topic":"shellies/shellyswitch25-98F4ABF2C975/relay/1","qos":"2","datatype":"auto","broker":"608a29e6.968158","x":221,"y":1950,"wires":[["b6c6279a.8d8ad8"]]},{"id":"b6c6279a.8d8ad8","type":"rbe","z":"4a59ce31.c7bf3","name":"","func":"rbe","gap":"","start":"","inout":"out","property":"payload","x":476,"y":1950,"wires":[["dcd0aead.139e9","ecd480eb.1ccd3"]]},{"id":"dcd0aead.139e9","type":"ui_switch","z":"4a59ce31.c7bf3","name":"","label":"Spiegel","tooltip":"","group":"4cbff0bc.b38a3","order":4,"width":3,"height":1,"passthru":false,"decouple":"true","topic":"","style":"","onvalue":"on","onvalueType":"str","onicon":"wb_incandescent","oncolor":"var(--nr-dashboard-widgetBackgroundColor)","offvalue":"off","offvalueType":"str","officon":"wb_incandescent","offcolor":"var(--nr-dashboard-widgetTextColor)","x":609,"y":1950,"wires":[["4dd2f450.3abd8c"]]},{"id":"4dd2f450.3abd8c","type":"mqtt out","z":"4a59ce31.c7bf3","name":"","topic":"shellies/shellyswitch25-98F4ABF2C975/relay/1/command","qos":"2","retain":"","broker":"608a29e6.968158","x":902,"y":1950,"wires":[]},{"id":"a10b9bbd.b8e658","type":"ccu-value","z":"4a59ce31.c7bf3","name":"","iface":"HmIP-RF","channel":"00019BE98DFB9F:1","datapoint":"PRESS_SHORT","mode":"","start":true,"change":false,"cache":false,"queue":false,"on":0,"onType":"undefined","ramp":0,"rampType":"undefined","working":false,"ccuConfig":"38263145.35ea0e","topic":"${CCU}/${Interface}/${channel}/${datapoint}","x":547,"y":1902,"wires":[["7ce019ab.b42608"]]},{"id":"7ce019ab.b42608","type":"change","z":"4a59ce31.c7bf3","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"toggle","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":781,"y":1902,"wires":[["4dd2f450.3abd8c"]]},{"id":"2d412698.125ffa","type":"ui_switch","z":"4a59ce31.c7bf3","name":"","label":"Bad","tooltip":"","group":"4cbff0bc.b38a3","order":3,"width":3,"height":1,"passthru":false,"decouple":"true","topic":"","style":"","onvalue":"on","onvalueType":"str","onicon":"wb_incandescent","oncolor":"var(--nr-dashboard-widgetBackgroundColor)","offvalue":"off","offvalueType":"str","officon":"wb_incandescent","offcolor":"var(--nr-dashboard-widgetTextColor)","x":608,"y":1856,"wires":[["478ac910.1645d8"]]},{"id":"1c3de00d.e8092","type":"ccu-value","z":"4a59ce31.c7bf3","name":"","iface":"HmIP-RF","channel":"00019BE98DFB9F:2","datapoint":"PRESS_SHORT","mode":"","start":true,"change":false,"cache":false,"queue":false,"on":0,"onType":"undefined","ramp":0,"rampType":"undefined","working":false,"ccuConfig":"38263145.35ea0e","topic":"${CCU}/${Interface}/${channel}/${datapoint}","x":548,"y":1814,"wires":[["3fd7a6f3.731f7a"]]},{"id":"3fd7a6f3.731f7a","type":"change","z":"4a59ce31.c7bf3","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"toggle","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":782,"y":1814,"wires":[["478ac910.1645d8"]]},{"id":"608a29e6.968158","type":"mqtt-broker","z":"","name":"ccuBroker","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":"4cbff0bc.b38a3","type":"ui_group","z":"","name":"Lichter","tab":"7effafe8.b39eb","order":1,"disp":true,"width":"9","collapse":false},{"id":"38263145.35ea0e","type":"ccu-connection","z":"","name":"localhost","host":"localhost","regaEnabled":false,"bcrfEnabled":true,"iprfEnabled":true,"virtEnabled":false,"bcwiEnabled":false,"cuxdEnabled":false,"regaPoll":false,"regaInterval":"30","rpcPingTimeout":"60","rpcInitAddress":"127.0.0.1","rpcServerHost":"127.0.0.1","rpcBinPort":"2047","rpcXmlPort":"2048","queueTimeout":"5000","queuePause":"250","contextStore":"default"},{"id":"7effafe8.b39eb","type":"ui_tab","z":"","name":"Leuchten Schalter","icon":"fa-lightbulb-o","order":4,"disabled":false,"hidden":false}]

Settings und flows Beispiel 3

Settings:

  • POWER ON DEFAULT MODE: On
  • BUTTON TYPE: Detached Switch

Internet & Security

  • WIFI MODE - CLIENT: yes, mein WLAN, IP statisch: 192.168.178.206
  • ADVANCED - DEVELOPER SETTINGS: Enable MQTT, 192.168.178.25:1883
  • CLOUD: Disabled

Flow: [{"id":"9a33768a.55ef48","type":"change","z":"4a59ce31.c7bf3","name":"payload.on","rules":[{"t":"set","p":"payload","pt":"msg","to":"payload.on","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":511,"y":1018,"wires":[["e314f1c6.a12ef"]]},{"id":"e314f1c6.a12ef","type":"ui_switch","z":"4a59ce31.c7bf3","name":"","label":"Küche 1","tooltip":"","group":"4cbff0bc.b38a3","order":8,"width":3,"height":1,"passthru":false,"decouple":"true","topic":"kueche1","style":"","onvalue":"true","onvalueType":"bool","onicon":"wb_incandescent","oncolor":"var(--nr-dashboard-widgetBackgroundColor)","offvalue":"false","offvalueType":"bool","officon":"wb_incandescent","offcolor":"var(--nr-dashboard-widgetTextColor)","x":662,"y":1018,"wires":[["52e7ec58.2dc774"]]},{"id":"52e7ec58.2dc774","type":"hue-light","z":"4a59ce31.c7bf3","name":"Ku white spot vorne","bridge":"106cd2a8.cd21cd","lightid":"23","colornamer":true,"skipevents":false,"x":569,"y":1065,"wires":[["9a33768a.55ef48","58dcd9b8.fa7e68"]]},{"id":"9115bb3b.314188","type":"change","z":"4a59ce31.c7bf3","name":"payload.on","rules":[{"t":"set","p":"payload","pt":"msg","to":"payload.on","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":519,"y":1190,"wires":[["dc26f617.7fa728"]]},{"id":"dc26f617.7fa728","type":"ui_switch","z":"4a59ce31.c7bf3","name":"","label":"Küche 2","tooltip":"","group":"4cbff0bc.b38a3","order":9,"width":3,"height":1,"passthru":false,"decouple":"true","topic":"küche2","style":"","onvalue":"true","onvalueType":"bool","onicon":"wb_incandescent","oncolor":"var(--nr-dashboard-widgetBackgroundColor)","offvalue":"false","offvalueType":"bool","officon":"wb_incandescent","offcolor":"var(--nr-dashboard-widgetTextColor)","x":670,"y":1190,"wires":[["d1499939.249bd8"]]},{"id":"d1499939.249bd8","type":"hue-light","z":"4a59ce31.c7bf3","name":"Kue white spot mitte","bridge":"106cd2a8.cd21cd","lightid":"22","colornamer":true,"skipevents":false,"x":587,"y":1237,"wires":[["9115bb3b.314188","58dcd9b8.fa7e68"]]},{"id":"33acee98.3d4e42","type":"change","z":"4a59ce31.c7bf3","name":"payload.on","rules":[{"t":"set","p":"payload","pt":"msg","to":"payload.on","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":520,"y":1361,"wires":[["a83f2da5.43156"]]},{"id":"a83f2da5.43156","type":"ui_switch","z":"4a59ce31.c7bf3","name":"","label":"Küche 3","tooltip":"","group":"4cbff0bc.b38a3","order":10,"width":3,"height":1,"passthru":false,"decouple":"true","topic":"kueche3","style":"","onvalue":"true","onvalueType":"bool","onicon":"wb_incandescent","oncolor":"var(--nr-dashboard-widgetBackgroundColor)","offvalue":"false","offvalueType":"bool","officon":"wb_incandescent","offcolor":"var(--nr-dashboard-widgetTextColor)","x":672,"y":1361,"wires":[["c94188a5.dacb58"]]},{"id":"c94188a5.dacb58","type":"hue-light","z":"4a59ce31.c7bf3","name":"Ku white spot hinten","bridge":"106cd2a8.cd21cd","lightid":"21","colornamer":true,"skipevents":false,"x":585,"y":1408,"wires":[["33acee98.3d4e42","58dcd9b8.fa7e68"]]},{"id":"10e19d4c.66b623","type":"ccu-value","z":"4a59ce31.c7bf3","name":"Switch 1/6","iface":"HmIP-RF","channel":"000B5569A27E61:1","datapoint":"PRESS_SHORT","mode":"","start":true,"change":false,"cache":false,"queue":false,"on":0,"onType":"undefined","ramp":0,"rampType":"undefined","working":false,"ccuConfig":"38263145.35ea0e","topic":"${CCU}/${Interface}/${channel}/${datapoint}","x":510,"y":1112,"wires":[["554bb3c6.ef42fc"]]},{"id":"82411838.034c38","type":"ccu-value","z":"4a59ce31.c7bf3","name":"Switch 3/6","iface":"HmIP-RF","channel":"000B5569A27E61:3","datapoint":"PRESS_SHORT","mode":"","start":true,"change":false,"cache":false,"queue":false,"on":0,"onType":"undefined","ramp":0,"rampType":"undefined","working":false,"ccuConfig":"38263145.35ea0e","topic":"${CCU}/${Interface}/${channel}/${datapoint}","x":505,"y":1287,"wires":[["f68b4c64.b2ede"]]},{"id":"1c1c0311.f6db3d","type":"ccu-value","z":"4a59ce31.c7bf3","name":"Switch 5/6","iface":"HmIP-RF","channel":"000B5569A27E61:5","datapoint":"PRESS_SHORT","mode":"","start":true,"change":false,"cache":false,"queue":false,"on":0,"onType":"undefined","ramp":0,"rampType":"undefined","working":false,"ccuConfig":"38263145.35ea0e","topic":"${CCU}/${Interface}/${channel}/${datapoint}","x":512,"y":1455,"wires":[["e30740af.95ad"]]},{"id":"554bb3c6.ef42fc","type":"change","z":"4a59ce31.c7bf3","name":"convert","rules":[{"t":"set","p":"payload","pt":"msg","to":"{\"toggle\":1}","tot":"json"}],"action":"","property":"","from":"","to":"","reg":false,"x":656,"y":1112,"wires":[["52e7ec58.2dc774"]]},{"id":"f68b4c64.b2ede","type":"change","z":"4a59ce31.c7bf3","name":"convert","rules":[{"t":"set","p":"payload","pt":"msg","to":"{\"toggle\":1}","tot":"json"}],"action":"","property":"","from":"","to":"","reg":false,"x":655,"y":1287,"wires":[["d1499939.249bd8"]]},{"id":"e30740af.95ad","type":"change","z":"4a59ce31.c7bf3","name":"convert","rules":[{"t":"set","p":"payload","pt":"msg","to":"{\"toggle\":1}","tot":"json"}],"action":"","property":"","from":"","to":"","reg":false,"x":660,"y":1455,"wires":[["c94188a5.dacb58"]]},{"id":"4cbff0bc.b38a3","type":"ui_group","z":"","name":"Lichter","tab":"7effafe8.b39eb","order":1,"disp":true,"width":"9","collapse":false},{"id":"106cd2a8.cd21cd","type":"hue-bridge","z":"","name":"Philips hue","bridge":"192.168.178.26","key":"b0mkFEqSFDudgUIkr66rkfqaG6MWbIlpBrqkLnHT","interval":"3000","disableupdates":false},{"id":"38263145.35ea0e","type":"ccu-connection","z":"","name":"localhost","host":"localhost","regaEnabled":false,"bcrfEnabled":true,"iprfEnabled":true,"virtEnabled":false,"bcwiEnabled":false,"cuxdEnabled":false,"regaPoll":false,"regaInterval":"30","rpcPingTimeout":"60","rpcInitAddress":"127.0.0.1","rpcServerHost":"127.0.0.1","rpcBinPort":"2047","rpcXmlPort":"2048","queueTimeout":"5000","queuePause":"250","contextStore":"default"},{"id":"7effafe8.b39eb","type":"ui_tab","z":"","name":"Leuchten Schalter","icon":"fa-lightbulb-o","order":4,"disabled":false,"hidden":false}]

und

[{"id":"410802b.0be98fc","type":"mqtt in","z":"4a59ce31.c7bf3","name":"","topic":"shellies/shelly1-F4CFA2764514/relay/0","qos":"2","datatype":"auto","broker":"608a29e6.968158","x":191,"y":2063,"wires":[["3aa48e70.e64332"]]},{"id":"3aa48e70.e64332","type":"rbe","z":"4a59ce31.c7bf3","name":"","func":"rbe","gap":"","start":"","inout":"out","property":"payload","x":431,"y":2063,"wires":[["f903cd8f.76b53"]]},{"id":"f903cd8f.76b53","type":"ui_switch","z":"4a59ce31.c7bf3","name":"","label":"Küche","tooltip":"","group":"e6e98f8d.08662","order":3,"width":3,"height":1,"passthru":false,"decouple":"true","topic":"","style":"","onvalue":"on","onvalueType":"str","onicon":"usb","oncolor":"var(--nr-dashboard-widgetBackgroundColor)","offvalue":"off","offvalueType":"str","officon":"usb","offcolor":"var(--nr-dashboard-widgetTextColor)","x":571,"y":2063,"wires":[["f3797061.c92b7"]]},{"id":"f3797061.c92b7","type":"mqtt out","z":"4a59ce31.c7bf3","name":"","topic":"shellies/shelly1-F4CFA2764514/relay/0/command","qos":"2","retain":"","broker":"608a29e6.968158","x":851,"y":2063,"wires":[]},{"id":"608a29e6.968158","type":"mqtt-broker","z":"","name":"ccuBroker","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":"e6e98f8d.08662","type":"ui_group","z":"","name":"Relais","tab":"7effafe8.b39eb","order":3,"disp":true,"width":"9","collapse":false},{"id":"7effafe8.b39eb","type":"ui_tab","z":"","name":"Leuchten Schalter","icon":"fa-lightbulb-o","order":4,"disabled":false,"hidden":false}]

Clone this wiki locally