Coder Social home page Coder Social logo

erriez / esphomepcpowercontrolhomeassistant Goto Github PK

View Code? Open in Web Editor NEW
187.0 8.0 10.0 561 KB

ESPHome ESP8266/ESP32 PC Power Control via Home Assistant

License: MIT License

Python 100.00%
esphome esp8266 esp32 pc atx power status button reset homeassistant

esphomepcpowercontrolhomeassistant's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

esphomepcpowercontrolhomeassistant's Issues

PIN14 always returns "1"

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?

IMG_1793

IMG_1796

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())


Parts list

Cool project! I would like to build this but I'm struggling with the value of resistor R1 on your schematic 1B0E ?

R1 and R2 specs

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?

Typing error in circuit

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?

Reset pin

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)?

Reset button always is 5v

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?

Invoke power button without homeassistant (by MQTT / API via Browser)

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.