Shelly Button Http Trigger and Auto Configuration

Relevant Nodes to install

npm install node-red-node-ping

npm install node-red-contrib-hostip

npm install node-red-node-group


Subflow will add new category "Shelly"


1st Setup Shelly

A new shelly button or after a factory reset, will start in AP Mode. Connect to the Shelly Button per Wifi and swith to standard ip: 192.168.33.1 Go to network settings and activate wifi client mode and type in the wifi settings your enviroment is set up. Set a static ip adresse. Go to Restrict Login and set a Username & Password. DONE**


Node Configuration

Name: Name of the Node

IP Adress: Type in the static IP Adress you gave the shelly button.

Button Name Give every button a unique name. This name will affect the auto-configuration and also the communication. For example: FloorButton1

User Name: Type in the username

Password: Type in the password

Time after last event beforere go to sleep in (sec) 0 - 5 sec (Standardconfig == Shelly Standard)

Set longpush max duration (ms) 800 - 2000ms (Standardconfig == Shelly Standard)

Set max time between sequential pushes (ms) 200 - 2000ms (Standardconfig == Shelly Standard)

Disable status LED When you check the box, the led is turned off.


Node Output

The Node offers 5 outputs. One for each trigger mode: Single, Douple, Triple and Long Push. One output is for the battery status and one is for logging.

Output after a Push

If you push the button the node will output the actual timestamp on the spezific output with the push mode as topic. For example:

Topic: LongPress
        msg.payload:  1600087341600

Battery Status

After the node recognices a push it will ask for the actual battery status. You will get the information in % and V.

For example:

Topic: BatteryStatus
        msg.payload:
            BatteryValue: 89
            BatteryVoltage: 4.1

Logging

The logging output will give you some informations during the auto-configuration procedure.


Auto-Configuration

For auto-configuration shelly button must be usb powered.

When you start nodeRED a auto-configuration will start automatically after 3 seconds. The Node will try to connect to the spezific IP Adress you set in the configuration. If the device is not reachable you will get a message on the logging output. The Node will try to reconnect every 3 seconds. If the connection is successful, the Node will find out the Host IP Adress NodeRED is running on. This Host IP Adress and the specific Name you setup will be sent to the shelly button. The shelly button will hit this url after a button push.

For example:

http://HOSTIP:1880/shortpress/BUTTONNAME
http://192.168.0.152:1880/shortpress/FloorButton1
http://HOSTIP:1880/longpress/BUTTONNAME
http://10.0.25.66:1880/longpress/FloorButton1

Demo Flow

For a Demo Flow using this Subflow see here: NodeRED Flows.

** Download Subflow below**

