Simple Push Button wiring and configuration on a Wemos D1 through Tasmota on HA

I’m sure I’m missing something, I simply want to wire a D1 Mini flashed with Tasmota to a momentary push button, and for the output (on/off) to show in Home Assistant.
The rest I can deal with.
What I have so far is a lot of speculation and a possible solution with a 4.7kOhm resistor which has already bricked one of my D1s.
I imagine I’d need to go along the same route as my (extremely easy to set up) motion sensor, and have a ‘Switch’ assigned to a connected pin, and a ‘Relay’ assigned to another, but none of it makes sense, and I’m reluctant to wire anything up now for fear of bricking another.
Any ideas?
Thanks!

Some ESP8266 pins have internal pull-up resistors, some don’t, but the only trap is using pins like GPIO0 / GPIO2 as inputs as they can prevent booting.

For specific help, you need to tell us specifically what you have done!

ESPHome != Tasmota

1 Like

Thanks - that link looks very useful!
What I’ve done is still in the research phase at the moment, what I want to do is have ‘ON’ show up on the Tasmota page when I press a physical momentary push button… I’d have thought this would be the easiest thing of all, but it’s proving really difficult to find anything on it.
I suspect from what you’ve said, that I don’t need a resistor between certain pins, but what those pins are, is still a mystery (3v and Dx?)


. I could play around with them, but it looks like a load will prevent booting.

Okay… so due to the deafening silence after my last post I was left for a full day to try and figure out what the problem and solutions were… “Give a man a fish, he’ll eat for a day, teach him how to fish, he’ll eat for life, ask him specifically what fish he’s after, and he’ll teach himself out of frustration.”
I’m far from an electronics expert, but I can trouble shoot pretty well given I have a working PIR sensor to reverse engineer.
There is a long and short answer to the question, I’ll start with the short for those of us who just want an answer (disclaimer; as stated, I’m not an electronics expert, and I’ve formed this conclusion based on my observations of this single instance. I’m absolutely certain there is a better solution):
Short answer:

  1. Flash the D1 Mini or Pro using Tasmotizer with the latest ‘Release’ of ‘tasmota-sensors.bin’.
  2. Browse to the device using the IP, and configure the module as D6 (could be any other) to ‘Relay_i’, and D8 (GPIO15) to Switch_n, both with ‘1’.
  3. Browse to the home page, and check the status which should show ‘OFF’.
  4. Use the 3.3V output from the Wemos to one side of the momentary push button switch.
  5. Use pin ‘D8’ (GPIO15) as the ‘sensor’ pin to the other side of the switch to ‘sense’ 3V.
  6. Push the button and it should go ‘ON’.

The long answer is to do all the above, but note that using another pin such as D7 will show intermittent ONs and OFFs as the voltage will slowly build up on the pin until it reaches about 2V which triggers the ON position, it’ll then drop back down giving an OFF. As far as I can tell, pin D8 has a 10KOhm resistor which ‘pulls down’ the voltage. I imagine putting the 4.7KOhm resistor on D7 would do the same, but I’m unsure.
Another note from the pinouts above would seem to suggest that if pressing the button while the Wemos is booting, will prevent it from doing so.
My bricked Wemos appears to be an issue with the device itself, as putting 5V directly on the board will boot it, so it’s ‘rubber bricked’ via the USB instead.

1 Like
binary_sensor:
  - platform: gpio
    pin:
      number: D2
      mode:
        input: true
        pullup: true
    name: "Simple Push Button"

external pull up is not necessary this way.

The ones which show a green :ok: on the “Input” column of your screenshot:

2 Likes