Skip to content

Instantly share code, notes, and snippets.

@techlemur
Last active July 24, 2018 18:29
Show Gist options
  • Save techlemur/2f085b47189475733d6de3a3f0dedbee to your computer and use it in GitHub Desktop.
Save techlemur/2f085b47189475733d6de3a3f0dedbee to your computer and use it in GitHub Desktop.

Revisions

  1. techlemur revised this gist Jul 24, 2018. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion AlexaPiControl.json
    Original file line number Diff line number Diff line change
    @@ -1 +1 @@
    [{"id":"f1de55df.5e2f88","type":"subflow","name":"Execute Shell Script","info":"","in":[{"x":100,"y":200,"wires":[{"id":"285cddd0.d7e24a"}]}],"out":[{"x":960,"y":280,"wires":[{"id":"62b058c.3afd0a8","port":0}]},{"x":960,"y":340,"wires":[{"id":"62b058c.3afd0a8","port":1}]},{"x":960,"y":400,"wires":[{"id":"62b058c.3afd0a8","port":2}]}]},{"id":"76a063c9.c6b974","type":"file","z":"f1de55df.5e2f88","name":"Write script file","filename":"","appendNewline":true,"createDir":false,"overwriteFile":"false","x":860,"y":140,"wires":[]},{"id":"d0bfe6c1.044a5","type":"exec","z":"f1de55df.5e2f88","command":"mktemp","addpay":false,"append":"","useSpawn":"","timer":"","name":"","x":420,"y":200,"wires":[["fe9bd6b2.929e7"],[],[]]},{"id":"b4a9ec57.96bc4","type":"file","z":"f1de55df.5e2f88","name":"Delete script file","filename":"","appendNewline":true,"createDir":false,"overwriteFile":"delete","x":1020,"y":480,"wires":[]},{"id":"62b058c.3afd0a8","type":"exec","z":"f1de55df.5e2f88","command":" sh ","addpay":true,"append":"","useSpawn":"","timer":"","name":"Execute the shell script","x":690,"y":340,"wires":[["b4a9ec57.96bc4"],[],[]]},{"id":"fbb9e1ff.5101d8","type":"exec","z":"f1de55df.5e2f88","command":"chmod +x ","addpay":true,"append":"","useSpawn":"","timer":"","name":"","x":1040,"y":200,"wires":[["2e95caad.66f9fe"],[],[]]},{"id":"285cddd0.d7e24a","type":"change","z":"f1de55df.5e2f88","name":"","rules":[{"t":"set","p":"command","pt":"msg","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":230,"y":200,"wires":[["d0bfe6c1.044a5"]]},{"id":"30114b40.606d84","type":"change","z":"f1de55df.5e2f88","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"filename","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":860,"y":200,"wires":[["fbb9e1ff.5101d8"]]},{"id":"fe9bd6b2.929e7","type":"function","z":"f1de55df.5e2f88","name":"","func":"msg.filename = msg.payload.trim();\nmsg.payload = msg.command;\nreturn msg;","outputs":1,"noerr":0,"x":590,"y":180,"wires":[["76a063c9.c6b974","30114b40.606d84"]]},{"id":"2e95caad.66f9fe","type":"change","z":"f1de55df.5e2f88","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"filename","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":480,"y":340,"wires":[["62b058c.3afd0a8"]]},{"id":"6f02b2cb.adf59c","type":"comment","z":"f1de55df.5e2f88","name":"Execute shell script","info":"Execute the shell script in msg.payload.","x":130,"y":40,"wires":[]},{"id":"231541c2.2ef7ae","type":"template","z":"3c6601f6.a56b66","name":"Shell Script - Shutdown","field":"payload","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"#! /bin/sh\n\nsudo shutdown -P -t now","x":780,"y":280,"wires":[["961fcace.c4b6d"]]},{"id":"def7c165.e09c08","type":"inject","z":"3c6601f6.a56b66","name":"shutdown","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"onceDelay":"","x":520,"y":300,"wires":[["231541c2.2ef7ae"]]},{"id":"961fcace.c4b6d","type":"subflow:f1de55df.5e2f88","z":"3c6601f6.a56b66","name":"","x":1220,"y":160,"wires":[["33c5a854.e89b08"],["33c5a854.e89b08"],["33c5a854.e89b08"]]},{"id":"62f49a89.b6ec94","type":"switch","z":"3c6601f6.a56b66","name":"","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"on","vt":"str"},{"t":"eq","v":"off","vt":"str"}],"checkall":"true","repair":false,"outputs":2,"x":510,"y":260,"wires":[["95f34023.1a1908"],["231541c2.2ef7ae"]]},{"id":"33c5a854.e89b08","type":"debug","z":"3c6601f6.a56b66","name":"Log the result","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","x":1440,"y":160,"wires":[]},{"id":"95f34023.1a1908","type":"template","z":"3c6601f6.a56b66","name":"Shell Script - Reboot","field":"payload","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"#! /bin/sh\n\nsudo reboot","x":780,"y":240,"wires":[["961fcace.c4b6d"]]},{"id":"47a7262a.169a38","type":"template","z":"3c6601f6.a56b66","name":"Shell Script - stop nodered and bluetooth 20","field":"payload","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"#! /bin/sh\n\nsudo /etc/init.d/bluetooth stop\n\n\nsudo systemctl stop nodered.service","x":780,"y":200,"wires":[["961fcace.c4b6d"]]},{"id":"20b6f99b.707126","type":"template","z":"3c6601f6.a56b66","name":"Shell Script - stop nodered 50","field":"payload","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"#! /bin/sh\n\nsudo systemctl stop nodered.service","x":780,"y":160,"wires":[["961fcace.c4b6d"]]},{"id":"7f12e428.a290bc","type":"template","z":"3c6601f6.a56b66","name":"Shell Script - start/restart nodered, apache, haBridge, and mosquitto","field":"payload","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"#! /bin/sh\n\nsudo /etc/init.d/bluetooth restart\nsudo systemctl restart nodered.service\nsudo systemctl restart apache2.service\nsudo systemctl restart habridge.service\nsudo systemctl restart mosquitto.service ","x":780,"y":40,"wires":[["961fcace.c4b6d"]]},{"id":"912947e5.74d118","type":"template","z":"3c6601f6.a56b66","name":"Shell Script - start/restart bluetooth 90","field":"payload","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"#! /bin/sh\n\nsudo /etc/init.d/bluetooth restart","x":780,"y":80,"wires":[["961fcace.c4b6d"]]},{"id":"1add10fa.19c44f","type":"switch","z":"3c6601f6.a56b66","name":"on/off command?","property":"on_off_command","propertyType":"msg","rules":[{"t":"false"},{"t":"true"}],"checkall":"true","repair":false,"outputs":2,"x":300,"y":160,"wires":[["c75afe69.9f6a2"],["62f49a89.b6ec94"]]},{"id":"5e454a7f.2b4b9c","type":"inject","z":"3c6601f6.a56b66","name":"reboot","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"onceDelay":"","x":510,"y":220,"wires":[["95f34023.1a1908"]]},{"id":"c75afe69.9f6a2","type":"switch","z":"3c6601f6.a56b66","name":"brightness","property":"bri","propertyType":"msg","rules":[{"t":"eq","v":"100","vt":"num"},{"t":"eq","v":"95","vt":"num"},{"t":"eq","v":"90","vt":"num"},{"t":"eq","v":"60","vt":"num"},{"t":"eq","v":"50","vt":"num"},{"t":"eq","v":"20","vt":"num"}],"checkall":"true","repair":false,"outputs":6,"x":530,"y":100,"wires":[["7f12e428.a290bc"],[],["912947e5.74d118"],["3e61cfdb.0a305"],["20b6f99b.707126"],["47a7262a.169a38"]]},{"id":"6d2a9db9.27415c","type":"alexa-local","z":"3c6601f6.a56b66","devicename":"raspberry pie","inputtrigger":false,"x":100,"y":160,"wires":[["1add10fa.19c44f"]]},{"id":"3e61cfdb.0a305","type":"template","z":"3c6601f6.a56b66","name":"Shell Script - start/restart nodered 50","field":"payload","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"#! /bin/sh\n\nsudo systemctl restart nodered.service","x":780,"y":120,"wires":[[]]},{"id":"357b06f7.b56c5a","type":"comment","z":"3c6601f6.a56b66","name":"README","info":"https://gist.github.com/techlemur/2f085b47189475733d6de3a3f0dedbee\n\nI've only tried this with the echo dot gen2 but\nit should work on gen1 dots as well.\n\nRequires node-red-contrib-alexa-local.\n\nAfter installing just say \"Alexa, discover devices\".\nShe should find a new “light” named raspberry pi.\nAfter Alexa discovers the light you can control \nYour pi by telling Alexa to...\n\n“turn {on|off} raspberry pi” \nor\n“set raspberry pi to {number 1-100}”.\n\nSadly there's no other commands that will work \nwith the virtual light so you have to memorize \nwhat you set the percentages to.\n\nKudos to uphy for the “Execute Shell Script” subflow.\nhttps://gist.github.com/uphy/7aab9758be41888e20b94d14e9c50976\n\n~Techlemur\n","x":80,"y":120,"wires":[]},{"id":"7cc467d0.17043","type":"comment","z":"3c6601f6.a56b66","name":"Kudos to uphy for this subflow","info":"https://gist.github.com/uphy/7aab9758be41888e20b94d14e9c50976","x":1210,"y":120,"wires":[]},{"id":"38c4ca5c.af95ae","type":"comment","z":"3c6601f6.a56b66","name":"REQUIRES node-red-contrib-alexa-local","info":"You must install node-red-contrib-alexa-local\nbefore this will work.","x":90,"y":80,"wires":[]}]
    [{"id":"f1de55df.5e2f88","type":"subflow","name":"Execute Shell Script","info":"","in":[{"x":100,"y":200,"wires":[{"id":"285cddd0.d7e24a"}]}],"out":[{"x":960,"y":280,"wires":[{"id":"62b058c.3afd0a8","port":0}]},{"x":960,"y":340,"wires":[{"id":"62b058c.3afd0a8","port":1}]},{"x":960,"y":400,"wires":[{"id":"62b058c.3afd0a8","port":2}]}]},{"id":"76a063c9.c6b974","type":"file","z":"f1de55df.5e2f88","name":"Write script file","filename":"","appendNewline":true,"createDir":false,"overwriteFile":"false","x":860,"y":140,"wires":[]},{"id":"d0bfe6c1.044a5","type":"exec","z":"f1de55df.5e2f88","command":"mktemp","addpay":false,"append":"","useSpawn":"","timer":"","name":"","x":420,"y":200,"wires":[["fe9bd6b2.929e7"],[],[]]},{"id":"b4a9ec57.96bc4","type":"file","z":"f1de55df.5e2f88","name":"Delete script file","filename":"","appendNewline":true,"createDir":false,"overwriteFile":"delete","x":1020,"y":480,"wires":[]},{"id":"62b058c.3afd0a8","type":"exec","z":"f1de55df.5e2f88","command":" sh ","addpay":true,"append":"","useSpawn":"","timer":"","name":"Execute the shell script","x":690,"y":340,"wires":[["b4a9ec57.96bc4"],[],[]]},{"id":"fbb9e1ff.5101d8","type":"exec","z":"f1de55df.5e2f88","command":"chmod +x ","addpay":true,"append":"","useSpawn":"","timer":"","name":"","x":1040,"y":200,"wires":[["2e95caad.66f9fe"],[],[]]},{"id":"285cddd0.d7e24a","type":"change","z":"f1de55df.5e2f88","name":"","rules":[{"t":"set","p":"command","pt":"msg","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":230,"y":200,"wires":[["d0bfe6c1.044a5"]]},{"id":"30114b40.606d84","type":"change","z":"f1de55df.5e2f88","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"filename","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":860,"y":200,"wires":[["fbb9e1ff.5101d8"]]},{"id":"fe9bd6b2.929e7","type":"function","z":"f1de55df.5e2f88","name":"","func":"msg.filename = msg.payload.trim();\nmsg.payload = msg.command;\nreturn msg;","outputs":1,"noerr":0,"x":590,"y":180,"wires":[["76a063c9.c6b974","30114b40.606d84"]]},{"id":"2e95caad.66f9fe","type":"change","z":"f1de55df.5e2f88","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"filename","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":480,"y":340,"wires":[["62b058c.3afd0a8"]]},{"id":"6f02b2cb.adf59c","type":"comment","z":"f1de55df.5e2f88","name":"Execute shell script","info":"Execute the shell script in msg.payload.","x":130,"y":40,"wires":[]},{"id":"231541c2.2ef7ae","type":"template","z":"3c6601f6.a56b66","name":"Shell Script - Shutdown","field":"payload","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"#! /bin/sh\n\nsudo shutdown -P -t now","x":780,"y":280,"wires":[["961fcace.c4b6d"]]},{"id":"def7c165.e09c08","type":"inject","z":"3c6601f6.a56b66","name":"shutdown","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"onceDelay":"","x":520,"y":300,"wires":[["231541c2.2ef7ae"]]},{"id":"961fcace.c4b6d","type":"subflow:f1de55df.5e2f88","z":"3c6601f6.a56b66","name":"","x":1220,"y":160,"wires":[["33c5a854.e89b08"],["33c5a854.e89b08"],["33c5a854.e89b08"]]},{"id":"62f49a89.b6ec94","type":"switch","z":"3c6601f6.a56b66","name":"","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"on","vt":"str"},{"t":"eq","v":"off","vt":"str"}],"checkall":"true","repair":false,"outputs":2,"x":510,"y":260,"wires":[["95f34023.1a1908"],["231541c2.2ef7ae"]]},{"id":"33c5a854.e89b08","type":"debug","z":"3c6601f6.a56b66","name":"Log the result","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","x":1440,"y":160,"wires":[]},{"id":"95f34023.1a1908","type":"template","z":"3c6601f6.a56b66","name":"Shell Script - Reboot","field":"payload","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"#! /bin/sh\n\nsudo reboot","x":780,"y":240,"wires":[["961fcace.c4b6d"]]},{"id":"47a7262a.169a38","type":"template","z":"3c6601f6.a56b66","name":"Shell Script - stop nodered and bluetooth 20","field":"payload","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"#! /bin/sh\n\nsudo /etc/init.d/bluetooth stop\n\n\nsudo systemctl stop nodered.service","x":780,"y":200,"wires":[["961fcace.c4b6d"]]},{"id":"20b6f99b.707126","type":"template","z":"3c6601f6.a56b66","name":"Shell Script - stop nodered 50","field":"payload","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"#! /bin/sh\n\nsudo systemctl stop nodered.service","x":780,"y":160,"wires":[["961fcace.c4b6d"]]},{"id":"7f12e428.a290bc","type":"template","z":"3c6601f6.a56b66","name":"Shell Script - start/restart nodered, apache, haBridge, and mosquitto","field":"payload","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"#! /bin/sh\n\nsudo /etc/init.d/bluetooth restart\nsudo systemctl restart nodered.service\nsudo systemctl restart apache2.service\nsudo systemctl restart habridge.service\nsudo systemctl restart mosquitto.service ","x":780,"y":40,"wires":[["961fcace.c4b6d"]]},{"id":"912947e5.74d118","type":"template","z":"3c6601f6.a56b66","name":"Shell Script - start/restart bluetooth 90","field":"payload","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"#! /bin/sh\n\nsudo /etc/init.d/bluetooth restart","x":780,"y":80,"wires":[["961fcace.c4b6d"]]},{"id":"1add10fa.19c44f","type":"switch","z":"3c6601f6.a56b66","name":"on/off command?","property":"on_off_command","propertyType":"msg","rules":[{"t":"false"},{"t":"true"}],"checkall":"true","repair":false,"outputs":2,"x":300,"y":160,"wires":[["c75afe69.9f6a2"],["62f49a89.b6ec94"]]},{"id":"5e454a7f.2b4b9c","type":"inject","z":"3c6601f6.a56b66","name":"reboot","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"onceDelay":"","x":510,"y":220,"wires":[["95f34023.1a1908"]]},{"id":"c75afe69.9f6a2","type":"switch","z":"3c6601f6.a56b66","name":"brightness","property":"bri","propertyType":"msg","rules":[{"t":"eq","v":"100","vt":"num"},{"t":"eq","v":"95","vt":"num"},{"t":"eq","v":"90","vt":"num"},{"t":"eq","v":"60","vt":"num"},{"t":"eq","v":"50","vt":"num"},{"t":"eq","v":"20","vt":"num"}],"checkall":"true","repair":false,"outputs":6,"x":530,"y":100,"wires":[["7f12e428.a290bc"],[],["912947e5.74d118"],["3e61cfdb.0a305"],["20b6f99b.707126"],["47a7262a.169a38"]]},{"id":"6d2a9db9.27415c","type":"alexa-local","z":"3c6601f6.a56b66","devicename":"raspberry pie","inputtrigger":false,"x":100,"y":160,"wires":[["1add10fa.19c44f"]]},{"id":"3e61cfdb.0a305","type":"template","z":"3c6601f6.a56b66","name":"Shell Script - start/restart nodered 50","field":"payload","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"#! /bin/sh\n\nsudo systemctl restart nodered.service","x":780,"y":120,"wires":[[]]},{"id":"357b06f7.b56c5a","type":"comment","z":"3c6601f6.a56b66","name":"README","info":"https://gist.github.com/techlemur/2f085b47189475733d6de3a3f0dedbee\n\nI've only tried this with the echo dot gen2 but\nit should work on gen1 dots as well.\n\nRequires node-red-contrib-alexa-local.\n\nThe user node red is running as must also\nhave sudo access without asking for a password.\n\nAfter installing just say \"Alexa, discover devices\".\nShe should find a new “light” named raspberry pi.\nAfter Alexa discovers the light you can control\nYour pi by telling Alexa to...\n\n“turn {on|off} raspberry pi”\nor\n“set raspberry pi to {number 1-100}”.\n\nSadly there's no other commands that will work\nwith the virtual light so you have to memorize\nwhat you set the percentages to.\n\nKudos to uphy for the “Execute Shell Script” subflow.\nhttps://gist.github.com/uphy/7aab9758be41888e20b94d14e9c50976\n\n~Techlemur\n\n\n\n","x":80,"y":120,"wires":[]},{"id":"7cc467d0.17043","type":"comment","z":"3c6601f6.a56b66","name":"Kudos to uphy for this subflow","info":"https://gist.github.com/uphy/7aab9758be41888e20b94d14e9c50976","x":1210,"y":120,"wires":[]},{"id":"38c4ca5c.af95ae","type":"comment","z":"3c6601f6.a56b66","name":"REQUIRES node-red-contrib-alexa-local","info":"You must install node-red-contrib-alexa-local\nbefore this will work.","x":90,"y":80,"wires":[]}]
  2. techlemur revised this gist Jul 24, 2018. 2 changed files with 1 addition and 1 deletion.
    1 change: 1 addition & 0 deletions AlexaPiControl.json
    Original file line number Diff line number Diff line change
    @@ -0,0 +1 @@
    [{"id":"f1de55df.5e2f88","type":"subflow","name":"Execute Shell Script","info":"","in":[{"x":100,"y":200,"wires":[{"id":"285cddd0.d7e24a"}]}],"out":[{"x":960,"y":280,"wires":[{"id":"62b058c.3afd0a8","port":0}]},{"x":960,"y":340,"wires":[{"id":"62b058c.3afd0a8","port":1}]},{"x":960,"y":400,"wires":[{"id":"62b058c.3afd0a8","port":2}]}]},{"id":"76a063c9.c6b974","type":"file","z":"f1de55df.5e2f88","name":"Write script file","filename":"","appendNewline":true,"createDir":false,"overwriteFile":"false","x":860,"y":140,"wires":[]},{"id":"d0bfe6c1.044a5","type":"exec","z":"f1de55df.5e2f88","command":"mktemp","addpay":false,"append":"","useSpawn":"","timer":"","name":"","x":420,"y":200,"wires":[["fe9bd6b2.929e7"],[],[]]},{"id":"b4a9ec57.96bc4","type":"file","z":"f1de55df.5e2f88","name":"Delete script file","filename":"","appendNewline":true,"createDir":false,"overwriteFile":"delete","x":1020,"y":480,"wires":[]},{"id":"62b058c.3afd0a8","type":"exec","z":"f1de55df.5e2f88","command":" sh ","addpay":true,"append":"","useSpawn":"","timer":"","name":"Execute the shell script","x":690,"y":340,"wires":[["b4a9ec57.96bc4"],[],[]]},{"id":"fbb9e1ff.5101d8","type":"exec","z":"f1de55df.5e2f88","command":"chmod +x ","addpay":true,"append":"","useSpawn":"","timer":"","name":"","x":1040,"y":200,"wires":[["2e95caad.66f9fe"],[],[]]},{"id":"285cddd0.d7e24a","type":"change","z":"f1de55df.5e2f88","name":"","rules":[{"t":"set","p":"command","pt":"msg","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":230,"y":200,"wires":[["d0bfe6c1.044a5"]]},{"id":"30114b40.606d84","type":"change","z":"f1de55df.5e2f88","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"filename","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":860,"y":200,"wires":[["fbb9e1ff.5101d8"]]},{"id":"fe9bd6b2.929e7","type":"function","z":"f1de55df.5e2f88","name":"","func":"msg.filename = msg.payload.trim();\nmsg.payload = msg.command;\nreturn msg;","outputs":1,"noerr":0,"x":590,"y":180,"wires":[["76a063c9.c6b974","30114b40.606d84"]]},{"id":"2e95caad.66f9fe","type":"change","z":"f1de55df.5e2f88","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"filename","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":480,"y":340,"wires":[["62b058c.3afd0a8"]]},{"id":"6f02b2cb.adf59c","type":"comment","z":"f1de55df.5e2f88","name":"Execute shell script","info":"Execute the shell script in msg.payload.","x":130,"y":40,"wires":[]},{"id":"231541c2.2ef7ae","type":"template","z":"3c6601f6.a56b66","name":"Shell Script - Shutdown","field":"payload","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"#! /bin/sh\n\nsudo shutdown -P -t now","x":780,"y":280,"wires":[["961fcace.c4b6d"]]},{"id":"def7c165.e09c08","type":"inject","z":"3c6601f6.a56b66","name":"shutdown","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"onceDelay":"","x":520,"y":300,"wires":[["231541c2.2ef7ae"]]},{"id":"961fcace.c4b6d","type":"subflow:f1de55df.5e2f88","z":"3c6601f6.a56b66","name":"","x":1220,"y":160,"wires":[["33c5a854.e89b08"],["33c5a854.e89b08"],["33c5a854.e89b08"]]},{"id":"62f49a89.b6ec94","type":"switch","z":"3c6601f6.a56b66","name":"","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"on","vt":"str"},{"t":"eq","v":"off","vt":"str"}],"checkall":"true","repair":false,"outputs":2,"x":510,"y":260,"wires":[["95f34023.1a1908"],["231541c2.2ef7ae"]]},{"id":"33c5a854.e89b08","type":"debug","z":"3c6601f6.a56b66","name":"Log the result","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","x":1440,"y":160,"wires":[]},{"id":"95f34023.1a1908","type":"template","z":"3c6601f6.a56b66","name":"Shell Script - Reboot","field":"payload","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"#! /bin/sh\n\nsudo reboot","x":780,"y":240,"wires":[["961fcace.c4b6d"]]},{"id":"47a7262a.169a38","type":"template","z":"3c6601f6.a56b66","name":"Shell Script - stop nodered and bluetooth 20","field":"payload","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"#! /bin/sh\n\nsudo /etc/init.d/bluetooth stop\n\n\nsudo systemctl stop nodered.service","x":780,"y":200,"wires":[["961fcace.c4b6d"]]},{"id":"20b6f99b.707126","type":"template","z":"3c6601f6.a56b66","name":"Shell Script - stop nodered 50","field":"payload","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"#! /bin/sh\n\nsudo systemctl stop nodered.service","x":780,"y":160,"wires":[["961fcace.c4b6d"]]},{"id":"7f12e428.a290bc","type":"template","z":"3c6601f6.a56b66","name":"Shell Script - start/restart nodered, apache, haBridge, and mosquitto","field":"payload","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"#! /bin/sh\n\nsudo /etc/init.d/bluetooth restart\nsudo systemctl restart nodered.service\nsudo systemctl restart apache2.service\nsudo systemctl restart habridge.service\nsudo systemctl restart mosquitto.service ","x":780,"y":40,"wires":[["961fcace.c4b6d"]]},{"id":"912947e5.74d118","type":"template","z":"3c6601f6.a56b66","name":"Shell Script - start/restart bluetooth 90","field":"payload","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"#! /bin/sh\n\nsudo /etc/init.d/bluetooth restart","x":780,"y":80,"wires":[["961fcace.c4b6d"]]},{"id":"1add10fa.19c44f","type":"switch","z":"3c6601f6.a56b66","name":"on/off command?","property":"on_off_command","propertyType":"msg","rules":[{"t":"false"},{"t":"true"}],"checkall":"true","repair":false,"outputs":2,"x":300,"y":160,"wires":[["c75afe69.9f6a2"],["62f49a89.b6ec94"]]},{"id":"5e454a7f.2b4b9c","type":"inject","z":"3c6601f6.a56b66","name":"reboot","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"onceDelay":"","x":510,"y":220,"wires":[["95f34023.1a1908"]]},{"id":"c75afe69.9f6a2","type":"switch","z":"3c6601f6.a56b66","name":"brightness","property":"bri","propertyType":"msg","rules":[{"t":"eq","v":"100","vt":"num"},{"t":"eq","v":"95","vt":"num"},{"t":"eq","v":"90","vt":"num"},{"t":"eq","v":"60","vt":"num"},{"t":"eq","v":"50","vt":"num"},{"t":"eq","v":"20","vt":"num"}],"checkall":"true","repair":false,"outputs":6,"x":530,"y":100,"wires":[["7f12e428.a290bc"],[],["912947e5.74d118"],["3e61cfdb.0a305"],["20b6f99b.707126"],["47a7262a.169a38"]]},{"id":"6d2a9db9.27415c","type":"alexa-local","z":"3c6601f6.a56b66","devicename":"raspberry pie","inputtrigger":false,"x":100,"y":160,"wires":[["1add10fa.19c44f"]]},{"id":"3e61cfdb.0a305","type":"template","z":"3c6601f6.a56b66","name":"Shell Script - start/restart nodered 50","field":"payload","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"#! /bin/sh\n\nsudo systemctl restart nodered.service","x":780,"y":120,"wires":[[]]},{"id":"357b06f7.b56c5a","type":"comment","z":"3c6601f6.a56b66","name":"README","info":"https://gist.github.com/techlemur/2f085b47189475733d6de3a3f0dedbee\n\nI've only tried this with the echo dot gen2 but\nit should work on gen1 dots as well.\n\nRequires node-red-contrib-alexa-local.\n\nAfter installing just say \"Alexa, discover devices\".\nShe should find a new “light” named raspberry pi.\nAfter Alexa discovers the light you can control \nYour pi by telling Alexa to...\n\n“turn {on|off} raspberry pi” \nor\n“set raspberry pi to {number 1-100}”.\n\nSadly there's no other commands that will work \nwith the virtual light so you have to memorize \nwhat you set the percentages to.\n\nKudos to uphy for the “Execute Shell Script” subflow.\nhttps://gist.github.com/uphy/7aab9758be41888e20b94d14e9c50976\n\n~Techlemur\n","x":80,"y":120,"wires":[]},{"id":"7cc467d0.17043","type":"comment","z":"3c6601f6.a56b66","name":"Kudos to uphy for this subflow","info":"https://gist.github.com/uphy/7aab9758be41888e20b94d14e9c50976","x":1210,"y":120,"wires":[]},{"id":"38c4ca5c.af95ae","type":"comment","z":"3c6601f6.a56b66","name":"REQUIRES node-red-contrib-alexa-local","info":"You must install node-red-contrib-alexa-local\nbefore this will work.","x":90,"y":80,"wires":[]}]
    1 change: 0 additions & 1 deletion alexapicontrol.txt
    Original file line number Diff line number Diff line change
    @@ -1 +0,0 @@
    [{"id":"f1de55df.5e2f88","type":"subflow","name":"Execute Shell Script","info":"","in":[{"x":100,"y":200,"wires":[{"id":"285cddd0.d7e24a"}]}],"out":[{"x":960,"y":280,"wires":[{"id":"62b058c.3afd0a8","port":0}]},{"x":960,"y":340,"wires":[{"id":"62b058c.3afd0a8","port":1}]},{"x":960,"y":400,"wires":[{"id":"62b058c.3afd0a8","port":2}]}]},{"id":"76a063c9.c6b974","type":"file","z":"f1de55df.5e2f88","name":"Write script file","filename":"","appendNewline":true,"createDir":false,"overwriteFile":"false","x":860,"y":140,"wires":[]},{"id":"d0bfe6c1.044a5","type":"exec","z":"f1de55df.5e2f88","command":"mktemp","addpay":false,"append":"","useSpawn":"","timer":"","name":"","x":420,"y":200,"wires":[["fe9bd6b2.929e7"],[],[]]},{"id":"b4a9ec57.96bc4","type":"file","z":"f1de55df.5e2f88","name":"Delete script file","filename":"","appendNewline":true,"createDir":false,"overwriteFile":"delete","x":1020,"y":480,"wires":[]},{"id":"62b058c.3afd0a8","type":"exec","z":"f1de55df.5e2f88","command":" sh ","addpay":true,"append":"","useSpawn":"","timer":"","name":"Execute the shell script","x":690,"y":340,"wires":[["b4a9ec57.96bc4"],[],[]]},{"id":"fbb9e1ff.5101d8","type":"exec","z":"f1de55df.5e2f88","command":"chmod +x ","addpay":true,"append":"","useSpawn":"","timer":"","name":"","x":1040,"y":200,"wires":[["2e95caad.66f9fe"],[],[]]},{"id":"285cddd0.d7e24a","type":"change","z":"f1de55df.5e2f88","name":"","rules":[{"t":"set","p":"command","pt":"msg","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":230,"y":200,"wires":[["d0bfe6c1.044a5"]]},{"id":"30114b40.606d84","type":"change","z":"f1de55df.5e2f88","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"filename","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":860,"y":200,"wires":[["fbb9e1ff.5101d8"]]},{"id":"fe9bd6b2.929e7","type":"function","z":"f1de55df.5e2f88","name":"","func":"msg.filename = msg.payload.trim();\nmsg.payload = msg.command;\nreturn msg;","outputs":1,"noerr":0,"x":590,"y":180,"wires":[["76a063c9.c6b974","30114b40.606d84"]]},{"id":"2e95caad.66f9fe","type":"change","z":"f1de55df.5e2f88","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"filename","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":480,"y":340,"wires":[["62b058c.3afd0a8"]]},{"id":"6f02b2cb.adf59c","type":"comment","z":"f1de55df.5e2f88","name":"Execute shell script","info":"Execute the shell script in msg.payload.","x":130,"y":40,"wires":[]},{"id":"e68d6df8.c75408","type":"template","z":"78f754c0.6bb294","name":"Shell Script - Shutdown","field":"payload","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"#! /bin/sh\n\nsudo shutdown -P -t now","x":1440,"y":960,"wires":[["39d21222.451d46"]]},{"id":"efd3cd74.1a9ab","type":"inject","z":"78f754c0.6bb294","name":"shutdown","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"onceDelay":"","x":900,"y":980,"wires":[["e68d6df8.c75408"]]},{"id":"39d21222.451d46","type":"subflow:f1de55df.5e2f88","z":"78f754c0.6bb294","name":"","x":1740,"y":840,"wires":[["4fcbfac2.b8e34c"],["4fcbfac2.b8e34c"],["4fcbfac2.b8e34c"]]},{"id":"24945160.9d03f6","type":"switch","z":"78f754c0.6bb294","name":"","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"on","vt":"str"},{"t":"eq","v":"off","vt":"str"}],"checkall":"true","repair":false,"outputs":2,"x":890,"y":940,"wires":[["74d57823.7a59"],["e68d6df8.c75408"]]},{"id":"4fcbfac2.b8e34c","type":"debug","z":"78f754c0.6bb294","name":"Log the result","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","x":2000,"y":840,"wires":[]},{"id":"74d57823.7a59","type":"template","z":"78f754c0.6bb294","name":"Shell Script - Reboot","field":"payload","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"#! /bin/sh\n\nsudo reboot","x":1440,"y":920,"wires":[["39d21222.451d46"]]},{"id":"6a16ed7b.86fc24","type":"template","z":"78f754c0.6bb294","name":"Shell Script - stop nodered and bluetooth 20","field":"payload","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"#! /bin/sh\n\nsudo /etc/init.d/bluetooth stop\n\n\nsudo systemctl stop nodered.service","x":1440,"y":860,"wires":[["39d21222.451d46"]]},{"id":"c88f4bd5.0a1d48","type":"template","z":"78f754c0.6bb294","name":"Shell Script - stop nodered 50","field":"payload","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"#! /bin/sh\n\nsudo systemctl stop nodered.service","x":1440,"y":820,"wires":[["39d21222.451d46"]]},{"id":"3285d6ec.a54692","type":"template","z":"78f754c0.6bb294","name":"Shell Script - start/restart nodered, apache, haBridge, and mosquitto","field":"payload","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"#! /bin/sh\n\nsudo /etc/init.d/bluetooth restart\nsudo systemctl restart nodered.service\nsudo systemctl restart apache2.service\nsudo systemctl restart habridge.service\nsudo systemctl restart mosquitto.service ","x":1440,"y":620,"wires":[["39d21222.451d46"]]},{"id":"922ea103.0c5a7","type":"template","z":"78f754c0.6bb294","name":"Shell Script - start/restart bluetooth 90","field":"payload","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"#! /bin/sh\n\nsudo /etc/init.d/bluetooth restart","x":1440,"y":680,"wires":[["39d21222.451d46"]]},{"id":"a0e0ded9.b93518","type":"switch","z":"78f754c0.6bb294","name":"on/off command?","property":"on_off_command","propertyType":"msg","rules":[{"t":"false"},{"t":"true"}],"checkall":"true","repair":false,"outputs":2,"x":630,"y":820,"wires":[["1947632c.f98d0d"],["24945160.9d03f6"]]},{"id":"ae1452f8.93a9e","type":"inject","z":"78f754c0.6bb294","name":"reboot","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"onceDelay":"","x":890,"y":900,"wires":[["74d57823.7a59"]]},{"id":"1947632c.f98d0d","type":"switch","z":"78f754c0.6bb294","name":"brightness","property":"bri","propertyType":"msg","rules":[{"t":"eq","v":"100","vt":"num"},{"t":"eq","v":"95","vt":"num"},{"t":"eq","v":"90","vt":"num"},{"t":"eq","v":"60","vt":"num"},{"t":"eq","v":"50","vt":"num"},{"t":"eq","v":"20","vt":"num"}],"checkall":"true","repair":false,"outputs":6,"x":870,"y":680,"wires":[["3285d6ec.a54692"],[],["922ea103.0c5a7"],["d1d03178.5878a8"],["c88f4bd5.0a1d48"],["6a16ed7b.86fc24"]]},{"id":"c63e9116.4b04c","type":"inject","z":"78f754c0.6bb294","name":"reboot bluetooth","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"onceDelay":"","x":1250,"y":656,"wires":[["922ea103.0c5a7"]]},{"id":"be23db22.ba5a7","type":"alexa-local","z":"78f754c0.6bb294","devicename":"raspberry pie","inputtrigger":false,"x":440,"y":820,"wires":[["a0e0ded9.b93518"]]},{"id":"d1d03178.5878a8","type":"template","z":"78f754c0.6bb294","name":"Shell Script - start/restart nodered 50","field":"payload","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"#! /bin/sh\n\nsudo systemctl restart nodered.service","x":1440,"y":780,"wires":[[]]},{"id":"7dd7e08d.f7e3e8","type":"inject","z":"78f754c0.6bb294","name":"reboot NR","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"onceDelay":"","x":1240,"y":720,"wires":[["d1d03178.5878a8"]]}]
  3. techlemur created this gist Jul 24, 2018.
    1 change: 1 addition & 0 deletions alexapicontrol.txt
    Original file line number Diff line number Diff line change
    @@ -0,0 +1 @@
    [{"id":"f1de55df.5e2f88","type":"subflow","name":"Execute Shell Script","info":"","in":[{"x":100,"y":200,"wires":[{"id":"285cddd0.d7e24a"}]}],"out":[{"x":960,"y":280,"wires":[{"id":"62b058c.3afd0a8","port":0}]},{"x":960,"y":340,"wires":[{"id":"62b058c.3afd0a8","port":1}]},{"x":960,"y":400,"wires":[{"id":"62b058c.3afd0a8","port":2}]}]},{"id":"76a063c9.c6b974","type":"file","z":"f1de55df.5e2f88","name":"Write script file","filename":"","appendNewline":true,"createDir":false,"overwriteFile":"false","x":860,"y":140,"wires":[]},{"id":"d0bfe6c1.044a5","type":"exec","z":"f1de55df.5e2f88","command":"mktemp","addpay":false,"append":"","useSpawn":"","timer":"","name":"","x":420,"y":200,"wires":[["fe9bd6b2.929e7"],[],[]]},{"id":"b4a9ec57.96bc4","type":"file","z":"f1de55df.5e2f88","name":"Delete script file","filename":"","appendNewline":true,"createDir":false,"overwriteFile":"delete","x":1020,"y":480,"wires":[]},{"id":"62b058c.3afd0a8","type":"exec","z":"f1de55df.5e2f88","command":" sh ","addpay":true,"append":"","useSpawn":"","timer":"","name":"Execute the shell script","x":690,"y":340,"wires":[["b4a9ec57.96bc4"],[],[]]},{"id":"fbb9e1ff.5101d8","type":"exec","z":"f1de55df.5e2f88","command":"chmod +x ","addpay":true,"append":"","useSpawn":"","timer":"","name":"","x":1040,"y":200,"wires":[["2e95caad.66f9fe"],[],[]]},{"id":"285cddd0.d7e24a","type":"change","z":"f1de55df.5e2f88","name":"","rules":[{"t":"set","p":"command","pt":"msg","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":230,"y":200,"wires":[["d0bfe6c1.044a5"]]},{"id":"30114b40.606d84","type":"change","z":"f1de55df.5e2f88","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"filename","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":860,"y":200,"wires":[["fbb9e1ff.5101d8"]]},{"id":"fe9bd6b2.929e7","type":"function","z":"f1de55df.5e2f88","name":"","func":"msg.filename = msg.payload.trim();\nmsg.payload = msg.command;\nreturn msg;","outputs":1,"noerr":0,"x":590,"y":180,"wires":[["76a063c9.c6b974","30114b40.606d84"]]},{"id":"2e95caad.66f9fe","type":"change","z":"f1de55df.5e2f88","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"filename","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":480,"y":340,"wires":[["62b058c.3afd0a8"]]},{"id":"6f02b2cb.adf59c","type":"comment","z":"f1de55df.5e2f88","name":"Execute shell script","info":"Execute the shell script in msg.payload.","x":130,"y":40,"wires":[]},{"id":"e68d6df8.c75408","type":"template","z":"78f754c0.6bb294","name":"Shell Script - Shutdown","field":"payload","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"#! /bin/sh\n\nsudo shutdown -P -t now","x":1440,"y":960,"wires":[["39d21222.451d46"]]},{"id":"efd3cd74.1a9ab","type":"inject","z":"78f754c0.6bb294","name":"shutdown","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"onceDelay":"","x":900,"y":980,"wires":[["e68d6df8.c75408"]]},{"id":"39d21222.451d46","type":"subflow:f1de55df.5e2f88","z":"78f754c0.6bb294","name":"","x":1740,"y":840,"wires":[["4fcbfac2.b8e34c"],["4fcbfac2.b8e34c"],["4fcbfac2.b8e34c"]]},{"id":"24945160.9d03f6","type":"switch","z":"78f754c0.6bb294","name":"","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"on","vt":"str"},{"t":"eq","v":"off","vt":"str"}],"checkall":"true","repair":false,"outputs":2,"x":890,"y":940,"wires":[["74d57823.7a59"],["e68d6df8.c75408"]]},{"id":"4fcbfac2.b8e34c","type":"debug","z":"78f754c0.6bb294","name":"Log the result","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","x":2000,"y":840,"wires":[]},{"id":"74d57823.7a59","type":"template","z":"78f754c0.6bb294","name":"Shell Script - Reboot","field":"payload","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"#! /bin/sh\n\nsudo reboot","x":1440,"y":920,"wires":[["39d21222.451d46"]]},{"id":"6a16ed7b.86fc24","type":"template","z":"78f754c0.6bb294","name":"Shell Script - stop nodered and bluetooth 20","field":"payload","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"#! /bin/sh\n\nsudo /etc/init.d/bluetooth stop\n\n\nsudo systemctl stop nodered.service","x":1440,"y":860,"wires":[["39d21222.451d46"]]},{"id":"c88f4bd5.0a1d48","type":"template","z":"78f754c0.6bb294","name":"Shell Script - stop nodered 50","field":"payload","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"#! /bin/sh\n\nsudo systemctl stop nodered.service","x":1440,"y":820,"wires":[["39d21222.451d46"]]},{"id":"3285d6ec.a54692","type":"template","z":"78f754c0.6bb294","name":"Shell Script - start/restart nodered, apache, haBridge, and mosquitto","field":"payload","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"#! /bin/sh\n\nsudo /etc/init.d/bluetooth restart\nsudo systemctl restart nodered.service\nsudo systemctl restart apache2.service\nsudo systemctl restart habridge.service\nsudo systemctl restart mosquitto.service ","x":1440,"y":620,"wires":[["39d21222.451d46"]]},{"id":"922ea103.0c5a7","type":"template","z":"78f754c0.6bb294","name":"Shell Script - start/restart bluetooth 90","field":"payload","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"#! /bin/sh\n\nsudo /etc/init.d/bluetooth restart","x":1440,"y":680,"wires":[["39d21222.451d46"]]},{"id":"a0e0ded9.b93518","type":"switch","z":"78f754c0.6bb294","name":"on/off command?","property":"on_off_command","propertyType":"msg","rules":[{"t":"false"},{"t":"true"}],"checkall":"true","repair":false,"outputs":2,"x":630,"y":820,"wires":[["1947632c.f98d0d"],["24945160.9d03f6"]]},{"id":"ae1452f8.93a9e","type":"inject","z":"78f754c0.6bb294","name":"reboot","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"onceDelay":"","x":890,"y":900,"wires":[["74d57823.7a59"]]},{"id":"1947632c.f98d0d","type":"switch","z":"78f754c0.6bb294","name":"brightness","property":"bri","propertyType":"msg","rules":[{"t":"eq","v":"100","vt":"num"},{"t":"eq","v":"95","vt":"num"},{"t":"eq","v":"90","vt":"num"},{"t":"eq","v":"60","vt":"num"},{"t":"eq","v":"50","vt":"num"},{"t":"eq","v":"20","vt":"num"}],"checkall":"true","repair":false,"outputs":6,"x":870,"y":680,"wires":[["3285d6ec.a54692"],[],["922ea103.0c5a7"],["d1d03178.5878a8"],["c88f4bd5.0a1d48"],["6a16ed7b.86fc24"]]},{"id":"c63e9116.4b04c","type":"inject","z":"78f754c0.6bb294","name":"reboot bluetooth","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"onceDelay":"","x":1250,"y":656,"wires":[["922ea103.0c5a7"]]},{"id":"be23db22.ba5a7","type":"alexa-local","z":"78f754c0.6bb294","devicename":"raspberry pie","inputtrigger":false,"x":440,"y":820,"wires":[["a0e0ded9.b93518"]]},{"id":"d1d03178.5878a8","type":"template","z":"78f754c0.6bb294","name":"Shell Script - start/restart nodered 50","field":"payload","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"#! /bin/sh\n\nsudo systemctl restart nodered.service","x":1440,"y":780,"wires":[[]]},{"id":"7dd7e08d.f7e3e8","type":"inject","z":"78f754c0.6bb294","name":"reboot NR","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"onceDelay":"","x":1240,"y":720,"wires":[["d1d03178.5878a8"]]}]