@hramrach
Michal,
If I Post one more of these. Could you give me a bit of help on figuring it out. This will be the last one
On the new one below is my code, this device is a simple on and off button. I have learned these things with a multimeter:
The device button is normally open. When I push and hold the device button, voltage is found on the bottom left terminal of the push button. I connected my gpio to that point. I have common ground between device and esp.
On my esp, with the code below when I have not pushed any buttons within home assistant, I am showing 10.7 mV. When I turn on my switch in home assistant, I get a 3 second period of 3.3v followed by a short pause, the 3 more seconds of 3.3v.
On my esp, while checking startup: I get a short burst of 3.3 volts.----> This is my problem I believe. The other esp from our original device/ conversation seems to have stopped this behavior and I have no clue why. The new device/ esp project seems to be doing this.
Can you tell me how to fix this issue?-- sense it seems by software doesn’t work.
Or as a hack, is there a way to put in the code that upon boot, send a single signal to turn it back off.—> I would be ok with this I believe.
Honestly, I would like to know the right way to fix it and the hacky way
Are there pins on the 30 pin esp32 that wont exhibit this behavior?
Also, I keep getting a warning that GPIO5 (the pin I am using), is strapping pin. Could this be the issue?
# Define the GPIO output to simulate button presses
output:
- platform: gpio
pin: GPIO5 # Use GPIO5 to simulate the button press
id: simulated_button_for_block_light
inverted: False
# Template switch to simulate two button presses
switch:
- platform: template
name: "Simulated Button"
turn_on_action:
- lambda: |-
// Simulate first button press
ESP_LOGD("main", "Simulating first button press...");
id(simulated_button_for_block_light).turn_on();
delay(3000); // Duration of the button press
id(simulated_button_for_block_light).turn_off();
delay(500); // Wait before the second press
// Simulate second button press
ESP_LOGD("main", "Simulating second button press...");
id(simulated_button_for_block_light).turn_on();
delay(3000);
id(simulated_button_for_block_light).turn_off();