Compare commits
No commits in common. "main" and "dev" have entirely different histories.
|
|
@ -1,15 +0,0 @@
|
||||||
name: Build Binary
|
|
||||||
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches:
|
|
||||||
- main
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
deploy:
|
|
||||||
runs-on: ubuntu-22.04
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v4
|
|
||||||
- uses: esphome/build-action@v1.8.0
|
|
||||||
with:
|
|
||||||
yaml_file: pc-switch.yaml
|
|
||||||
|
|
@ -1,5 +0,0 @@
|
||||||
docs/public
|
|
||||||
docs/resources/
|
|
||||||
docs/node_modules/
|
|
||||||
docs/package-lock.json
|
|
||||||
docs/.hugo_build.lock
|
|
||||||
21
LICENSE.md
21
LICENSE.md
|
|
@ -1,21 +0,0 @@
|
||||||
MIT License
|
|
||||||
|
|
||||||
Copyright (c) 2022 Andrej Friesen
|
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
||||||
of this software and associated documentation files (the "Software"), to deal
|
|
||||||
in the Software without restriction, including without limitation the rights
|
|
||||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
||||||
copies of the Software, and to permit persons to whom the Software is
|
|
||||||
furnished to do so, subject to the following conditions:
|
|
||||||
|
|
||||||
The above copyright notice and this permission notice shall be included in all
|
|
||||||
copies or substantial portions of the Software.
|
|
||||||
|
|
||||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
||||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
||||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
||||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
||||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
||||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
||||||
SOFTWARE.
|
|
||||||
42
README.md
42
README.md
|
|
@ -1,29 +1,49 @@
|
||||||
# pc-switch
|
# pc-switch
|
||||||
|
|
||||||
Remote shutdown and start you PC/server with Home Assistant.
|
[](https://ko-fi.com/ajfriesen)
|
||||||
|
|
||||||
Powered by ESPHome.
|
ESPHome powered switch to turn on/off your PC.
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
Just connect your power, reset and power led front panel connector to appropriate pin pairs, power the ESP8266 and you can turn on and off your PC via Home Assistant.
|
|
||||||
|
|
||||||
|
Just connect your power, reset and power led front panel connector to appropieate pin pairs, power the ESP8266 and you can turn on and off your PC via Home Assistant.
|
||||||
## Use cases
|
## Use cases
|
||||||
|
|
||||||
- Hide your PC in a closet or on a shelf without the need to press the actual button. You can just connect any other button via home assistant
|
- Hide your PC in a closet or on a shelf without the need to press the actual button. You can just connect any other button via home assistant
|
||||||
- Setup automation based on time, motion or the moon phase, or whatever you like to power on your PC
|
- Setup automation based on time, motion or the moon phase to power on your PC
|
||||||
- No funky magic packets anymore with flaky wake on LAN (never worked for me)
|
- No funky magic packets anymore with wake on LAN (never worked for me)
|
||||||
- No addons with admin access (password) to your Windows PC
|
- No addons with admin access (password) to your Windows PC
|
||||||
- Add voice commands via Home Assistant to Google Assistant
|
- Add voice commands via Home Assistant to Google Assistant
|
||||||
|
|
||||||

|
## Powersource
|
||||||
|
|
||||||
|
### Internal USB port
|
||||||
|
Most motherboard can deliver power over USB when the PC is off.
|
||||||
|
Needs to be configure in the BIOS.
|
||||||
|
|
||||||
|
### TPM header
|
||||||
|
|
||||||
|
Check your motherboard manual for a TPM header.
|
||||||
|
Also check how much voltage the TPM header can supply.
|
||||||
|
Then you can connect power and groud from the TPM header to the ESP8266
|
||||||
|
|
||||||

|
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
# Project Documentation
|
## Parts
|
||||||
|
|
||||||
You can find all product documentation, related blog post on my dedicated [pc-switch website](https://www.ajfriesen.com/pc-switch/).
|
- Optocoupler: EL817
|
||||||
|
- Resistor:
|
||||||
|
- ESP8266-12F from AZDelivery
|
||||||
|
|
||||||
|
## Todo
|
||||||
|
|
||||||
|
- [x] powering the ESP8266
|
||||||
|
- [x] Power, reset and hard power off switch for PC in Home Assistant
|
||||||
|
- [x] Protoype on breadboard
|
||||||
|
- [x] Create first soldered protoype
|
||||||
|
- [x] Check for PC status
|
||||||
|
- [ ] Design PCB
|
||||||
|
- [ ] upload PCB
|
||||||
|
- [ ] Create 3D printed case
|
||||||
|
- [ ] Maybe enable MQTT to control this device (without home assistant)
|
||||||
Binary file not shown.
|
Before Width: | Height: | Size: 211 KiB After Width: | Height: | Size: 3.9 MiB |
Binary file not shown.
|
Before Width: | Height: | Size: 137 KiB |
BIN
images/v1.0.jpg
BIN
images/v1.0.jpg
Binary file not shown.
|
Before Width: | Height: | Size: 629 KiB |
|
|
@ -1,28 +1,17 @@
|
||||||
substitutions:
|
|
||||||
name: "pc"
|
|
||||||
uppercase_name: "PC"
|
|
||||||
|
|
||||||
|
|
||||||
esphome:
|
esphome:
|
||||||
name: "${name}"
|
name: pc-switch
|
||||||
platform: ESP8266
|
platform: ESP8266
|
||||||
board: nodemcuv2
|
board: nodemcuv2
|
||||||
|
|
||||||
project:
|
|
||||||
name: "ajfriesen.pc-switch"
|
|
||||||
version: "1.0.1"
|
|
||||||
|
|
||||||
# Enable logging
|
# Enable logging
|
||||||
logger:
|
logger:
|
||||||
|
|
||||||
# Enable Home Assistant API
|
# Enable Home Assistant API
|
||||||
api:
|
api:
|
||||||
|
|
||||||
dashboard_import:
|
|
||||||
package_import_url: github://ajfriesen/pc-switch/pc-switch.yaml@main
|
|
||||||
|
|
||||||
# Put ota password here
|
# Put ota password here
|
||||||
ota:
|
ota:
|
||||||
|
password: ""
|
||||||
|
|
||||||
# Your wifi config
|
# Your wifi config
|
||||||
wifi:
|
wifi:
|
||||||
|
|
@ -36,63 +25,41 @@ wifi:
|
||||||
|
|
||||||
captive_portal:
|
captive_portal:
|
||||||
|
|
||||||
web_server:
|
|
||||||
port: 80
|
|
||||||
|
|
||||||
sensor:
|
|
||||||
- platform: wifi_signal
|
|
||||||
name: "pc-switch WiFi Signal"
|
|
||||||
update_interval: 60s
|
|
||||||
|
|
||||||
switch:
|
switch:
|
||||||
- platform: gpio
|
- platform: gpio
|
||||||
pin: D6
|
pin: D6
|
||||||
id: power_pin
|
|
||||||
internal: true
|
|
||||||
|
|
||||||
- platform: template
|
|
||||||
name: "Power Switch"
|
|
||||||
id: power_switch
|
id: power_switch
|
||||||
internal: true
|
internal: true
|
||||||
turn_on_action:
|
on_turn_on:
|
||||||
- switch.turn_on: power_pin
|
|
||||||
- delay: 300ms
|
- delay: 300ms
|
||||||
- switch.turn_off: power_pin
|
- switch.turn_off: power_switch
|
||||||
|
|
||||||
- platform: template
|
- platform: gpio
|
||||||
name: "Power Switch Force"
|
pin: D6
|
||||||
id: power_switch_force
|
id: power_switch_force
|
||||||
internal: true
|
internal: true
|
||||||
turn_on_action:
|
on_turn_on:
|
||||||
- switch.turn_on: power_pin
|
|
||||||
- delay: 5000ms
|
- delay: 5000ms
|
||||||
- switch.turn_off: power_pin
|
- switch.turn_off: power_switch_force
|
||||||
|
|
||||||
- platform: gpio
|
- platform: gpio
|
||||||
pin: D7
|
pin: D7
|
||||||
id: reset_pin
|
|
||||||
internal: true
|
|
||||||
|
|
||||||
- platform: template
|
|
||||||
name: "Reset Switch"
|
|
||||||
id: reset_switch
|
id: reset_switch
|
||||||
internal: true
|
on_turn_on:
|
||||||
turn_on_action:
|
|
||||||
- switch.turn_on: reset_pin
|
|
||||||
- delay: 300ms
|
- delay: 300ms
|
||||||
- switch.turn_off: reset_pin
|
- switch.turn_off: reset_switch
|
||||||
|
|
||||||
binary_sensor:
|
binary_sensor:
|
||||||
- platform: gpio
|
- platform: gpio
|
||||||
pin: D0
|
pin: D0
|
||||||
id: pc_power_sensor
|
id: pc_power_sensor
|
||||||
name: "${name} Power State"
|
name: "PC Power State"
|
||||||
device_class: power
|
device_class: power
|
||||||
icon: "mdi:desktop-classic"
|
icon: "mdi:desktop-classic"
|
||||||
|
|
||||||
button:
|
button:
|
||||||
- platform: template
|
- platform: template
|
||||||
name: "${name} Power Button"
|
name: "PC Power Button"
|
||||||
id: power_button
|
id: power_button
|
||||||
icon: "mdi:power-standby"
|
icon: "mdi:power-standby"
|
||||||
on_press:
|
on_press:
|
||||||
|
|
@ -100,7 +67,7 @@ button:
|
||||||
- switch.toggle: power_switch
|
- switch.toggle: power_switch
|
||||||
|
|
||||||
- platform: template
|
- platform: template
|
||||||
name: "${name} Force Power Off"
|
name: "PC Force Power Off"
|
||||||
id: force_power_off
|
id: force_power_off
|
||||||
icon: "mdi:power-plug-off"
|
icon: "mdi:power-plug-off"
|
||||||
on_press:
|
on_press:
|
||||||
|
|
@ -108,7 +75,7 @@ button:
|
||||||
- switch.toggle: power_switch_force
|
- switch.toggle: power_switch_force
|
||||||
|
|
||||||
- platform: template
|
- platform: template
|
||||||
name: "${name} Reset Button"
|
name: "PC Reset Button"
|
||||||
id: reset_button
|
id: reset_button
|
||||||
icon: "mdi:restart"
|
icon: "mdi:restart"
|
||||||
on_press:
|
on_press:
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue