Skip to content

Instantly share code, notes, and snippets.

@sniicker
Last active September 17, 2020 07:57
Show Gist options
  • Save sniicker/ae9a026ae3068fc4906d729f782cc7a4 to your computer and use it in GitHub Desktop.
Save sniicker/ae9a026ae3068fc4906d729f782cc7a4 to your computer and use it in GitHub Desktop.
Demo Flow Shelly Buttons

Demo Flow for this Subflow.

Necessary nodes you will need to install

npm install node-red-contrib-simple-gate

npm install node-red-contrib-moment

npm install node-red-contrib-msg-resend

npm install node-red-contrib-ring-buffer

npm install node-red-node-ui-list

npm install node-red-dashboard

[{"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":"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":[]},{"id":"39502b.51341fd6","type":"tab","label":"Shelly Button Demo Flow","disabled":false,"info":""},{"id":"48b174ac.d67384","type":"group","z":"39502b.51341fd6","name":"List of last actions","style":{"stroke":"#777777","fill":"#d1d1d1","fill-opacity":"0.5","label":true,"color":"#777777"},"nodes":["1cbc3917.d2295f","2d8de197.d077d6","9a914bd9.020558","19a60b2a.537375","4bb77e0c.7ad9b8","c31817ef.950fc8","78eba88c.6fd21","abfbdfde.a177f8"],"x":54,"y":579,"w":1532,"h":122},{"id":"abca891f.e5b418","type":"subflow:881195da.84344","z":"39502b.51341fd6","name":"Button 1","env":[{"name":"IPAdresse","value":"192.168.0.101","type":"str"},{"name":"Password","type":"cred"},{"name":"Name","value":"Master","type":"str"}],"x":420,"y":420,"wires":[["c75312b8.eef418","ee6523e5.6f6c08"],["c75312b8.eef418","856489.d476cb78"],["c75312b8.eef418","24a8d077.48a5f8"],["c75312b8.eef418","6a0b4774.0fe4d8"],["f98c019e.69e9b"],["4a89d138.9aefe"]]},{"id":"14f77714.445141","type":"ui_text","z":"39502b.51341fd6","group":"f1e26423.4342c","order":2,"width":4,"height":1,"name":"Time at Last Action","label":"<i class=\"fa fa-clock-o fa-lg\" aria-hidden=\"true\"></i>","format":"{{msg.payload}}","layout":"col-center","x":1110,"y":240,"wires":[]},{"id":"79c9b15c.92f768","type":"ui_text","z":"39502b.51341fd6","group":"f1e26423.4342c","order":1,"width":4,"height":1,"name":"Last Action","label":"<i class=\"fa fa-hand-o-down fa-lg\" aria-hidden=\"true\"></i>","format":"{{msg.payload}}","layout":"col-center","x":1090,"y":340,"wires":[]},{"id":"ee6523e5.6f6c08","type":"change","z":"39502b.51341fd6","name":"1x Push","rules":[{"t":"set","p":"payload","pt":"msg","to":"1x Push","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":740,"y":280,"wires":[["79c9b15c.92f768"]]},{"id":"856489.d476cb78","type":"change","z":"39502b.51341fd6","name":"2x Push","rules":[{"t":"set","p":"payload","pt":"msg","to":"2x Push","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":740,"y":320,"wires":[["79c9b15c.92f768"]]},{"id":"24a8d077.48a5f8","type":"change","z":"39502b.51341fd6","name":"3x Push","rules":[{"t":"set","p":"payload","pt":"msg","to":"3x Push","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":740,"y":360,"wires":[["79c9b15c.92f768"]]},{"id":"6a0b4774.0fe4d8","type":"change","z":"39502b.51341fd6","name":"Long Push","rules":[{"t":"set","p":"payload","pt":"msg","to":"Long Push","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":750,"y":400,"wires":[["79c9b15c.92f768"]]},{"id":"f98c019e.69e9b","type":"ui_gauge","z":"39502b.51341fd6","name":"Battery","group":"f1e26423.4342c","order":3,"width":8,"height":4,"gtype":"donut","title":"<i class=\"fa fa-battery-three-quarters fa-lg\" aria-hidden=\"true\"></i>","label":"{{msg.payload.BatteryVoltage}}V","format":"{{msg.payload.BatteryValue}} %","min":0,"max":"100","colors":["#ca3838","#e6e600","#00ff00"],"seg1":"15","seg2":"30","x":1080,"y":440,"wires":[]},{"id":"c75312b8.eef418","type":"moment","z":"39502b.51341fd6","name":"","topic":"","input":"","inputType":"date","inTz":"Europe/Berlin","adjAmount":0,"adjType":"days","adjDir":"add","format":"HH:mm:ss DD.MMMYYYY","locale":"de_DE","output":"payload","outputType":"msg","outTz":"Europe/Berlin","x":780,"y":240,"wires":[["14f77714.445141","19a60b2a.537375"]]},{"id":"75e9894d.32867","type":"inject","z":"39502b.51341fd6","name":"Start Auto-Config Manual","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"auto-config","payloadType":"str","x":150,"y":420,"wires":[["abca891f.e5b418"]]},{"id":"4a89d138.9aefe","type":"debug","z":"39502b.51341fd6","name":"Logging","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":740,"y":480,"wires":[]},{"id":"1cbc3917.d2295f","type":"ring-buffer","z":"39502b.51341fd6","g":"48b174ac.d67384","name":"Buffer","capacity":"20","order":"new-to-old","sendOnlyIfFull":false,"pushAfterClear":false,"extra":false,"perTopic":false,"x":830,"y":660,"wires":[["78eba88c.6fd21"]]},{"id":"2d8de197.d077d6","type":"ui_list","z":"39502b.51341fd6","g":"48b174ac.d67384","group":"f1e26423.4342c","name":"List of Last 19 States","order":6,"width":8,"height":8,"lineType":"three","actionType":"none","allowHTML":false,"outputs":0,"topic":"","x":1460,"y":660,"wires":[]},{"id":"9a914bd9.020558","type":"function","z":"39502b.51341fd6","g":"48b174ac.d67384","name":"List prep","func":"var title1 = msg.payload[0].timeataction;\nvar description1 = msg.payload[0].action;\n\nvar title2 = msg.payload[1].timeataction;\nvar description2 = msg.payload[1].action;\n\nvar title3 = msg.payload[2].timeataction;\nvar description3 = msg.payload[2].action;\n\nvar title4 = msg.payload[3].timeataction;\nvar description4 = msg.payload[3].action;\n\nvar title5 = msg.payload[4].timeataction;\nvar description5 = msg.payload[4].action;\n\nvar title6 = msg.payload[5].timeataction;\nvar description6 = msg.payload[5].action;\n\nvar title7 = msg.payload[6].timeataction;\nvar description7 = msg.payload[6].action;\n\nvar title8 = msg.payload[7].timeataction;\nvar description8 = msg.payload[7].action;\n\nvar title9 = msg.payload[8].timeataction;\nvar description9 = msg.payload[8].action;\n\nvar title10 = msg.payload[9].timeataction;\nvar description10 = msg.payload[9].action;\n\nvar title11 = msg.payload[10].timeataction;\nvar description11 = msg.payload[10].action;\n\nvar title12 = msg.payload[11].timeataction;\nvar description12 = msg.payload[11].action;\n\nvar title13 = msg.payload[12].timeataction;\nvar description13 = msg.payload[12].action;\n\nvar title14 = msg.payload[13].timeataction;\nvar description14 = msg.payload[13].action;\n\nvar title15 = msg.payload[14].timeataction;\nvar description15 = msg.payload[14].action;\n\nvar title16 = msg.payload[15].timeataction;\nvar description16 = msg.payload[15].action;\n\nvar title17 = msg.payload[16].timeataction;\nvar description17 = msg.payload[16].action;\n\nvar title18 = msg.payload[17].timeataction;\nvar description18 = msg.payload[17].action;\n\nvar title19 = msg.payload[18].timeataction;\nvar description19 = msg.payload[18].action;\n\nvar title20 = msg.payload[19].timeataction;\nvar description20 = msg.payload[19].action;\n\n\n\n\n\n\nmsg.payload = [\n {\n \"title\": title2,\n \"description\": description2,\n \"icon_name\": \"fa-hand-o-down\"\n },\n {\n \"title\": title3,\n \"description\": description3,\n \"icon_name\": \"fa-hand-o-down\"\n },\n {\n \"title\": title4,\n \"description\": description4,\n \"icon_name\": \"fa-hand-o-down\"\n },\n {\n \"title\": title5,\n \"description\": description5,\n \"icon_name\": \"fa-hand-o-down\"\n },\n {\n \"title\": title6,\n \"description\": description6,\n \"icon_name\": \"fa-hand-o-down\"\n },\n {\n \"title\": title7,\n \"description\": description7,\n \"icon_name\": \"fa-hand-o-down\"\n },\n {\n \"title\": title8,\n \"description\": description8,\n \"icon_name\": \"fa-hand-o-down\"\n },\n {\n \"title\": title9,\n \"description\": description9,\n \"icon_name\": \"fa-hand-o-down\"\n },\n {\n \"title\": title10,\n \"description\": description10,\n \"icon_name\": \"fa-hand-o-down\"\n },\n {\n \"title\": title11,\n \"description\": description11,\n \"icon_name\": \"fa-hand-o-down\"\n },\n {\n \"title\": title12,\n \"description\": description12,\n \"icon_name\": \"fa-hand-o-down\"\n },\n {\n \"title\": title13,\n \"description\": description13,\n \"icon_name\": \"fa-hand-o-down\"\n },\n {\n \"title\": title14,\n \"description\": description14,\n \"icon_name\": \"fa-hand-o-down\"\n },\n {\n \"title\": title15,\n \"description\": description15,\n \"icon_name\": \"fa-hand-o-down\"\n },\n {\n \"title\": title16,\n \"description\": description16,\n \"icon_name\": \"fa-hand-o-down\"\n },\n {\n \"title\": title17,\n \"description\": description17,\n \"icon_name\": \"fa-hand-o-down\"\n },\n {\n \"title\": title18,\n \"description\": description18,\n \"icon_name\": \"fa-hand-o-down\"\n },\n {\n \"title\": title19,\n \"description\": description19,\n \"icon_name\": \"fa-hand-o-down\"\n },\n {\n \"title\": title20,\n \"description\": description20,\n \"icon_name\": \"fa-hand-o-down\"\n },\n \n]\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":1200,"y":660,"wires":[["2d8de197.d077d6"]]},{"id":"19a60b2a.537375","type":"function","z":"39502b.51341fd6","g":"48b174ac.d67384","name":"Data prep","func":"var TOPIC = msg.topic;\nvar PAYLOAD = msg.payload;\n\nmsg.payload = {\n \"action\" : TOPIC,\n \"timeataction\" : PAYLOAD\n}\n \nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":620,"y":660,"wires":[["1cbc3917.d2295f"]]},{"id":"4bb77e0c.7ad9b8","type":"inject","z":"39502b.51341fd6","g":"48b174ac.d67384","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":true,"onceDelay":0.1,"topic":"","payload":"","payloadType":"str","x":160,"y":660,"wires":[["c31817ef.950fc8"]]},{"id":"c31817ef.950fc8","type":"msg-resend","z":"39502b.51341fd6","g":"48b174ac.d67384","interval":"300","intervalUnit":"msecs","maximum":"25","bytopic":false,"clone":true,"firstDelayed":false,"addCounters":false,"highRate":false,"outputCountField":"","outputMaxField":"","name":"Fill Buffer after restart","x":360,"y":660,"wires":[["19a60b2a.537375"]]},{"id":"78eba88c.6fd21","type":"gate","z":"39502b.51341fd6","g":"48b174ac.d67384","name":"","controlTopic":"control","defaultState":"closed","openCmd":"open","closeCmd":"close","toggleCmd":"toggle","defaultCmd":"default","persist":false,"x":1050,"y":660,"wires":[["9a914bd9.020558"]]},{"id":"abfbdfde.a177f8","type":"inject","z":"39502b.51341fd6","g":"48b174ac.d67384","name":"Open Gate after 10sec","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":true,"onceDelay":"10","topic":"control","payload":"open","payloadType":"str","x":810,"y":620,"wires":[["78eba88c.6fd21"]]},{"id":"f1e26423.4342c","type":"ui_group","z":"","name":"Button 1","tab":"9f4436e7.ce2c6","order":1,"disp":true,"width":"8","collapse":false},{"id":"9f4436e7.ce2c6","type":"ui_tab","z":"","name":"Button","icon":"fa-hand-o-down","order":8,"disabled":false,"hidden":false}]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment