This ESPHome stuff is very intriguing so I bought a Wemos mini S2 to get familiar.
I got it working in HA and found out how to control the LED
Now I would like to read the status from a switch, so 2 wires without current.
I need to use 2 pins which represent 2 GPIO’s, right?
Am I correct that I have to use the binary_sensor component?
I’m searching how to put this into code.
Stephen, I don’t have any YAML yet, just the basic configuration to start.
My question/doubt is mostly on how to physically connect the wires. (note: inexperienced with ESP devices, and additionally electronics)
Now that you showed that image it seemed clear that I have to connect 1 lead to ground.
Is it also possible that I have to use 2 GPIO’s instead, as I thought initially?
Not normally. I’ve built dozens of IOT things using ESP’s and never connected two GPIO pins the way you describe. Not that you can’t, but I can’t imagine why you would ever need to. If you are looking at a tutorial that does connect two GPIO pins to an SPST switch, then the rest of that tutorial would be questionable.
I remember when I first started putting sensors on ESP32s I would run out of GND pins. It took quite a bit of looking about to see you can tie all grounds of your sensors to one pin GND.