Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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: 12 days 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 (7 months ago)
- Default Branch: main
- Last Pushed: 2024-06-25T22:06:43.000Z (7 months ago)
- Last Synced: 2024-11-14T14:43:30.372Z (2 months 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.
![IMG_3286](https://github.com/Diegogtz03/PCPower/assets/65473367/64266f9c-e7c4-4cd4-b1c2-872af546fdf7)
![IMG_3287](https://github.com/Diegogtz03/PCPower/assets/65473367/ee42f3db-1e70-4d58-9713-08b12f528342)