The problem is that after every press of the HA button, the code works well, turning on my computer. But exactly 1 minute after, the relay activate for like 6 / 7 seconds, turning off my PC.
Nothing interesting can be found in the log, even when VERY_VERBOSE is activated and even in the ESPHome HA log.
Bonjour! The bottom of the page you’ve linked to, shows the following code. Notice the comment:
output:
- platform: gpio
id: out_relay
#Inverts relay operation, this avoids force shutdown behavior on some motherboards. Uncomment here and replace the above lambda if you are having this problem.
#inverted: True
pin: GPIO12
Did you try that? Also, it looks like the script in there is slightly more complicated, with some additional logic to ensure proper functioning of the button. I would actually suggest to try the script as-is, and try with the inverted option (notice you’ll also need to uncomment/replace another piece of code if you use the inverted logic).
Thank you for your reply,
I have already tried the full script, even the inverted option, but with no success. I have only simplified the script to chase down what is going wrong.
I finally posted the problem here because even with the simpliest script possible, the problem was still there ! And I’m not able to understand how to make this work…
Ya, I dont know about this one. It does specifically say that, " The configuration below covers just the basics for getting the core functionality (turning PC on/off and seeing its status) usable in ESPHome. Depending on your specific needs, more configuration may be needed. E.G.: most motherboards will interpret the power button being pressed for 5+ seconds to mean "shutdown now ".
Id say youmay need to get your multimeter out and watch the state(voltage) of the power button to see what its doing. I mean, I’m not a PC expert or going to pretend to know all the ways a motherboard and power button communicate back and forth. It sounds like they configured it to work with a standard motherboard/power button config but, yours may not operate the same way and you are one of the, " may need more configuration people/PC’s"
I would break out the multimeter and watch GPIO0 to see what its doing and what on/off signals its sending in the backround.
Maybe you should stay on topic and learn how to properly articulate a question if you dont want people to make assumptions. You act like im the one at fault when you reference specific hardware in vague terms and dont distinguish your question is in reference to constant current or constant voltage which i can only assume the reason is because you dont know the difference or esle you wouldnt make such an amateur mistake. This isnt hard stuff to comprehend, pick up a book once in a while and educate yourself or keep coming at me and ill put you in your place.