erriez / esphomepcpowercontrolhomeassistant Goto Github PK
View Code? Open in Web Editor NEWESPHome ESP8266/ESP32 PC Power Control via Home Assistant
License: MIT License
ESPHome ESP8266/ESP32 PC Power Control via Home Assistant
License: MIT License
I tried to replicate your project, so far power on works. But somehow my PIN32 (reads RESET pin from mainboard) always returns "1" no matter if power button pressed and pc running or not. I only shows "0" when I unplug the mainboard completely?
My ESP32 test code:
import machine
import time
# Define the pin for the LED and the boot button
led_pin = machine.Pin(2, machine.Pin.OUT)
button_pin = machine.Pin(0, machine.Pin.IN)
power_pin = machine.Pin(13, machine.Pin.OUT)
reset_pin = machine.Pin(32, machine.Pin.IN)
# Function to turn on the LED
def turn_on_led(pin):
pin.on()
# Function to turn off the LED
def turn_off_led(pin):
pin.off()
# Main loop
while True:
if button_pin.value() == 0:
turn_on_led(led_pin)
power_pin.on()
else:
turn_off_led(led_pin)
power_pin.off()
print("Power State:", reset_pin.value())
https://github.com/Erriez/ESPHomePCPowerControlHomeAssistant/blob/master/README.md
[...]
Pin D1 is used to read the power status from the reset pin: High is on, Low is off. Transistor Q1 is used for secure isolation between ESP8266 and motherboard.
Pin D2 is used to pull the power button low to generate a short or long press. Resistor R1 is used to minimize current when the IO pin is accidentally set to output.
[...]
it's written different than on the picture, which description is correct? the image or the text?
Hello,
I'm new to electronics but I'd like to build your device. Probably I don't know how to properly use KiCad and find the information in the blueprints, but could you please specify specs or exact models of R1 and R2?
Hello,
I followed all instructions and can turn on/off my PC but detection from the reset pin is impossible because it's always in the high state even if the PC is disabled. I plan to use reset GND to detect low state.
Do you think it's a good idea?
Thank you for this nice project.
Is there a chance to invoke the power button action without a homeassistant installation?
The easiest would be a dashboard directly on the ESP, another ways would be via the API. I have read some ESP Home documentation, but I am not a programmer and failed so far to find a link to something to invoke by browser. I have limited knowledge about ESP.
Cool project! I would like to build this but I'm struggling with the value of resistor R1 on your schematic 1B0E ?
Question:
Usually motherboard J2 header has pins which are used to turn on leds to show on the computer case that the computer is on.
Why not use that for pc power status, and use reset button in similar way as power button is used (this way allowing computer reset without forced powering down)?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.