diff --git a/.github/workflows/esphome.yaml b/.github/workflows/esphome.yaml index d52d157..6eb353a 100644 --- a/.github/workflows/esphome.yaml +++ b/.github/workflows/esphome.yaml @@ -12,4 +12,4 @@ jobs: - uses: actions/checkout@v4 - uses: esphome/build-action@v1.8.0 with: - yaml_file: pc-switch.yaml + yaml_file: pokypow.yaml diff --git a/README.md b/README.md index 6edee8f..b4cc1e5 100644 --- a/README.md +++ b/README.md @@ -1,10 +1,10 @@ -# pc-switch +# PokyPow Remote shutdown and start you PC/server with Home Assistant. -Powered by ESPHome. +Powered by ESPHome. -![Home Assisant Panel](images/pc-switch-home-assistant-gui.png) +![Home Assistant Panel](images/pokypow-home-assistant-gui.png) 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. @@ -16,14 +16,14 @@ Just connect your power, reset and power led front panel connector to appropriat - No addons with admin access (password) to your Windows PC - Add voice commands via Home Assistant to Google Assistant -![Version 1.0 assembled](images/v1.0-assembled.jpg) +![Full Kit](images/pokypow-kit-01.jpeg) -![PCB Version 1.0](images/v1.0.jpg) +![Front and Back](images/pokypow-pcb-front-back-01.jpeg) -![Prototype](images/prototype.jpg) +![In Hand](images/pokypow-pcb-scale-02.jpeg) # Project Documentation -You can find all product documentation, related blog post on my dedicated [pc-switch website](https://www.ajfriesen.com/pc-switch/). +You can find all product documentation, related blog post on my dedicated [PokyPow website](https://www.ajfriesen.com/pc-switch/). diff --git a/images/pc-switch-home-assistant-gui.png b/images/pc-switch-home-assistant-gui.png deleted file mode 100644 index feee181..0000000 Binary files a/images/pc-switch-home-assistant-gui.png and /dev/null differ diff --git a/images/pokypow-home-assistant-gui.png b/images/pokypow-home-assistant-gui.png new file mode 100644 index 0000000..40ad698 Binary files /dev/null and b/images/pokypow-home-assistant-gui.png differ diff --git a/images/pokypow-kit-01.jpeg b/images/pokypow-kit-01.jpeg new file mode 100644 index 0000000..c57e549 Binary files /dev/null and b/images/pokypow-kit-01.jpeg differ diff --git a/images/pokypow-pcb-front-back-01.jpeg b/images/pokypow-pcb-front-back-01.jpeg new file mode 100644 index 0000000..a1ffcd5 Binary files /dev/null and b/images/pokypow-pcb-front-back-01.jpeg differ diff --git a/images/pokypow-pcb-scale-02.jpeg b/images/pokypow-pcb-scale-02.jpeg new file mode 100644 index 0000000..750e2be Binary files /dev/null and b/images/pokypow-pcb-scale-02.jpeg differ diff --git a/images/prototype.jpg b/images/prototype.jpg deleted file mode 100644 index c0696eb..0000000 Binary files a/images/prototype.jpg and /dev/null differ diff --git a/images/v1.0-assembled.jpg b/images/v1.0-assembled.jpg deleted file mode 100644 index df2a795..0000000 Binary files a/images/v1.0-assembled.jpg and /dev/null differ diff --git a/images/v1.0.jpg b/images/v1.0.jpg deleted file mode 100644 index e190c6b..0000000 Binary files a/images/v1.0.jpg and /dev/null differ diff --git a/pc-switch.yaml b/pc-switch.yaml deleted file mode 100644 index 860ccc0..0000000 --- a/pc-switch.yaml +++ /dev/null @@ -1,116 +0,0 @@ -substitutions: - name: "pc" - uppercase_name: "PC" - - -esphome: - name: "${name}" - platform: ESP8266 - board: nodemcuv2 - - project: - name: "ajfriesen.pc-switch" - version: "1.0.1" - -# Enable logging -logger: - -# Enable Home Assistant API -api: - -dashboard_import: - package_import_url: github://ajfriesen/pc-switch/pc-switch.yaml@main - -# Put ota password here -ota: - -# Your wifi config -wifi: - # ssid: "" - # password: "" - - # Enable fallback hotspot (captive portal) in case wifi connection fails - ap: - ssid: "PC-Switch Fallback Hotspot" - password: "fallback-wifi" - -captive_portal: - -web_server: - port: 80 - -sensor: - - platform: wifi_signal - name: "pc-switch WiFi Signal" - update_interval: 60s - -switch: - - platform: gpio - pin: D6 - id: power_pin - internal: true - - - platform: template - name: "Power Switch" - id: power_switch - internal: true - turn_on_action: - - switch.turn_on: power_pin - - delay: 300ms - - switch.turn_off: power_pin - - - platform: template - name: "Power Switch Force" - id: power_switch_force - internal: true - turn_on_action: - - switch.turn_on: power_pin - - delay: 5000ms - - switch.turn_off: power_pin - - - platform: gpio - pin: D7 - id: reset_pin - internal: true - - - platform: template - name: "Reset Switch" - id: reset_switch - internal: true - turn_on_action: - - switch.turn_on: reset_pin - - delay: 300ms - - switch.turn_off: reset_pin - -binary_sensor: - - platform: gpio - pin: D0 - id: pc_power_sensor - name: "${name} Power State" - device_class: power - icon: "mdi:desktop-classic" - -button: - - platform: template - name: "${name} Power Button" - id: power_button - icon: "mdi:power-standby" - on_press: - then: - - switch.toggle: power_switch - - - platform: template - name: "${name} Force Power Off" - id: force_power_off - icon: "mdi:power-plug-off" - on_press: - then: - - switch.toggle: power_switch_force - - - platform: template - name: "${name} Reset Button" - id: reset_button - icon: "mdi:restart" - on_press: - then: - - switch.toggle: reset_switch diff --git a/pokypow.yaml b/pokypow.yaml new file mode 100644 index 0000000..627177b --- /dev/null +++ b/pokypow.yaml @@ -0,0 +1,171 @@ +esphome: + name: gaming-pokypow + friendly_name: gaming-pokypow + on_boot: + priority: -100 # Lower priority to ensure it runs after boot is complete + then: + - light.turn_on: + id: led_strip + red: 0 + green: 100% + blue: 0 + brightness: 50% + +esp32: + board: esp32-c3-devkitm-1 + framework: + type: arduino + flash_size: 4MB + + +# Enable logging +logger: + # level: DEBUG + +# Enable Home Assistant API +api: + encryption: + key: "JF2lAtubt9VdSATyOL66WJsqe+Sh1hB8HxZx4ck1V5s=" + on_client_connected: + then: + - light.turn_on: + id: led_strip + red: 0 + green: 0 + blue: 100% + brightness: 50% + on_client_disconnected: + then: + - light.turn_on: + id: led_strip + red: 100% + green: 100% + blue: 0 + brightness: 50% +ota: + - platform: esphome + password: "9a276257164827a77c20a46ee176b36e" + +wifi: + ssid: !secret wifi_ssid + password: !secret wifi_password + use_address: 192.168.178.144 + + # Enable fallback hotspot (captive portal) in case wifi connection fails + ap: + ssid: "Server Fallback Hotspot" + password: "8xAFIJNdv8xb" + +captive_portal: + +web_server: + port: 80 + +light: + - platform: neopixelbus + type: GRBW + variant: SK6812 + pin: GPIO5 + id: led_strip + num_leds: 1 + name: "LED Strip" + effects: + - addressable_rainbow: + +sensor: + - platform: wifi_signal + name: "WiFi Signal" + update_interval: 2s + + +switch: + - platform: gpio + pin: + number: GPIO7 + inverted: true + mode: + output: true + pulldown: true + id: power_pin + internal: true + + - platform: gpio + pin: + number: GPIO6 + inverted: true + mode: + output: true + pulldown: true + id: reset_pin + internal: true + + - platform: template + name: "Power Switch" + id: power_switch + internal: true + turn_on_action: + - switch.turn_on: power_pin + - delay: 2000ms + - switch.turn_off: power_pin + + - platform: template + name: "Power Switch Force" + id: power_switch_force + internal: true + turn_on_action: + - switch.turn_on: power_pin + - delay: 10000ms + - switch.turn_off: power_pin + + - platform: template + name: "Reset Switch" + id: reset_switch + internal: true + turn_on_action: + - switch.turn_on: reset_pin + - delay: 1000ms + - switch.turn_off: reset_pin + + +binary_sensor: + - platform: gpio + pin: + number: GPIO04 + mode: + input: true + pullup: true + inverted: false + id: pc_power_sensor + name: "Power State" + device_class: running + icon: "mdi:desktop-classic" + +button: + - platform: template + name: "Power Button" + id: power_button + icon: "mdi:power-standby" + on_press: + then: + - switch.toggle: power_switch + + - platform: template + name: "Force Power Off" + id: force_power_off + icon: "mdi:power-plug-off" + on_press: + then: + - switch.toggle: power_switch_force + - delay: 1000ms + - switch.turn_off: power_switch_force + + - platform: template + name: "Reset Button" + id: reset_button + icon: "mdi:restart" + on_press: + then: + - switch.toggle: reset_pin + + +