RavenSystem / esp-homekit-devices

Advanced firmware to add native Apple HomeKit and custom configurations, compatible with any SoC based on ESP32, ESP32-S, ESP32-C and ESP8266 series. (Shelly, Sonoff, Electrodragon, Tuya...)
Other
2.75k stars 361 forks source link

MEPLHAA Script issue #2170

Closed toddc01b closed 11 months ago

toddc01b commented 11 months ago

Hi,

Could somebody have a look at the MEPLHAA Script below and help me to understand why the button I have connected to GPIO 2 isn't working? I've got the board set up so it switches a GND to pin 5 momentarily which then changes the state of the the output on GPIO 5 each time it's pressed. It used to work with 11.8 but since upgrading to 12 and writing the new MEPLHAA Script I haven't been able to get it to work. The relay connected to GPIO 5 is working from the home app just fine and the temperature probe connected to GPIO 4 is also working.

{ "c": { "io": [[[5],2], [[0,2],6], [[4],1]]},
"a": [{ "0": {"r": [[5, 0 ]]}, "1": {"r": [[5, 1 ]]}, "t": 1, "s": 0, "d": 0, "b": [[2, 1]] }, { "t": 22, "j": 10, "n": 3, "g": 4, "z": 0 } ] }

toddc01b commented 11 months ago

All good. I figured it out. Just needed to invert the input.

{ "c": { "io": [[[5],2], [[2],6,1], [[4],1]]}, "a": [{ "0": {"r": [[5, 0 ]]}, "1": {"r": [[5, 1 ]]}, "t": 1, "s": 0, "d": 0, "b": [[2, 1]] }, { "t": 22, "j": 10, "n": 3, "g": 4, "z": 0 } ] }