Turn PC on with a button or the dashboard

This is my flow for turning my pc on remotely with either a button or the dash board. My Raspberry Pi Zero 2 is connected to the Dell Precision T3610's front panel pcb with some wires I soldered to it. It can easily be connected to a standard desktop as well. Just needs a ground and the power button and led wires from the pc. My dell is a little special in that I needed two wires from the led. The bicolor led changes color based on polarity, not a common ground. I simply wired the optiosolator in a way I get a HIGH signal from the power on status and not the amber "time to troubleshoot" led.

I use two optiosolators, one for the pc power button and one for the power led. The led is just for a status indicator.

The flow requires both node-red-dashboard and node-red-node-pi-gpio nodes to function.

[{"id":"d8ad760533e3c59b","type":"tab","label":"PC Power Controls","disabled":false,"info":"","env":[]},{"id":"fe5f8b43c9252d48","type":"rpi-gpio out","z":"d8ad760533e3c59b","name":"Yellow LED","pin":"25","set":true,"level":"0","freq":"","out":"out","bcm":true,"x":910,"y":400,"wires":[]},{"id":"380a2a73240ee960","type":"rpi-gpio in","z":"d8ad760533e3c59b","name":"Push Button","pin":"23","intype":"down","debounce":"50","read":false,"bcm":true,"x":190,"y":320,"wires":[["93c7008575a09784"]]},{"id":"e38317a7287e3fd0","type":"rpi-gpio out","z":"d8ad760533e3c59b","name":"OptoIsolator","pin":"16","set":true,"level":"0","freq":"","out":"out","bcm":true,"x":910,"y":460,"wires":[]},{"id":"c05b651b57613192","type":"ui_button","z":"d8ad760533e3c59b","name":"","group":"83c4af7d5ba3dc8b","order":0,"width":"5","height":"1","passthru":true,"label":"Toggle Power","tooltip":"","color":"","bgcolor":"","className":"button","icon":"","payload":"1","payloadType":"num","topic":"topic","topicType":"msg","x":200,"y":400,"wires":[["64c61b17bae5c935","ed16ac680c32f3f0"]]},{"id":"c42963c29b43cbbe","type":"trigger","z":"d8ad760533e3c59b","name":"","op1":"1","op2":"0","op1type":"str","op2type":"str","duration":"2","extend":false,"overrideDelay":false,"units":"s","reset":"","bytopic":"all","topic":"topic","outputs":1,"x":540,"y":400,"wires":[["fe5f8b43c9252d48","e38317a7287e3fd0","f672c05bed8d21ea"]]},{"id":"9d2ed0a433f7e277","type":"ui_text","z":"d8ad760533e3c59b","group":"83c4af7d5ba3dc8b","order":1,"width":0,"height":0,"name":"","label":"Power","format":"{{msg.payload}}","layout":"row-center","className":"","x":570,"y":200,"wires":[],"inputLabels":["On"]},{"id":"807180063ac171ef","type":"ui_button","z":"d8ad760533e3c59b","name":"","group":"83c4af7d5ba3dc8b","order":0,"width":"5","height":"1","passthru":true,"label":"Emergency Power OFF","tooltip":"","color":"","bgcolor":"","className":"button","icon":"","payload":"1","payloadType":"num","topic":"topic","topicType":"msg","x":170,"y":460,"wires":[["12e96b61b49bc89a"]]},{"id":"c40cb6826d31db26","type":"trigger","z":"d8ad760533e3c59b","name":"","op1":"1","op2":"0","op1type":"str","op2type":"str","duration":"5","extend":false,"overrideDelay":false,"units":"s","reset":"","bytopic":"all","topic":"topic","outputs":1,"x":560,"y":460,"wires":[["fe5f8b43c9252d48","e38317a7287e3fd0"]]},{"id":"93c7008575a09784","type":"trigger","z":"d8ad760533e3c59b","name":"","op1":"1","op2":"0","op1type":"str","op2type":"str","duration":"5","extend":false,"overrideDelay":false,"units":"s","reset":"","bytopic":"all","topic":"topic","outputs":2,"x":340,"y":320,"wires":[["c05b651b57613192"],[]]},{"id":"64c61b17bae5c935","type":"trigger","z":"d8ad760533e3c59b","name":"","op1":"1","op2":"0","op1type":"str","op2type":"str","duration":"5","extend":false,"overrideDelay":false,"units":"s","reset":"","bytopic":"all","topic":"topic","outputs":2,"x":380,"y":400,"wires":[["c42963c29b43cbbe"],[]]},{"id":"062b6033d278c5b2","type":"ui_toast","z":"d8ad760533e3c59b","position":"top right","displayTime":"3","highlight":"","sendall":true,"outputs":0,"ok":"OK","cancel":"","raw":false,"className":"","topic":"PC has been turned on.","name":"PC has been turned on.","x":970,"y":580,"wires":[]},{"id":"ed16ac680c32f3f0","type":"template","z":"d8ad760533e3c59b","name":"","field":"payload","fieldType":"msg","format":"handlebars","syntax":"plain","template":"Success!","output":"str","x":720,"y":580,"wires":[["062b6033d278c5b2"]]},{"id":"f875db4bde090b2a","type":"ui_toast","z":"d8ad760533e3c59b","position":"top right","displayTime":"5","highlight":"","sendall":true,"outputs":0,"ok":"OK","cancel":"","raw":false,"className":"","topic":"PC has powered off.","name":"PC has powered off.","x":960,"y":620,"wires":[]},{"id":"7b4329a23caf10ec","type":"template","z":"d8ad760533e3c59b","name":"","field":"payload","fieldType":"msg","format":"handlebars","syntax":"plain","template":"Success!","output":"str","x":720,"y":620,"wires":[["f875db4bde090b2a"]]},{"id":"12e96b61b49bc89a","type":"trigger","z":"d8ad760533e3c59b","name":"","op1":"1","op2":"0","op1type":"str","op2type":"str","duration":"250","extend":false,"overrideDelay":false,"units":"ms","reset":"","bytopic":"all","topic":"topic","outputs":2,"x":380,"y":460,"wires":[["c40cb6826d31db26","7b4329a23caf10ec"],["c40cb6826d31db26"]]},{"id":"59d065d1285d12bf","type":"rpi-gpio in","z":"d8ad760533e3c59b","name":"PWR LED Status","pin":"19","intype":"down","debounce":"25","read":true,"bcm":true,"x":210,"y":200,"wires":[["1aaeeb1d397186ca"]]},{"id":"1aaeeb1d397186ca","type":"change","z":"d8ad760533e3c59b","name":"","rules":[{"t":"change","p":"payload","pt":"msg","from":"0","fromt":"num","to":"OFF","tot":"str"},{"t":"change","p":"payload","pt":"msg","from":"1","fromt":"num","to":"ON","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":400,"y":200,"wires":[["9d2ed0a433f7e277"]]},{"id":"f672c05bed8d21ea","type":"rpi-gpio out","z":"d8ad760533e3c59b","name":"Green LED","pin":"20","set":true,"level":"0","freq":"","out":"out","bcm":true,"x":910,"y":340,"wires":[]},{"id":"83c4af7d5ba3dc8b","type":"ui_group","name":"PC Power Controls","tab":"da8c6e140421e03f","order":1,"disp":true,"width":"6","collapse":false,"className":""},{"id":"da8c6e140421e03f","type":"ui_tab","name":"Home","icon":"dashboard","disabled":false,"hidden":false}]

Flow Info

Created 2 years, 5 months ago
Rating: not yet rated

Owner

Actions

Rate:

Node Types

Core
  • change (x1)
  • template (x2)
  • trigger (x5)
Other

Tags

  • raspberrypi
  • gpio
  • PC
Copy this flow JSON to your clipboard and then import into Node-RED using the Import From > Clipboard (Ctrl-I) menu option