I searched allover the internet, I didn’t found nothing exactly for what I need to achieve, maybe some of you already know, if yes, please share your information.
I have an ESP32 board and two wires of 3 meters each, connected to a manual wall switch.
How can I do something that ESP32 will know when those two wires are connected or not? I want that the ESP32 board to know when this manual switch it is activated (when two wires are connected). I think that this is something similar with the water leak.
Any idea how to achieve this?
On what pins I should connect those two wires and what is the ESP code for this?
If I understand correctly, you just need something which is essentially the same as an endstop switch, or physical button, and you don’t have any power loads involved with this.
In this case, you would typically use a gpio binary sensor, with one wire connected to ground on the esp and the other connected to a gpio (pick a good one).
I’m not sure how it will go with the length of wires you are using, but you can try…
I have tried with the on_press but didn’t work Thats why I chosed the on_state.
Now, everytime the sensor have the “on” state, the led is turning on as well… Which is good for me.
I should be worry using on_state ?