Skip to content

Instantly share code, notes, and snippets.

@Luismcplopes
Last active March 21, 2019 22:21
Show Gist options
  • Save Luismcplopes/dcd16fd82d1f2127d8d99d8b71f00987 to your computer and use it in GitHub Desktop.
Save Luismcplopes/dcd16fd82d1f2127d8d99d8b71f00987 to your computer and use it in GitHub Desktop.

Requirement: node-red-dashboard. Obviously you will need a Raspberry Pi too!

This is a simple but very useful Actions buttons to control a Raspberry Pi it includes so far:

  • Actions: Shutdown and Reboot buttons restart some services
[
{
"id": "4346e6bc.d22448",
"type": "tab",
"label": "Flow 2",
"disabled": false,
"info": ""
},
{
"id": "426cca9c.ea9b84",
"type": "ui_button",
"z": "4346e6bc.d22448",
"name": "",
"group": "7b069885.51def8",
"order": 2,
"width": 0,
"height": 0,
"passthru": false,
"label": "Restart Transmission",
"tooltip": "",
"color": "",
"bgcolor": "",
"icon": "",
"payload": "",
"payloadType": "str",
"topic": "",
"x": 200,
"y": 100,
"wires": [
[
"baaea481.e74158"
]
]
},
{
"id": "baaea481.e74158",
"type": "exec",
"z": "4346e6bc.d22448",
"command": "sudo service transmission restart",
"addpay": false,
"append": "",
"useSpawn": "",
"timer": "",
"oldrc": false,
"name": "transmission restart",
"x": 602,
"y": 100,
"wires": [
[],
[],
[]
]
},
{
"id": "30ad1cd9.3f8314",
"type": "ui_button",
"z": "4346e6bc.d22448",
"name": "",
"group": "7b069885.51def8",
"order": 2,
"width": 0,
"height": 0,
"passthru": false,
"label": "Reboot RPI",
"tooltip": "",
"color": "",
"bgcolor": "",
"icon": "",
"payload": "",
"payloadType": "str",
"topic": "",
"x": 190,
"y": 580,
"wires": [
[
"d3cc2be8.9e674"
]
]
},
{
"id": "d3cc2be8.9e674",
"type": "exec",
"z": "4346e6bc.d22448",
"command": "sudo reboot",
"addpay": false,
"append": "",
"useSpawn": "",
"timer": "",
"oldrc": false,
"name": "Reboot",
"x": 582,
"y": 580,
"wires": [
[],
[],
[]
]
},
{
"id": "bf9676f.a599088",
"type": "ui_button",
"z": "4346e6bc.d22448",
"name": "",
"group": "7b069885.51def8",
"order": 3,
"width": 0,
"height": 0,
"label": "Shutdown",
"color": "",
"bgcolor": "red",
"icon": "",
"payload": "",
"payloadType": "str",
"topic": "",
"x": 180,
"y": 640,
"wires": [
[
"3c673523.496bea"
]
]
},
{
"id": "3c673523.496bea",
"type": "exec",
"z": "4346e6bc.d22448",
"command": "sudo shutdown -h now",
"addpay": false,
"append": "",
"useSpawn": "",
"timer": "",
"name": "Shutdown",
"x": 582,
"y": 640,
"wires": [
[],
[],
[]
]
},
{
"id": "ead7789e.06bb88",
"type": "ui_button",
"z": "4346e6bc.d22448",
"name": "",
"group": "7b069885.51def8",
"order": 2,
"width": 0,
"height": 0,
"passthru": false,
"label": "Restart Couchpotato",
"tooltip": "",
"color": "",
"bgcolor": "",
"icon": "",
"payload": "",
"payloadType": "str",
"topic": "",
"x": 200,
"y": 160,
"wires": [
[
"15f3dead.4ec939"
]
]
},
{
"id": "15f3dead.4ec939",
"type": "exec",
"z": "4346e6bc.d22448",
"command": "sudo service couchpotato restart",
"addpay": false,
"append": "",
"useSpawn": "",
"timer": "",
"oldrc": false,
"name": "couchpotato restart",
"x": 592,
"y": 160,
"wires": [
[],
[],
[]
]
},
{
"id": "1b1535b2.443c9a",
"type": "ui_button",
"z": "4346e6bc.d22448",
"name": "",
"group": "7b069885.51def8",
"order": 2,
"width": 0,
"height": 0,
"passthru": false,
"label": "Restart Sickrage",
"tooltip": "",
"color": "",
"bgcolor": "",
"icon": "",
"payload": "",
"payloadType": "str",
"topic": "",
"x": 190,
"y": 220,
"wires": [
[
"dbe6c3bf.21e13"
]
]
},
{
"id": "dbe6c3bf.21e13",
"type": "exec",
"z": "4346e6bc.d22448",
"command": "sudo service sickrage restart",
"addpay": false,
"append": "",
"useSpawn": "",
"timer": "",
"oldrc": false,
"name": "sickrage restart",
"x": 582,
"y": 220,
"wires": [
[],
[],
[]
]
},
{
"id": "26d81ef3.a25252",
"type": "ui_button",
"z": "4346e6bc.d22448",
"name": "",
"group": "7b069885.51def8",
"order": 2,
"width": 0,
"height": 0,
"passthru": false,
"label": "Restart Sickchill",
"tooltip": "",
"color": "",
"bgcolor": "",
"icon": "",
"payload": "",
"payloadType": "str",
"topic": "",
"x": 180,
"y": 280,
"wires": [
[
"42bb9a75.ee533c"
]
]
},
{
"id": "42bb9a75.ee533c",
"type": "exec",
"z": "4346e6bc.d22448",
"command": "sudo service sickchill restart",
"addpay": false,
"append": "",
"useSpawn": "",
"timer": "",
"oldrc": false,
"name": "sickchill restart",
"x": 582,
"y": 280,
"wires": [
[],
[],
[]
]
},
{
"id": "1b74b8b9.3c425f",
"type": "ui_button",
"z": "4346e6bc.d22448",
"name": "",
"group": "7b069885.51def8",
"order": 2,
"width": 0,
"height": 0,
"passthru": false,
"label": "Restart Jackett",
"tooltip": "",
"color": "",
"bgcolor": "",
"icon": "",
"payload": "",
"payloadType": "str",
"topic": "",
"x": 180,
"y": 340,
"wires": [
[
"cc24c127.de9698"
]
]
},
{
"id": "cc24c127.de9698",
"type": "exec",
"z": "4346e6bc.d22448",
"command": "sudo service Jackett restart",
"addpay": false,
"append": "",
"useSpawn": "",
"timer": "",
"oldrc": false,
"name": "Jackett restart",
"x": 582,
"y": 340,
"wires": [
[],
[],
[]
]
},
{
"id": "e8691980.93c8c8",
"type": "ui_button",
"z": "4346e6bc.d22448",
"name": "",
"group": "7b069885.51def8",
"order": 2,
"width": 0,
"height": 0,
"passthru": false,
"label": "Restart Rpimonitor",
"tooltip": "",
"color": "",
"bgcolor": "",
"icon": "",
"payload": "",
"payloadType": "str",
"topic": "",
"x": 190,
"y": 400,
"wires": [
[
"c0ecf354.e9224"
]
]
},
{
"id": "c0ecf354.e9224",
"type": "exec",
"z": "4346e6bc.d22448",
"command": "sudo service rpimonitor restart",
"addpay": false,
"append": "",
"useSpawn": "",
"timer": "",
"oldrc": false,
"name": "rpimonitor restart",
"x": 592,
"y": 400,
"wires": [
[],
[],
[]
]
},
{
"id": "48538f06.850a78",
"type": "ui_button",
"z": "4346e6bc.d22448",
"name": "",
"group": "7b069885.51def8",
"order": 2,
"width": 0,
"height": 0,
"passthru": false,
"label": "Restart VPN",
"tooltip": "",
"color": "",
"bgcolor": "",
"icon": "",
"payload": "",
"payloadType": "str",
"topic": "",
"x": 170,
"y": 460,
"wires": [
[
"958d0ec6.110f7"
]
]
},
{
"id": "958d0ec6.110f7",
"type": "exec",
"z": "4346e6bc.d22448",
"command": "sudo service rpimonitor restart",
"addpay": false,
"append": "",
"useSpawn": "",
"timer": "",
"oldrc": false,
"name": "rpimonitor restart",
"x": 612,
"y": 460,
"wires": [
[],
[],
[]
]
},
{
"id": "7b069885.51def8",
"type": "ui_group",
"z": "",
"name": "Actions",
"tab": "e9c474f4.757608",
"order": 4,
"disp": true,
"width": "6"
},
{
"id": "e9c474f4.757608",
"type": "ui_tab",
"z": "",
"name": "RPi Control",
"icon": "dashboard",
"order": 1
}
]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment