ESP-01S with Relay Board and Push Button Toggle #2126
Closed
ldellus
started this conversation in
MEPLHAA Scripts
Replies: 1 comment 1 reply
-
If it's a pushbutton, change |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello,
I have an ESP-01S connected to a relay board, which works fine from HomeKit, but I'd like to add a push button to toggle the relay manually. My MEPLHAA script is:
{
"c":{
"io": [[[0], 2], [[2], 6]] #GPIO 0 is the relay, GPIO 2 is the push button. I soldered it between the ESP-01S GPIO 2 and ground
},
"a":[{
"0": {"r":[[0]]},
"1": {"r":[[0, 1]]},
"b": [[2], [2, 0]] # This is part I can't figure out. After power on, pressing the push button turns on the relay only once, then nothing.
}]
}
Appreciate any guidance you can give.
Thanks,
Laurent
Beta Was this translation helpful? Give feedback.
All reactions