[{"id":"881195da.84344","type":"subflow","name":"Shelly Button","info":"# **1st Setup Shelly**\nA new shelly button or after a factory reset, will start in AP Mode. Connect to the Shelly Button per Wifi and swith to standard ip: 192.168.33.1\nGo to network settings and activate wifi client mode and type in the wifi settings your enviroment is set up. Set a static ip adresse.\nGo to Restrict Login and set a Username & Password.\nDONE**\n\n---\n\n\n# **Node Configuration**\n\n**Name:** Name of the Node\n\n**IP Adress:** Type in the static IP Adress you gave the shelly button.\n\n**Button Name** Give every button a unique name. This name will affect the auto-configuration and also the communication. For example: _FloorButton1_\n\n**User Name:** Type in the username\n\n**Password:** Type in the password\n\n**Time after last event beforere go to sleep in (sec)** 0 - 5 sec (Standardconfig == Shelly Standard)\n\n**Set longpush max duration (ms)** 800 - 2000ms (Standardconfig == Shelly Standard)\n\n**Set max time between sequential pushes (ms)** 200 - 2000ms (Standardconfig == Shelly Standard)\n\n**Disable status LED** When you check the box, the led is turned off.\n\n---\n\n\n\n\n\n# **Node Output**\n\nThe Node offers 5 outputs. One for each trigger mode: Single, Douple, Triple and Long Push. One output is for the battery status and one is for logging.\n\n# **Output after a Push**\n\nIf you push the button the node will output the actual timestamp on the spezific output with the push mode as topic. \nFor example:\n\n    Topic: LongPress\n            msg.payload:  1600087341600\n\n# **Battery Status**\nAfter the node recognices a push it will ask for the actual battery status. You will get the information in % and V. \n\nFor example: \n\n    Topic: BatteryStatus\n            msg.payload:\n                BatteryValue: 89\n                BatteryVoltage: 4.1\n\n# **Logging**\nThe logging output will give you some informations during the auto-configuration procedure.\n\n---\n\n\n# **Auto-Configuration**\n\n```\nFor auto-configuration shelly button must be usb powered.\n```\nWhen you start nodeRED a auto-configuration will start automatically after 3 seconds. The Node will try to connect to the spezific IP Adress you set in the configuration. If the device is not reachable you will get a message on the logging output. The Node will try to reconnect every 3 seconds. If the connection is successful, the Node will find out the Host IP Adress NodeRED is running on. This Host IP Adress and the specific Name you setup will be sent to the shelly button. The shelly button will hit this url after a button push.\n\nFor example:\n```\nhttp://HOSTIP:1880/shortpress/BUTTONNAME\nhttp://192.168.0.152:1880/shortpress/FloorButton1\n```\n```\nhttp://HOSTIP:1880/longpress/BUTTONNAME\nhttp://10.0.25.66:1880/longpress/FloorButton1\n```\n","category":"Shelly","in":[{"x":140,"y":940,"wires":[{"id":"a59fa330.e6a2e8"}]}],"out":[{"x":940,"y":120,"wires":[{"id":"d78c9bf7.5bb85","port":0}]},{"x":940,"y":160,"wires":[{"id":"26387e65.492e72","port":0}]},{"x":940,"y":200,"wires":[{"id":"5688578f.45ca48","port":0}]},{"x":940,"y":240,"wires":[{"id":"4c1d1cd8.0565ec","port":0}]},{"x":1900,"y":440,"wires":[{"id":"64b8d59c.963764","port":0}]},{"x":1220,"y":680,"wires":[{"id":"dcafb912.e969f8","port":0}]}],"env":[{"name":"IPAdresse","type":"str","value":"192.168.33.1","ui":{"icon":"font-awesome/fa-sitemap","label":{"en-US":"IP Adresse"},"type":"input","opts":{"types":["str"]}}},{"name":"ButtonName","type":"str","value":"Button1","ui":{"icon":"font-awesome/fa-address-card-o","type":"input","opts":{"types":["str"]}}},{"name":"UserName","type":"str","value":"","ui":{"icon":"font-awesome/fa-user","label":{"en-US":"User Name"},"type":"input","opts":{"types":["str"]}}},{"name":"Password","type":"str","value":"","ui":{"icon":"font-awesome/fa-unlock-alt"}},{"name":"TimeToSleep","type":"num","value":"0","ui":{"icon":"font-awesome/fa-clock-o","label":{"en-US":"Time after last event beforere go to sleep in (sec)"},"type":"spinner","opts":{"min":0,"max":5}}},{"name":"LongPushDuration","type":"num","value":"800","ui":{"icon":"font-awesome/fa-clock-o","label":{"en-US":"Set longpush max duration (ms)"},"type":"spinner","opts":{"min":800,"max":2000}}},{"name":"MultipushDuration","type":"num","value":"500","ui":{"icon":"font-awesome/fa-clock-o","label":{"en-US":"Set max time between sequential pushes (ms)"},"type":"spinner","opts":{"min":200,"max":2000}}},{"name":"LedStatus","type":"bool","value":"true","ui":{"icon":"font-awesome/fa-lightbulb-o","label":{"en-US":"Disable status LED"},"type":"checkbox"}},{"name":"URLShortPress","type":"env","value":"shortpress/${ButtonName}","ui":{"icon":"font-awesome/fa-chain","type":"hide"}},{"name":"URLDouplePress","type":"env","value":"douplepress/${ButtonName}","ui":{"icon":"font-awesome/fa-chain","type":"hide"}},{"name":"URLTriplePress","type":"env","value":"triplepress/${ButtonName}","ui":{"type":"hide"}},{"name":"URLLongPress","type":"env","value":"longpress/${ButtonName}","ui":{"type":"hide"}},{"name":"URLSettings","type":"env","value":"${IPAdresse}/settings","ui":{"type":"hide"}},{"name":"URLSettingsInput","type":"env","value":"${IPAdresse}/settings/input/0","ui":{"type":"hide"}}],"color":"#F3B567","inputLabels":["Input"],"outputLabels":["ShortPress","DouplePress","TriplePress","LongPress","BatteryStatus","Logging"],"icon":"node-red-dashboard/ui_button.png","status":{"x":680,"y":680,"wires":[{"id":"8be8fd9.0ae38","port":0},{"id":"63408071.41ca6","port":0},{"id":"b11cbec3.cf3728","port":0},{"id":"3bc7d495.1d2dec","port":0},{"id":"546ded6d.f8aa7c","port":0}]}},{"id":"19a13340.f4aca5","type":"group","z":"881195da.84344","name":"Send Parameters to Shelly","style":{"stroke":"#ff0000","fill":"#ffbfbf","fill-opacity":"0.52","label":true,"color":"#ff0000"},"nodes":["31bb13de.f65424","ad1d81fc.8cf39","9f22793f.7bcfe8","ef771867.768f98","6e72500c.02b408","2baa543e.66218c","d1d88315.c9f96","87fd09c2.6d05f","3aa6f015.b84b7","ce31a814.bf62b","b18aed9d.974688","5f87b98d.db439","f41d95.dae13268","e1cfefe2.39914","eb2de8b4.fa89c8","2ef8943c.eb3474","382a89d8.5640be","74e2caa1.4f9e14","f4470113.b8e51","95ab3a2b.aff478","7a7cbf97.28caf"],"x":114,"y":1859,"w":1522,"h":362},{"id":"6927dc25.3faf34","type":"group","z":"881195da.84344","name":"Generate Node Status","style":{"stroke":"#0070c0","fill":"#bfdbef","fill-opacity":"0.52","label":true},"nodes":["8be8fd9.0ae38","63408071.41ca6","b11cbec3.cf3728","3bc7d495.1d2dec","546ded6d.f8aa7c","a71de70f.8d7c38","1cd86d33.956303","8ce5beda.afd6f","dc2d7006.fe548","19d9c45a.511ffc"],"x":114,"y":559,"w":452,"h":242},{"id":"7dcefd3d.6085b4","type":"group","z":"881195da.84344","name":"read battery status from shelly device after a button push","style":{"stroke":"#ffff00","fill":"#ffffbf","fill-opacity":"0.63","label":true},"nodes":["71634f5d.2c375","ccb34f2c.7ad86","5013e9e4.1a51e","6e8f9938.4e8268","2af7abb9.342edc","79834146.72aee","7ca1ec1d.ad476c","64b8d59c.963764","f3b3b117.9381c8","ca857f04.e0066"],"x":114,"y":379,"w":1692,"h":122},{"id":"8ef55a1c.90a7a8","type":"group","z":"881195da.84344","name":"Waiting for a push on the button","style":{"stroke":"#92d04f","fill":"#e3f3d3","label":true,"color":"#777777"},"nodes":["2351f210.b46896","5b908d15.83deb4","30ece545.d4dfaa","6b911f6b.c6e27","d78c9bf7.5bb85","26387e65.492e72","4c1d1cd8.0565ec","5688578f.45ca48","73ddd610.486ce"],"x":114,"y":79,"w":692,"h":242},{"id":"dc584493.81d2a8","type":"group","z":"881195da.84344","name":"Auto-Configuration of URL","style":{"label":true,"stroke":"#ffC000","fill":"#ffefbf","fill-opacity":"0.56"},"nodes":["c8839aad.a8caa","4ce962e8.b4f74c","de75b1d9.2ddcc8","e34aaa30.cbbfd8","69ad6.9ca7b52a8","2ea97e6.8496b82","89f9451e.433c7","771d2019.a5a24","71b7296e.f88d18","eed96acd.30f65","a71589c2.0d2698","e1012655.6405","9917edb9.dda748","5c47bae4.ee10d4","aeede421.cba0f","28d4ecb.4074494","43bb9a6e.a99a24","67615511.17951c","f61d7c71.bbaba","aa321cab.8133","ee7c96a5.2f1538","1773b21b.419cae","d7b6775a.138cd","af72e751.eff12","c5d210f8.ed3a18","d9d329ef.268bc8","93dac890.a0376","d2ee839c.bcbf38","76ac9e4b.78a978","f5a098f3.175308","37d0d4ea.6207cc","3c1eba19.4afba6","78b3caae.1549f4","4a2609cf.132ef","851ff2a2.1dd828","4fc1770a.fe2c58","f7cefa08.2092d8","a00d4833.fadaa","396b0813.ca5c28","c78c4173.6e6378","aaccd43f.9ed288","fc387159.8f2958","237eaa66.f321c6","dddf2c1e.3e51b","eeac0e38.215f08","daecde8f.6d4da","b163b2e5.74f4d","1e25a88b.334c27","672d358f.a42efc","903a4c81.c1c1d","403a12d9.7a5914","cd12bb4.41d5fc8","6a2715e2.453224","c10cf44f.7b673"],"x":114,"y":1019,"w":2302,"h":722},{"id":"2351f210.b46896","type":"http in","z":"881195da.84344","g":"8ef55a1c.90a7a8","name":"","url":"${URLShortPress}","method":"get","upload":false,"swaggerDoc":"","x":250,"y":120,"wires":[["d78c9bf7.5bb85","73ddd610.486ce"]]},{"id":"5b908d15.83deb4","type":"http in","z":"881195da.84344","g":"8ef55a1c.90a7a8","name":"","url":"${URLDouplePress}","method":"get","upload":false,"swaggerDoc":"","x":250,"y":160,"wires":[["26387e65.492e72","73ddd610.486ce"]]},{"id":"30ece545.d4dfaa","type":"http in","z":"881195da.84344","g":"8ef55a1c.90a7a8","name":"","url":"${URLTriplePress}","method":"get","upload":false,"swaggerDoc":"","x":250,"y":200,"wires":[["5688578f.45ca48","73ddd610.486ce"]]},{"id":"6b911f6b.c6e27","type":"http in","z":"881195da.84344","g":"8ef55a1c.90a7a8","name":"","url":"${URLLongPress}","method":"get","upload":false,"swaggerDoc":"","x":260,"y":240,"wires":[["4c1d1cd8.0565ec","73ddd610.486ce"]]},{"id":"d78c9bf7.5bb85","type":"change","z":"881195da.84344","g":"8ef55a1c.90a7a8","name":"set Topic and Payload","rules":[{"t":"set","p":"payload","pt":"msg","to":"","tot":"date"},{"t":"set","p":"topic","pt":"msg","to":"ShortPress","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":680,"y":120,"wires":[[]]},{"id":"26387e65.492e72","type":"change","z":"881195da.84344","g":"8ef55a1c.90a7a8","name":"set Topic and Payload","rules":[{"t":"set","p":"payload","pt":"msg","to":"","tot":"date"},{"t":"set","p":"topic","pt":"msg","to":"DoublePress","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":680,"y":160,"wires":[[]]},{"id":"4c1d1cd8.0565ec","type":"change","z":"881195da.84344","g":"8ef55a1c.90a7a8","name":"set Topic and Payload","rules":[{"t":"set","p":"payload","pt":"msg","to":"","tot":"date"},{"t":"set","p":"topic","pt":"msg","to":"LongPress","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":680,"y":240,"wires":[[]]},{"id":"5688578f.45ca48","type":"change","z":"881195da.84344","g":"8ef55a1c.90a7a8","name":"set Topic and Payload","rules":[{"t":"set","p":"payload","pt":"msg","to":"","tot":"date"},{"t":"set","p":"topic","pt":"msg","to":"TriplePress","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":680,"y":200,"wires":[[]]},{"id":"71634f5d.2c375","type":"http request","z":"881195da.84344","g":"7dcefd3d.6085b4","name":"","method":"GET","ret":"obj","paytoqs":"ignore","url":"","tls":"","persist":false,"proxy":"","authType":"","x":870,"y":440,"wires":[["ccb34f2c.7ad86","5013e9e4.1a51e"]]},{"id":"ccb34f2c.7ad86","type":"change","z":"881195da.84344","g":"7dcefd3d.6085b4","name":"set Topic and Payload","rules":[{"t":"move","p":"payload.bat.value","pt":"msg","to":"payload","tot":"msg"},{"t":"set","p":"topic","pt":"msg","to":"BatteryValue","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1160,"y":420,"wires":[["2af7abb9.342edc"]]},{"id":"5013e9e4.1a51e","type":"change","z":"881195da.84344","g":"7dcefd3d.6085b4","name":"set Topic and Payload","rules":[{"t":"move","p":"payload.bat.voltage","pt":"msg","to":"payload","tot":"msg"},{"t":"set","p":"topic","pt":"msg","to":"BatteryVoltage","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1160,"y":460,"wires":[["6e8f9938.4e8268"]]},{"id":"6e8f9938.4e8268","type":"switch","z":"881195da.84344","g":"7dcefd3d.6085b4","name":"check payload","property":"payload","propertyType":"msg","rules":[{"t":"istype","v":"number","vt":"number"}],"checkall":"true","repair":false,"outputs":1,"x":1380,"y":460,"wires":[["7ca1ec1d.ad476c"]]},{"id":"2af7abb9.342edc","type":"switch","z":"881195da.84344","g":"7dcefd3d.6085b4","name":"check payload","property":"payload","propertyType":"msg","rules":[{"t":"istype","v":"number","vt":"number"}],"checkall":"true","repair":false,"outputs":1,"x":1380,"y":420,"wires":[["7ca1ec1d.ad476c"]]},{"id":"79834146.72aee","type":"function","z":"881195da.84344","g":"7dcefd3d.6085b4","name":"read battery status from shelly device","func":"var IP = env.get(\"IPAdresse\");\n\n\nmsg.url= \"http://\"+ IP + \"/status\";\nmsg.payload = null;\nreturn msg;\n","outputs":1,"noerr":0,"initialize":"","finalize":"","x":370,"y":440,"wires":[["ca857f04.e0066"]]},{"id":"7ca1ec1d.ad476c","type":"join","z":"881195da.84344","g":"7dcefd3d.6085b4","name":"","mode":"custom","build":"object","property":"payload","propertyType":"msg","key":"topic","joiner":"\\n","joinerType":"str","accumulate":false,"timeout":"","count":"2","reduceRight":false,"reduceExp":"","reduceInit":"","reduceInitType":"num","reduceFixup":"","x":1570,"y":440,"wires":[["64b8d59c.963764"]]},{"id":"64b8d59c.963764","type":"change","z":"881195da.84344","g":"7dcefd3d.6085b4","name":"set Topic","rules":[{"t":"set","p":"topic","pt":"msg","to":"BatteryStatus","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1720,"y":440,"wires":[[]]},{"id":"c8839aad.a8caa","type":"split","z":"881195da.84344","g":"dc584493.81d2a8","name":"split mgs","splt":"[]","spltType":"bin","arraySplt":1,"arraySpltType":"len","stream":false,"addname":"","x":540,"y":1320,"wires":[["4ce962e8.b4f74c"]]},{"id":"4ce962e8.b4f74c","type":"switch","z":"881195da.84344","g":"dc584493.81d2a8","name":"Filtet the Host IP Adress","property":"payload.address","propertyType":"msg","rules":[{"t":"cont","v":"ButtonIP","vt":"flow"}],"checkall":"true","repair":false,"outputs":1,"x":750,"y":1320,"wires":[["de75b1d9.2ddcc8"]]},{"id":"de75b1d9.2ddcc8","type":"change","z":"881195da.84344","g":"dc584493.81d2a8","name":"save Host IP","rules":[{"t":"move","p":"payload.address","pt":"msg","to":"HostIP","tot":"flow"}],"action":"","property":"","from":"","to":"","reg":false,"x":990,"y":1320,"wires":[["1e25a88b.334c27"]]},{"id":"e34aaa30.cbbfd8","type":"switch","z":"881195da.84344","g":"dc584493.81d2a8","name":"Filter Host IP from URL","property":"payload.shortpush_url","propertyType":"msg","rules":[{"t":"cont","v":"HostIP","vt":"flow"},{"t":"else"}],"checkall":"true","repair":false,"outputs":2,"x":300,"y":1540,"wires":[["4a2609cf.132ef"],["2ea97e6.8496b82"]]},{"id":"69ad6.9ca7b52a8","type":"change","z":"881195da.84344","g":"dc584493.81d2a8","name":"Logging","rules":[{"t":"set","p":"payload","pt":"msg","to":"Correct IP Adress set to Shelly Button","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":2220,"y":1360,"wires":[["a00d4833.fadaa"]]},{"id":"2ea97e6.8496b82","type":"change","z":"881195da.84344","g":"dc584493.81d2a8","name":"Logging","rules":[{"t":"set","p":"payload","pt":"msg","to":"IP Adress NOT set to Shelly","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1000,"y":1600,"wires":[["93dac890.a0376","237eaa66.f321c6"]]},{"id":"89f9451e.433c7","type":"http request","z":"881195da.84344","g":"dc584493.81d2a8","name":"Set URL for ShorPush","method":"POST","ret":"obj","paytoqs":"ignore","url":"${URLSettingsInput}","tls":"","persist":false,"proxy":"","authType":"","x":1920,"y":1580,"wires":[["672d358f.a42efc"]]},{"id":"771d2019.a5a24","type":"function","z":"881195da.84344","g":"dc584493.81d2a8","name":"configure URL to SEND","func":"var HostIP = flow.get(\"HostIP\") || 0;\nvar Name = env.get(\"ButtonName\");\nvar URL = \"leer\";\n\nURL = \"shortpush_url=http://\" +HostIP +\":1880/shortpress/\" +Name;\n\nmsg.payload = URL;\n\nreturn msg;\n","outputs":1,"noerr":0,"initialize":"","finalize":"","x":1670,"y":1580,"wires":[["89f9451e.433c7"]]},{"id":"71b7296e.f88d18","type":"hostip","z":"881195da.84344","g":"dc584493.81d2a8","name":"get IPs off all Network Cards","x":320,"y":1320,"wires":[["c8839aad.a8caa"]]},{"id":"eed96acd.30f65","type":"split","z":"881195da.84344","g":"dc584493.81d2a8","name":"split msg","splt":".","spltType":"str","arraySplt":1,"arraySpltType":"len","stream":false,"addname":"payload","x":1080,"y":1120,"wires":[["a71589c2.0d2698"]]},{"id":"a71589c2.0d2698","type":"switch","z":"881195da.84344","g":"dc584493.81d2a8","name":"split full ip adress into blocks","property":"parts.index","propertyType":"msg","rules":[{"t":"eq","v":"0","vt":"num"},{"t":"eq","v":"1","vt":"num"},{"t":"eq","v":"2","vt":"num"},{"t":"eq","v":"3","vt":"num"}],"checkall":"true","repair":false,"outputs":4,"x":1300,"y":1120,"wires":[["e1012655.6405"],["9917edb9.dda748"],["5c47bae4.ee10d4"],["aeede421.cba0f"]]},{"id":"e1012655.6405","type":"change","z":"881195da.84344","g":"dc584493.81d2a8","name":"Block 1","rules":[{"t":"move","p":"payload","pt":"msg","to":"IPPart1","tot":"flow"}],"action":"","property":"","from":"","to":"","reg":false,"x":1540,"y":1060,"wires":[[]]},{"id":"9917edb9.dda748","type":"change","z":"881195da.84344","g":"dc584493.81d2a8","name":"Block 2","rules":[{"t":"move","p":"payload","pt":"msg","to":"IPPart2","tot":"flow"}],"action":"","property":"","from":"","to":"","reg":false,"x":1540,"y":1100,"wires":[[]]},{"id":"5c47bae4.ee10d4","type":"change","z":"881195da.84344","g":"dc584493.81d2a8","name":"Block 3","rules":[{"t":"move","p":"payload","pt":"msg","to":"IPPart3","tot":"flow"}],"action":"","property":"","from":"","to":"","reg":false,"x":1540,"y":1140,"wires":[[]]},{"id":"aeede421.cba0f","type":"change","z":"881195da.84344","g":"dc584493.81d2a8","name":"Block 4","rules":[{"t":"move","p":"payload","pt":"msg","to":"IPPart4","tot":"flow"}],"action":"","property":"","from":"","to":"","reg":false,"x":1540,"y":1180,"wires":[["28d4ecb.4074494"]]},{"id":"28d4ecb.4074494","type":"function","z":"881195da.84344","g":"dc584493.81d2a8","name":"Set IP Range","func":"IPPart1 = flow.get('IPPart1') || 0;\nIPPart2 = flow.get('IPPart2') || 0;\nIPPart3 = flow.get('IPPart3') || 0;\nIPPart4 = flow.get('IPPart4') || 0;\n\n\nmsg.payload = +IPPart1 +\".\" +IPPart2 +\".\" +IPPart3;\n\nreturn msg;\n","outputs":1,"noerr":0,"initialize":"","finalize":"","x":1710,"y":1180,"wires":[["43bb9a6e.a99a24"]]},{"id":"43bb9a6e.a99a24","type":"change","z":"881195da.84344","g":"dc584493.81d2a8","name":"save IP Range of the Button","rules":[{"t":"move","p":"payload","pt":"msg","to":"ButtonIP","tot":"flow"}],"action":"","property":"","from":"","to":"","reg":false,"x":1940,"y":1180,"wires":[["71b7296e.f88d18"]]},{"id":"67615511.17951c","type":"http request","z":"881195da.84344","g":"dc584493.81d2a8","name":"Set URL for DouplePush","method":"POST","ret":"obj","paytoqs":"ignore","url":"${URLSettingsInput}","tls":"","persist":false,"proxy":"","authType":"","x":1930,"y":1620,"wires":[["903a4c81.c1c1d"]]},{"id":"f61d7c71.bbaba","type":"function","z":"881195da.84344","g":"dc584493.81d2a8","name":"configure URL to SEND","func":"var HostIP = flow.get(\"HostIP\") || 0;\nvar Name = env.get(\"ButtonName\");\nvar URL = \"leer\";\n\nURL = \"double_shortpush_url=http://\" +HostIP +\":1880/douplepress/\" +Name;\n\nmsg.payload = URL;\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":1670,"y":1620,"wires":[["67615511.17951c"]]},{"id":"aa321cab.8133","type":"http request","z":"881195da.84344","g":"dc584493.81d2a8","name":"Set URL for TriplePush","method":"POST","ret":"obj","paytoqs":"ignore","url":"${URLSettingsInput}","tls":"","persist":false,"proxy":"","authType":"","x":1930,"y":1660,"wires":[["403a12d9.7a5914"]]},{"id":"ee7c96a5.2f1538","type":"function","z":"881195da.84344","g":"dc584493.81d2a8","name":"configure URL to SEND","func":"var HostIP = flow.get(\"HostIP\") || 0;\nvar Name = env.get(\"ButtonName\");\nvar URL = \"leer\";\n\nURL = \"triple_shortpush_url=http://\" +HostIP +\":1880/triplepress/\" +Name;\n\nmsg.payload = URL;\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":1670,"y":1660,"wires":[["aa321cab.8133"]]},{"id":"1773b21b.419cae","type":"http request","z":"881195da.84344","g":"dc584493.81d2a8","name":"Set URL for LongPush","method":"POST","ret":"obj","paytoqs":"ignore","url":"${URLSettingsInput}","tls":"","persist":false,"proxy":"","authType":"","x":1920,"y":1700,"wires":[["d2ee839c.bcbf38"]]},{"id":"d7b6775a.138cd","type":"function","z":"881195da.84344","g":"dc584493.81d2a8","name":"configure URL to SEND","func":"var HostIP = flow.get(\"HostIP\") || 0;\nvar Name = env.get(\"ButtonName\");\nvar URL = \"leer\";\n\nURL = \"longpush_url=http://\" +HostIP +\":1880/longpress/\" +Name;\n\nmsg.payload = URL;\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":1670,"y":1700,"wires":[["1773b21b.419cae"]]},{"id":"af72e751.eff12","type":"switch","z":"881195da.84344","g":"dc584493.81d2a8","name":"Filter Host IP from URL","property":"payload.double_shortpush_url","propertyType":"msg","rules":[{"t":"cont","v":"HostIP","vt":"flow"},{"t":"else"}],"checkall":"true","repair":false,"outputs":2,"x":780,"y":1500,"wires":[["851ff2a2.1dd828"],["2ea97e6.8496b82"]]},{"id":"c5d210f8.ed3a18","type":"switch","z":"881195da.84344","g":"dc584493.81d2a8","name":"Filter Host IP from URL","property":"payload.triple_shortpush_url","propertyType":"msg","rules":[{"t":"cont","v":"HostIP","vt":"flow"},{"t":"else"}],"checkall":"true","repair":false,"outputs":2,"x":1280,"y":1460,"wires":[["4fc1770a.fe2c58"],["2ea97e6.8496b82"]]},{"id":"d9d329ef.268bc8","type":"switch","z":"881195da.84344","g":"dc584493.81d2a8","name":"Filter Host IP from URL","property":"payload.longpush_url","propertyType":"msg","rules":[{"t":"cont","v":"HostIP","vt":"flow"},{"t":"else"}],"checkall":"true","repair":false,"outputs":2,"x":1780,"y":1420,"wires":[["f7cefa08.2092d8"],["2ea97e6.8496b82"]]},{"id":"93dac890.a0376","type":"change","z":"881195da.84344","g":"dc584493.81d2a8","name":"deleate msg","rules":[{"t":"delete","p":"parts","pt":"msg"},{"t":"delete","p":"headers","pt":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":1210,"y":1580,"wires":[["b163b2e5.74f4d"]]},{"id":"d2ee839c.bcbf38","type":"change","z":"881195da.84344","g":"dc584493.81d2a8","name":"Check URL again","rules":[{"t":"delete","p":"parts","pt":"msg"},{"t":"delete","p":"headers","pt":"msg"},{"t":"set","p":"payload","pt":"msg","to":"","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":2190,"y":1700,"wires":[["dddf2c1e.3e51b"]]},{"id":"76ac9e4b.78a978","type":"ping","z":"881195da.84344","g":"dc584493.81d2a8","mode":"timed","name":"Ping","host":"${IPAdresse}","timer":"3","inputs":0,"x":190,"y":1140,"wires":[["f5a098f3.175308"]]},{"id":"f5a098f3.175308","type":"switch","z":"881195da.84344","g":"dc584493.81d2a8","name":"check connection","property":"payload","propertyType":"msg","rules":[{"t":"gt","v":"0","vt":"str"},{"t":"false"}],"checkall":"true","repair":false,"outputs":2,"x":430,"y":1140,"wires":[["396b0813.ca5c28","78b3caae.1549f4"],["37d0d4ea.6207cc","c78c4173.6e6378"]],"outputLabels":["Online","Gerät Offline"]},{"id":"37d0d4ea.6207cc","type":"change","z":"881195da.84344","g":"dc584493.81d2a8","name":"Logging","rules":[{"t":"set","p":"payload","pt":"msg","to":"Device not reachable.","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":660,"y":1160,"wires":[["aaccd43f.9ed288"]]},{"id":"3c1eba19.4afba6","type":"change","z":"881195da.84344","g":"dc584493.81d2a8","name":"set payload","rules":[{"t":"set","p":"payload","pt":"msg","to":"IPAdresse","tot":"env"}],"action":"","property":"","from":"","to":"","reg":false,"x":890,"y":1120,"wires":[["eed96acd.30f65","fc387159.8f2958"]]},{"id":"78b3caae.1549f4","type":"trigger","z":"881195da.84344","g":"dc584493.81d2a8","name":"Block after 1st msg","op1":"","op2":"0","op1type":"pay","op2type":"str","duration":"0","extend":false,"units":"ms","reset":"","bytopic":"all","topic":"topic","outputs":1,"x":690,"y":1120,"wires":[["3c1eba19.4afba6"]]},{"id":"4a2609cf.132ef","type":"switch","z":"881195da.84344","g":"dc584493.81d2a8","name":"Filter Name from URL","property":"payload.shortpush_url","propertyType":"msg","rules":[{"t":"regex","v":"ButtonName","vt":"env","case":false},{"t":"else"}],"checkall":"true","repair":false,"outputs":2,"x":520,"y":1520,"wires":[["af72e751.eff12"],["2ea97e6.8496b82"]]},{"id":"851ff2a2.1dd828","type":"switch","z":"881195da.84344","g":"dc584493.81d2a8","name":"Filter Name from URL","property":"payload.shortpush_url","propertyType":"msg","rules":[{"t":"regex","v":"ButtonName","vt":"env","case":false},{"t":"else"}],"checkall":"true","repair":false,"outputs":2,"x":1000,"y":1480,"wires":[["c5d210f8.ed3a18"],["2ea97e6.8496b82"]]},{"id":"4fc1770a.fe2c58","type":"switch","z":"881195da.84344","g":"dc584493.81d2a8","name":"Filter Name from URL","property":"payload.shortpush_url","propertyType":"msg","rules":[{"t":"regex","v":"ButtonName","vt":"env","case":false},{"t":"else"}],"checkall":"true","repair":false,"outputs":2,"x":1500,"y":1440,"wires":[["d9d329ef.268bc8"],["2ea97e6.8496b82"]]},{"id":"f7cefa08.2092d8","type":"switch","z":"881195da.84344","g":"dc584493.81d2a8","name":"Filter Name from URL","property":"payload.shortpush_url","propertyType":"msg","rules":[{"t":"regex","v":"ButtonName","vt":"env","case":false},{"t":"else"}],"checkall":"true","repair":false,"outputs":2,"x":2000,"y":1400,"wires":[["69ad6.9ca7b52a8"],["2ea97e6.8496b82"]]},{"id":"31bb13de.f65424","type":"change","z":"881195da.84344","g":"19a13340.f4aca5","name":"Logging","rules":[{"t":"set","p":"payload","pt":"msg","to":"SET functional Parameters to Shelly","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":280,"y":1940,"wires":[["9f22793f.7bcfe8","f41d95.dae13268"]]},{"id":"ad1d81fc.8cf39","type":"http request","z":"881195da.84344","g":"19a13340.f4aca5","name":"SET TimeToSleep","method":"POST","ret":"obj","paytoqs":"ignore","url":"${URLSettings}","tls":"","persist":false,"proxy":"","authType":"","x":1210,"y":1940,"wires":[["74e2caa1.4f9e14"]]},{"id":"9f22793f.7bcfe8","type":"change","z":"881195da.84344","g":"19a13340.f4aca5","name":"deleate msg","rules":[{"t":"delete","p":"parts","pt":"msg"},{"t":"delete","p":"headers","pt":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":470,"y":1940,"wires":[["382a89d8.5640be"]]},{"id":"ef771867.768f98","type":"function","z":"881195da.84344","g":"19a13340.f4aca5","name":"Configure Parameters to SEND","func":"var TimeToSleep = env.get(\"TimeToSleep\");\nvar URL = \"leer\";\n\nURL = \"remain_awake=\" +TimeToSleep;\n\nmsg.payload = URL;\n\nreturn msg;\n","outputs":1,"noerr":0,"initialize":"","finalize":"","x":950,"y":1940,"wires":[["ad1d81fc.8cf39"]]},{"id":"6e72500c.02b408","type":"http request","z":"881195da.84344","g":"19a13340.f4aca5","name":"SET LongpushDuration","method":"POST","ret":"obj","paytoqs":"ignore","url":"${URLSettings}","tls":"","persist":false,"proxy":"","authType":"","x":1230,"y":2000,"wires":[["7a7cbf97.28caf"]]},{"id":"2baa543e.66218c","type":"function","z":"881195da.84344","g":"19a13340.f4aca5","name":"Configure Parameters to SEND","func":"var LongPushDuration = env.get(\"LongPushDuration\");\nvar URL = \"leer\";\n\nURL = \"longpush_duration_ms_max=\" +LongPushDuration;\n\nmsg.payload = URL;\n\nreturn msg;\n","outputs":1,"noerr":0,"initialize":"","finalize":"","x":950,"y":2000,"wires":[["6e72500c.02b408"]]},{"id":"d1d88315.c9f96","type":"http request","z":"881195da.84344","g":"19a13340.f4aca5","name":"SET MultipushDuration","method":"POST","ret":"obj","paytoqs":"ignore","url":"${URLSettings}","tls":"","persist":false,"proxy":"","authType":"","x":1230,"y":2060,"wires":[["95ab3a2b.aff478"]]},{"id":"87fd09c2.6d05f","type":"function","z":"881195da.84344","g":"19a13340.f4aca5","name":"Configure Parameters to SEND","func":"var MultipushDuration = env.get(\"MultipushDuration\");\nvar URL = \"leer\";\n\nURL = \"multipush_time_between_pushes_ms_max=\" +MultipushDuration;\n\nmsg.payload = URL;\n\nreturn msg;\n","outputs":1,"noerr":0,"initialize":"","finalize":"","x":950,"y":2060,"wires":[["d1d88315.c9f96"]]},{"id":"3aa6f015.b84b7","type":"http request","z":"881195da.84344","g":"19a13340.f4aca5","name":"SET LedStatus","method":"POST","ret":"obj","paytoqs":"ignore","url":"${URLSettings}","tls":"","persist":false,"proxy":"","authType":"","x":1200,"y":2120,"wires":[["f4470113.b8e51"]]},{"id":"ce31a814.bf62b","type":"function","z":"881195da.84344","g":"19a13340.f4aca5","name":"Configure Parameters to SEND","func":"var LedStatus = env.get(\"LedStatus\");\nvar URL = \"leer\";\n\nURL = \"led_status_disable=\" +LedStatus;\n\nmsg.payload = URL;\n\nreturn msg;\n","outputs":1,"noerr":0,"initialize":"","finalize":"","x":950,"y":2120,"wires":[["3aa6f015.b84b7"]]},{"id":"b18aed9d.974688","type":"change","z":"881195da.84344","g":"19a13340.f4aca5","name":"Logging","rules":[{"t":"set","p":"payload","pt":"msg","to":"SET Parameters DONE","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1460,"y":2180,"wires":[["e1cfefe2.39914"]]},{"id":"a59fa330.e6a2e8","type":"switch","z":"881195da.84344","name":"Filter Input  msg","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"auto-config","vt":"str"},{"t":"eq","v":"SetName","vt":"str"}],"checkall":"true","repair":false,"outputs":2,"x":280,"y":940,"wires":[["b110003b.97b2f"],[]]},{"id":"b110003b.97b2f","type":"change","z":"881195da.84344","name":"Start Auto-Configuration","rules":[{"t":"set","p":"reset","pt":"msg","to":"","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":510,"y":940,"wires":[["78b3caae.1549f4"]]},{"id":"8be8fd9.0ae38","type":"change","z":"881195da.84344","g":"6927dc25.3faf34","name":"Status Device online","rules":[{"t":"set","p":"payload","pt":"msg","to":"{\"fill\":\"green\",\"shape\":\"dot\",\"text\":\"Device online\"}","tot":"json"}],"action":"","property":"","from":"","to":"","reg":false,"x":440,"y":600,"wires":[[]]},{"id":"63408071.41ca6","type":"change","z":"881195da.84344","g":"6927dc25.3faf34","name":"Status Device offline","rules":[{"t":"set","p":"payload","pt":"msg","to":"{\"fill\":\"grey\",\"shape\":\"ring\",\"text\":\"Device offline\"}","tot":"json"}],"action":"","property":"","from":"","to":"","reg":false,"x":440,"y":640,"wires":[[]]},{"id":"b11cbec3.cf3728","type":"change","z":"881195da.84344","g":"6927dc25.3faf34","name":"Status Device in Auto-Configuration","rules":[{"t":"set","p":"payload","pt":"msg","to":"{\"fill\":\"blue \",\"shape\":\"ring\",\"text\":\"Device in Auto-Configuration\"}","tot":"json"}],"action":"","property":"","from":"","to":"","reg":false,"x":390,"y":720,"wires":[[]]},{"id":"3bc7d495.1d2dec","type":"change","z":"881195da.84344","g":"6927dc25.3faf34","name":"Status Auto-Configuration DONE","rules":[{"t":"set","p":"payload","pt":"msg","to":"{\"fill\":\"blue \",\"shape\":\"dot\",\"text\":\" Auto-Configuration DONE\"}","tot":"json"}],"action":"","property":"","from":"","to":"","reg":false,"x":400,"y":760,"wires":[[]]},{"id":"546ded6d.f8aa7c","type":"change","z":"881195da.84344","g":"6927dc25.3faf34","name":"Status Received new Trigger","rules":[{"t":"set","p":"payload","pt":"msg","to":"{\"fill\":\"green\",\"shape\":\"ring\",\"text\":\"Received new Trigger\"}","tot":"json"}],"action":"","property":"","from":"","to":"","reg":false,"x":420,"y":680,"wires":[[]]},{"id":"a00d4833.fadaa","type":"link out","z":"881195da.84344","g":"dc584493.81d2a8","name":"Set IP to shelly DONE","links":["5f87b98d.db439","875b403e.2dca7","dcafb912.e969f8"],"x":2375,"y":1340,"wires":[]},{"id":"5f87b98d.db439","type":"link in","z":"881195da.84344","g":"19a13340.f4aca5","name":"Set Parameter","links":["a00d4833.fadaa"],"x":155,"y":1940,"wires":[["31bb13de.f65424"]]},{"id":"f41d95.dae13268","type":"link out","z":"881195da.84344","g":"19a13340.f4aca5","name":"Set Parameter Logg1","links":["dcafb912.e969f8"],"x":415,"y":1900,"wires":[]},{"id":"e1cfefe2.39914","type":"link out","z":"881195da.84344","g":"19a13340.f4aca5","name":"Set Parameter Logg2","links":["a71de70f.8d7c38","dcafb912.e969f8"],"x":1595,"y":2180,"wires":[]},{"id":"a71de70f.8d7c38","type":"link in","z":"881195da.84344","g":"6927dc25.3faf34","name":"","links":["e1cfefe2.39914"],"x":155,"y":760,"wires":[["3bc7d495.1d2dec"]]},{"id":"dcafb912.e969f8","type":"link in","z":"881195da.84344","name":"LoggingOutput","links":["e1cfefe2.39914","aaccd43f.9ed288","a00d4833.fadaa","c10cf44f.7b673","237eaa66.f321c6","f41d95.dae13268"],"x":1135,"y":680,"wires":[[]]},{"id":"73ddd610.486ce","type":"link out","z":"881195da.84344","g":"8ef55a1c.90a7a8","name":"New Trigger Received","links":["f3b3b117.9381c8","1cd86d33.956303"],"x":595,"y":280,"wires":[]},{"id":"f3b3b117.9381c8","type":"link in","z":"881195da.84344","g":"7dcefd3d.6085b4","name":"","links":["73ddd610.486ce"],"x":155,"y":440,"wires":[["79834146.72aee"]]},{"id":"1cd86d33.956303","type":"link in","z":"881195da.84344","g":"6927dc25.3faf34","name":"","links":["73ddd610.486ce"],"x":155,"y":680,"wires":[["546ded6d.f8aa7c"]]},{"id":"396b0813.ca5c28","type":"link out","z":"881195da.84344","g":"dc584493.81d2a8","name":"Device Online","links":["dc2d7006.fe548"],"x":615,"y":1080,"wires":[]},{"id":"c78c4173.6e6378","type":"link out","z":"881195da.84344","g":"dc584493.81d2a8","name":"Device Offline","links":["8ce5beda.afd6f"],"x":615,"y":1200,"wires":[]},{"id":"8ce5beda.afd6f","type":"link in","z":"881195da.84344","g":"6927dc25.3faf34","name":"","links":["c78c4173.6e6378"],"x":155,"y":640,"wires":[["63408071.41ca6"]]},{"id":"dc2d7006.fe548","type":"link in","z":"881195da.84344","g":"6927dc25.3faf34","name":"","links":["396b0813.ca5c28"],"x":155,"y":600,"wires":[["8be8fd9.0ae38"]]},{"id":"aaccd43f.9ed288","type":"link out","z":"881195da.84344","g":"dc584493.81d2a8","name":"Set IP Logg1","links":["3f6b0786.f8ad9","dcafb912.e969f8"],"x":835,"y":1160,"wires":[]},{"id":"fc387159.8f2958","type":"link out","z":"881195da.84344","g":"dc584493.81d2a8","name":"Start Auto-Config","links":["19d9c45a.511ffc"],"x":1035,"y":1160,"wires":[]},{"id":"19d9c45a.511ffc","type":"link in","z":"881195da.84344","g":"6927dc25.3faf34","name":"","links":["fc387159.8f2958"],"x":155,"y":720,"wires":[["b11cbec3.cf3728"]]},{"id":"237eaa66.f321c6","type":"link out","z":"881195da.84344","g":"dc584493.81d2a8","name":"Set IP Logg2","links":["dcafb912.e969f8"],"x":1155,"y":1620,"wires":[]},{"id":"dddf2c1e.3e51b","type":"link out","z":"881195da.84344","g":"dc584493.81d2a8","name":"Check URL again","links":["eeac0e38.215f08"],"x":2375,"y":1700,"wires":[]},{"id":"eeac0e38.215f08","type":"link in","z":"881195da.84344","g":"dc584493.81d2a8","name":"","links":["dddf2c1e.3e51b"],"x":1035,"y":1280,"wires":[["1e25a88b.334c27"]]},{"id":"daecde8f.6d4da","type":"http request","z":"881195da.84344","g":"dc584493.81d2a8","name":"Read actual button settings","method":"GET","ret":"obj","paytoqs":"ignore","url":"${URLSettingsInput}","tls":"","persist":false,"proxy":"","authType":"","x":1500,"y":1320,"wires":[["cd12bb4.41d5fc8"]]},{"id":"eb2de8b4.fa89c8","type":"function","z":"881195da.84344","g":"19a13340.f4aca5","name":"Configure Parameters to SEND","func":"var ButtonName = env.get(\"ButtonName\");\nvar URL = \"leer\";\n\nURL = \"name=\" +ButtonName;\n\nmsg.payload = URL;\n\n\nreturn msg;\n","outputs":1,"noerr":0,"initialize":"","finalize":"","x":950,"y":2180,"wires":[["2ef8943c.eb3474"]]},{"id":"2ef8943c.eb3474","type":"http request","z":"881195da.84344","g":"19a13340.f4aca5","name":"SET DeviceName","method":"POST","ret":"obj","paytoqs":"ignore","url":"${URLSettingsInput}","tls":"","persist":false,"proxy":"","authType":"","x":1210,"y":2180,"wires":[["b18aed9d.974688"]]},{"id":"382a89d8.5640be","type":"change","z":"881195da.84344","g":"19a13340.f4aca5","name":"Set Authentication","rules":[{"t":"set","p":"headers","pt":"msg","to":"{     \"Authorization\": 'Basic ' & $base64encode($env('UserName') & ':' & $env('Password')) }","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":690,"y":1940,"wires":[["ef771867.768f98"]]},{"id":"1e25a88b.334c27","type":"change","z":"881195da.84344","g":"dc584493.81d2a8","name":"Set Authentication","rules":[{"t":"set","p":"headers","pt":"msg","to":"{     \"Authorization\": 'Basic ' & $base64encode($env('UserName') & ':' & $env('Password')) }","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":1230,"y":1320,"wires":[["daecde8f.6d4da"]]},{"id":"b163b2e5.74f4d","type":"change","z":"881195da.84344","g":"dc584493.81d2a8","name":"Set Authentication","rules":[{"t":"set","p":"headers","pt":"msg","to":"{     \"Authorization\": 'Basic ' & $base64encode($env('UserName') & ':' & $env('Password')) }","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":1430,"y":1580,"wires":[["771d2019.a5a24"]]},{"id":"ca857f04.e0066","type":"change","z":"881195da.84344","g":"7dcefd3d.6085b4","name":"Set Authentication","rules":[{"t":"set","p":"headers","pt":"msg","to":"{     \"Authorization\": 'Basic ' & $base64encode($env('UserName') & ':' & $env('Password')) }","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":650,"y":440,"wires":[["71634f5d.2c375"]]},{"id":"74e2caa1.4f9e14","type":"change","z":"881195da.84344","g":"19a13340.f4aca5","name":"Set Authentication","rules":[{"t":"set","p":"headers","pt":"msg","to":"{     \"Authorization\": 'Basic ' & $base64encode($env('UserName') & ':' & $env('Password')) }","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":690,"y":2000,"wires":[["2baa543e.66218c"]]},{"id":"7a7cbf97.28caf","type":"change","z":"881195da.84344","g":"19a13340.f4aca5","name":"Set Authentication","rules":[{"t":"set","p":"headers","pt":"msg","to":"{     \"Authorization\": 'Basic ' & $base64encode($env('UserName') & ':' & $env('Password')) }","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":690,"y":2060,"wires":[["87fd09c2.6d05f"]]},{"id":"95ab3a2b.aff478","type":"change","z":"881195da.84344","g":"19a13340.f4aca5","name":"Set Authentication","rules":[{"t":"set","p":"headers","pt":"msg","to":"{     \"Authorization\": 'Basic ' & $base64encode($env('UserName') & ':' & $env('Password')) }","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":690,"y":2120,"wires":[["ce31a814.bf62b"]]},{"id":"f4470113.b8e51","type":"change","z":"881195da.84344","g":"19a13340.f4aca5","name":"Set Authentication","rules":[{"t":"set","p":"headers","pt":"msg","to":"{     \"Authorization\": 'Basic ' & $base64encode($env('UserName') & ':' & $env('Password')) }","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":690,"y":2180,"wires":[["eb2de8b4.fa89c8"]]},{"id":"672d358f.a42efc","type":"change","z":"881195da.84344","g":"dc584493.81d2a8","name":"Set Authentication","rules":[{"t":"set","p":"headers","pt":"msg","to":"{     \"Authorization\": 'Basic ' & $base64encode($env('UserName') & ':' & $env('Password')) }","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":1430,"y":1620,"wires":[["f61d7c71.bbaba"]]},{"id":"903a4c81.c1c1d","type":"change","z":"881195da.84344","g":"dc584493.81d2a8","name":"Set Authentication","rules":[{"t":"set","p":"headers","pt":"msg","to":"{     \"Authorization\": 'Basic ' & $base64encode($env('UserName') & ':' & $env('Password')) }","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":1430,"y":1660,"wires":[["ee7c96a5.2f1538"]]},{"id":"403a12d9.7a5914","type":"change","z":"881195da.84344","g":"dc584493.81d2a8","name":"Set Authentication","rules":[{"t":"set","p":"headers","pt":"msg","to":"{     \"Authorization\": 'Basic ' & $base64encode($env('UserName') & ':' & $env('Password')) }","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":1430,"y":1700,"wires":[["d7b6775a.138cd"]]},{"id":"cd12bb4.41d5fc8","type":"switch","z":"881195da.84344","g":"dc584493.81d2a8","name":"Chech Authentication","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"401 Unauthorized","vt":"str"},{"t":"neq","v":"401 Unauthorized","vt":"str"}],"checkall":"true","repair":false,"outputs":2,"x":1780,"y":1320,"wires":[["6a2715e2.453224"],["e34aaa30.cbbfd8"]]},{"id":"6a2715e2.453224","type":"change","z":"881195da.84344","g":"dc584493.81d2a8","name":"Logging","rules":[{"t":"set","p":"payload","pt":"msg","to":"Authentication incorrect","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":2000,"y":1280,"wires":[["c10cf44f.7b673"]]},{"id":"c10cf44f.7b673","type":"link out","z":"881195da.84344","g":"dc584493.81d2a8","name":"Log Error 401","links":["dcafb912.e969f8"],"x":2115,"y":1280,"wires":[]}]

Flow Info

Created 3 years, 11 months ago
Updated 3 years, 10 months ago
Rating: 5 1

Owner

Actions

Rate:

Node Types

Core
  • change (x40)
  • function (x11)
  • http in (x4)
  • http request (x11)
  • join (x1)
  • link in (x9)
  • link out (x11)
  • split (x2)
  • switch (x15)
  • trigger (x1)
Other

Tags

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