Compare commits

...

No commits in common. "main" and "gh-pages" have entirely different histories.

83 changed files with 5247 additions and 188 deletions

2
.github/FUNDING.yml vendored
View File

@ -1,2 +0,0 @@
ko_fi: ajfriesen
custom: ["https://www.ajfriesen.com/#/portal"]

View File

@ -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

5
.gitignore vendored
View File

@ -1,5 +0,0 @@
docs/public
docs/resources/
docs/node_modules/
docs/package-lock.json
docs/.hugo_build.lock

0
.nojekyll Normal file
View File

114
404.html Normal file

File diff suppressed because one or more lines are too long

View File

@ -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.

View File

@ -1,29 +0,0 @@
# pc-switch
Remote shutdown and start you PC/server with Home Assistant.
Powered by ESPHome.
![Home Assisant Panel](images/pc-switch-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.
## 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
- Setup automation based on time, motion or the moon phase, or whatever you like to power on your PC
- No funky magic packets anymore with flaky wake on LAN (never worked for me)
- 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)
![PCB Version 1.0](images/v1.0.jpg)
![Prototype](images/prototype.jpg)
# Project Documentation
You can find all product documentation, related blog post on my dedicated [pc-switch website](https://www.ajfriesen.com/pc-switch/).

Binary file not shown.

After

Width:  |  Height:  |  Size: 180 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 140 KiB

113
categories/index.html Normal file

File diff suppressed because one or more lines are too long

1
categories/index.xml Normal file
View File

@ -0,0 +1 @@
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>pc-switch Categories</title><link>https://ajfriesen.github.io/pc-switch/categories/</link><description>Recent content in Categories on pc-switch</description><generator>Hugo -- gohugo.io</generator><atom:link href="https://ajfriesen.github.io/pc-switch/categories/index.xml" rel="self" type="application/rss+xml"/></channel></rss>

155
community/_print/index.html Normal file

File diff suppressed because one or more lines are too long

155
community/index.html Normal file

File diff suppressed because one or more lines are too long

1
community/index.xml Normal file
View File

@ -0,0 +1 @@
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>pc-switch Community</title><link>https://ajfriesen.github.io/pc-switch/community/</link><description>Recent content in Community on pc-switch</description><generator>Hugo -- gohugo.io</generator><atom:link href="https://ajfriesen.github.io/pc-switch/community/index.xml" rel="self" type="application/rss+xml"/></channel></rss>

4
css/prism.css Normal file
View File

@ -0,0 +1,4 @@
/* PrismJS 1.28.0
https://prismjs.com/download.html#themes=prism&languages=markup+css+clike+javascript+bash+c+csharp+cpp+go+java+markdown+python+scss+sql+toml+yaml&plugins=toolbar+copy-to-clipboard */
code[class*=language-],pre[class*=language-]{color:#000;background:0 0;text-shadow:0 1px #fff;font-family:Consolas,Monaco,'Andale Mono','Ubuntu Mono',monospace;font-size:1em;text-align:left;white-space:pre;word-spacing:normal;word-break:normal;word-wrap:normal;line-height:1.5;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-hyphens:none;-moz-hyphens:none;-ms-hyphens:none;hyphens:none}code[class*=language-] ::-moz-selection,code[class*=language-]::-moz-selection,pre[class*=language-] ::-moz-selection,pre[class*=language-]::-moz-selection{text-shadow:none;background:#b3d4fc}code[class*=language-] ::selection,code[class*=language-]::selection,pre[class*=language-] ::selection,pre[class*=language-]::selection{text-shadow:none;background:#b3d4fc}@media print{code[class*=language-],pre[class*=language-]{text-shadow:none}}pre[class*=language-]{padding:1em;margin:.5em 0;overflow:auto}:not(pre)>code[class*=language-],pre[class*=language-]{background:#f5f2f0}:not(pre)>code[class*=language-]{padding:.1em;border-radius:.3em;white-space:normal}.token.cdata,.token.comment,.token.doctype,.token.prolog{color:#708090}.token.punctuation{color:#999}.token.namespace{opacity:.7}.token.boolean,.token.constant,.token.deleted,.token.number,.token.property,.token.symbol,.token.tag{color:#905}.token.attr-name,.token.builtin,.token.char,.token.inserted,.token.selector,.token.string{color:#690}.language-css .token.string,.style .token.string,.token.entity,.token.operator,.token.url{color:#9a6e3a;background:hsla(0,0%,100%,.5)}.token.atrule,.token.attr-value,.token.keyword{color:#07a}.token.class-name,.token.function{color:#dd4a68}.token.important,.token.regex,.token.variable{color:#e90}.token.bold,.token.important{font-weight:700}.token.italic{font-style:italic}.token.entity{cursor:help}
div.code-toolbar{position:relative}div.code-toolbar>.toolbar{position:absolute;z-index:10;top:.3em;right:.2em;transition:opacity .3s ease-in-out;opacity:0}div.code-toolbar:hover>.toolbar{opacity:1}div.code-toolbar:focus-within>.toolbar{opacity:1}div.code-toolbar>.toolbar>.toolbar-item{display:inline-block}div.code-toolbar>.toolbar>.toolbar-item>a{cursor:pointer}div.code-toolbar>.toolbar>.toolbar-item>button{background:0 0;border:0;color:inherit;font:inherit;line-height:normal;overflow:visible;padding:0;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none}div.code-toolbar>.toolbar>.toolbar-item>a,div.code-toolbar>.toolbar>.toolbar-item>button,div.code-toolbar>.toolbar>.toolbar-item>span{color:#bbb;font-size:.8em;padding:0 .5em;background:#f5f2f0;background:rgba(224,224,224,.2);box-shadow:0 2px 0 0 rgba(0,0,0,.2);border-radius:.5em}div.code-toolbar>.toolbar>.toolbar-item>a:focus,div.code-toolbar>.toolbar>.toolbar-item>a:hover,div.code-toolbar>.toolbar>.toolbar-item>button:focus,div.code-toolbar>.toolbar>.toolbar-item>button:hover,div.code-toolbar>.toolbar>.toolbar-item>span:focus,div.code-toolbar>.toolbar>.toolbar-item>span:hover{color:inherit;text-decoration:none}

4
css/swagger-ui.css Normal file

File diff suppressed because one or more lines are too long

327
docs/_print/index.html Normal file

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1 @@
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>pc-switch Contribution Guidelines</title><link>https://ajfriesen.github.io/pc-switch/docs/contribution-guidelines/</link><description>Recent content in Contribution Guidelines on pc-switch</description><generator>Hugo -- gohugo.io</generator><atom:link href="https://ajfriesen.github.io/pc-switch/docs/contribution-guidelines/index.xml" rel="self" type="application/rss+xml"/></channel></rss>

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1 @@
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>pc-switch How to build the pc-switch</title><link>https://ajfriesen.github.io/pc-switch/docs/how-to-build/</link><description>Recent content in How to build the pc-switch on pc-switch</description><generator>Hugo -- gohugo.io</generator><atom:link href="https://ajfriesen.github.io/pc-switch/docs/how-to-build/index.xml" rel="self" type="application/rss+xml"/></channel></rss>

Binary file not shown.

After

Width:  |  Height:  |  Size: 180 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 140 KiB

191
docs/index.html Normal file

File diff suppressed because one or more lines are too long

1
docs/index.xml Normal file
View File

@ -0,0 +1 @@
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>pc-switch Documentation</title><link>https://ajfriesen.github.io/pc-switch/docs/</link><description>Recent content in Documentation on pc-switch</description><generator>Hugo -- gohugo.io</generator><atom:link href="https://ajfriesen.github.io/pc-switch/docs/index.xml" rel="self" type="application/rss+xml"/></channel></rss>

File diff suppressed because one or more lines are too long

207
docs/overview/index.html Normal file

File diff suppressed because one or more lines are too long

1
docs/overview/index.xml Normal file
View File

@ -0,0 +1 @@
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>pc-switch Overview</title><link>https://ajfriesen.github.io/pc-switch/docs/overview/</link><description>Recent content in Overview on pc-switch</description><generator>Hugo -- gohugo.io</generator><atom:link href="https://ajfriesen.github.io/pc-switch/docs/overview/index.xml" rel="self" type="application/rss+xml"/></channel></rss>

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1 @@
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>pc-switch Similar Products</title><link>https://ajfriesen.github.io/pc-switch/docs/similiar-products/</link><description>Recent content in Similar Products on pc-switch</description><generator>Hugo -- gohugo.io</generator><atom:link href="https://ajfriesen.github.io/pc-switch/docs/similiar-products/index.xml" rel="self" type="application/rss+xml"/></channel></rss>

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.1 KiB

BIN
favicons/android-36x36.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 980 B

BIN
favicons/android-48x48.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

BIN
favicons/android-72x72.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

BIN
favicons/android-96x96.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.6 KiB

BIN
favicons/favicon-1024.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 27 KiB

BIN
favicons/favicon-16x16.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 498 B

BIN
favicons/favicon-256.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.8 KiB

BIN
favicons/favicon-32x32.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 807 B

BIN
favicons/favicon.ico Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

BIN
favicons/pwa-192x192.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.1 KiB

BIN
favicons/pwa-512x512.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

BIN
favicons/tile150x150.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.8 KiB

BIN
favicons/tile310x150.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

BIN
favicons/tile310x310.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 23 KiB

BIN
favicons/tile70x70.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.5 KiB

BIN
firmware_build/firmware.bin Normal file

Binary file not shown.

View File

@ -0,0 +1,14 @@
{
"name": "pc-switch",
"version": "1.0.0",
"home_assistant_domain": "esphome",
"funding_url": "https://www.ajfriesen.com/#/portal/signup/",
"builds": [
{
"chipFamily": "ESP8266",
"parts": [
{ "path": "firmware.bin", "offset": 0 }
]
}
]
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 211 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 137 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 629 KiB

210
index.html Normal file

File diff suppressed because one or more lines are too long

1
index.xml Normal file
View File

@ -0,0 +1 @@
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>pc-switch pc-switch</title><link>https://ajfriesen.github.io/pc-switch/</link><description>Recent content on pc-switch</description><generator>Hugo -- gohugo.io</generator><atom:link href="https://ajfriesen.github.io/pc-switch/index.xml" rel="self" type="application/rss+xml"/></channel></rss>

1652
js/deflate.js Normal file

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

21
js/prism.js Normal file

File diff suppressed because one or more lines are too long

134
js/swagger-ui-bundle.js Normal file

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

19
js/tabpane-persist.js Normal file
View File

@ -0,0 +1,19 @@
if (typeof Storage !== 'undefined') {
const activeLanguage = localStorage.getItem('active_language');
if (activeLanguage) {
document
.querySelectorAll('.persistLang-' + activeLanguage)
.forEach((element) => {
$('#' + element.id).tab('show');
});
}
}
function persistLang(language) {
if (typeof Storage !== 'undefined') {
localStorage.setItem('active_language', language);
document.querySelectorAll('.persistLang-' + language)
.forEach((element) => {
$('#' + element.id).tab('show');
});
}
}

View File

@ -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

1
robots.txt Normal file
View File

@ -0,0 +1 @@
User-agent: *

File diff suppressed because one or more lines are too long

117
search/index.html Normal file

File diff suppressed because one or more lines are too long

1
sitemap.xml Normal file
View File

@ -0,0 +1 @@
<?xml version="1.0" encoding="utf-8" standalone="yes"?><urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:xhtml="http://www.w3.org/1999/xhtml"><url><loc>https://ajfriesen.github.io/pc-switch/docs/overview/</loc></url><url><loc>https://ajfriesen.github.io/pc-switch/docs/how-to-build/</loc></url><url><loc>https://ajfriesen.github.io/pc-switch/docs/contribution-guidelines/</loc></url><url><loc>https://ajfriesen.github.io/pc-switch/docs/similiar-products/</loc></url><url><loc>https://ajfriesen.github.io/pc-switch/docs/</loc></url><url><loc>https://ajfriesen.github.io/pc-switch/categories/</loc></url><url><loc>https://ajfriesen.github.io/pc-switch/community/</loc></url><url><loc>https://ajfriesen.github.io/pc-switch/</loc></url><url><loc>https://ajfriesen.github.io/pc-switch/search/</loc></url><url><loc>https://ajfriesen.github.io/pc-switch/tags/</loc></url><url><loc>https://ajfriesen.github.io/pc-switch/web-flasher/</loc></url></urlset>

113
tags/index.html Normal file

File diff suppressed because one or more lines are too long

1
tags/index.xml Normal file
View File

@ -0,0 +1 @@
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>pc-switch Tags</title><link>https://ajfriesen.github.io/pc-switch/tags/</link><description>Recent content in Tags on pc-switch</description><generator>Hugo -- gohugo.io</generator><atom:link href="https://ajfriesen.github.io/pc-switch/tags/index.xml" rel="self" type="application/rss+xml"/></channel></rss>

File diff suppressed because one or more lines are too long

126
web-flasher/index.html Normal file

File diff suppressed because one or more lines are too long

1
web-flasher/index.xml Normal file
View File

@ -0,0 +1 @@
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>pc-switch ESP Web Tools installer</title><link>https://ajfriesen.github.io/pc-switch/web-flasher/</link><description>Recent content in ESP Web Tools installer on pc-switch</description><generator>Hugo -- gohugo.io</generator><atom:link href="https://ajfriesen.github.io/pc-switch/web-flasher/index.xml" rel="self" type="application/rss+xml"/></channel></rss>

BIN
webfonts/fa-brands-400.ttf Normal file

Binary file not shown.

Binary file not shown.

BIN
webfonts/fa-regular-400.ttf Normal file

Binary file not shown.

Binary file not shown.

BIN
webfonts/fa-solid-900.ttf Normal file

Binary file not shown.

BIN
webfonts/fa-solid-900.woff2 Normal file

Binary file not shown.

Binary file not shown.

Binary file not shown.