https://github.com/diegogtz03/pcpower
API and WebSocket server for remote ESP32 powered PC power monitor and switch
https://github.com/diegogtz03/pcpower
api nodejs websocket
Last synced: about 2 months ago
JSON representation
API and WebSocket server for remote ESP32 powered PC power monitor and switch
- Host: GitHub
- URL: https://github.com/diegogtz03/pcpower
- Owner: Diegogtz03
- Created: 2024-06-18T01:30:41.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2024-06-25T22:06:43.000Z (almost 2 years ago)
- Last Synced: 2025-06-17T16:45:08.209Z (about 1 year ago)
- Topics: api, nodejs, websocket
- Language: TypeScript
- Homepage:
- Size: 9.77 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# **PCPower**
A websocket server and API that allows you to control and check your PC power state from a simple API or a web interface anywhere in the world.
Made together with [ESP-PC](https://github.com/Diegogtz03/ESP-PC).
-----
## Websocket Server
- Opens up the port 3100 for WS/WSS access
- Allows for the API to communicate with the ESP32 via POST requests
## API
### /status (GET)
- Return "Arduino not connected" if the ESP is offline
- Returns either "ON" or "OFF" depending on the value of the PC's LED
### /on (POST)
- Needs authorization header defined by the .env variable AUTHORIZATION_HEADER
- Return "Arduino not connected" if the ESP is offline
- Sends message to ESP requesting the PC to turn ON
### /off (POST)
- Needs authorization header defined by the .env variable AUTHORIZATION_HEADER
- Return "Arduino not connected" if the ESP is offline
- Sends message to ESP requesting the PC to turn OFF
-----
## Triggers / Deployments
### HTTPS deployment
- I've provided some docker files for easy deployment on a remote server.
- This would allow for secure connections and for remote connections anywhere in the world.
### A simple request
- You could use simple post requests for triggering the ESP
### Custom UI
- You could make a simple custom UI to see the PC's status/trigger the PC's state
### iOS Shortcuts
- I have a simple example of how I integrated this with Apple's Shortcuts for quick and easy use on all of my iOS devices remotely.

