Cannot get relay to switch

I am not sure why, but I cannot get this relay to switch using a ESP866 wemod D1 mini board. When I touch the relay GPIO wire to GROUND or even 3v3, the relay powers on, when attached to the D1 pin, the relay just remains on and will not switch with the Switch in the code.

Any ideas?

Simple code for testing

switch:
  - platform: gpio
    pin:
      number: GPIO5
#      inverted: true
    name: "HeaterPower"

image

Do you have the docs for that relay?

No, but I traced the pins based on the esp01pinout.

If I apply GND to the relay, it turns on, if I take GND off, it turns off.

  1. Show the whole yaml file for your relay.
  2. Why don’t you just use the ESP8266-01 the the board is designed for? They cost a whopping $1.

I guess a pullup/pulldown issue.

Went out on a limb, and managed to solve this like this.

Cant really work out in my brain how it logically works or why I managed to come to this conclusion but it works and it didnt smoke.

Yeah well you do have to supply power to the relay

yup, but as I said in my first post, relay was switching the whole time so relay was powered.

I still wonder why you didn’t just use an ESP8266-01 that the relay module was designed for?

Perhaps because an esp8266 is an esp 8266. If he has a D1 mini, why not use it. There is too much e waste.

Perhaps because he wants to use it for other sensors as well.

Why do you care? It is not helpful.

Yea, other sensors. Inputs and DS18B20 etc.

But the relay is just compact and all I had on me at the time.