Strange issue with relays

Maybe it is obvious, but I have some (for me) strange issue. I have wemos D1 mini and 4 relay board.

By default relays are turned on and when pressing the button they switch off. I have solved this by exchanging low and high in virtual pin code, but the problem is that when power goes off and then back on, everything is turned on untill I manually switch status.

And another question. I would like to see in my app the real status of each relay (no matter how it appears in button widget).

You don’t need virtual pins for that anymore.

I know I can do this now direclty in widget settings, but it still does not solve the issue (but it is great to have this possibitlity btw).

Thanks for link, I will try option via widget with polling.

Can you send some snaps of realy board??
Why you not use NO (normally open) on relay board?!

For most Chinese Relays-Bords: relays is activated by pulling the logic level to low, it means if you don’t set those pins to high after wemos power-up, relays are active.

1 Like

@monaco this is a good overview -
Be careful as they trigger on LOW therefore the need to pull pins low immediately on SETUP() otherwise a reset of your microcontroller board could inadvertently turn relay on !

Personally I use relays that are ACTIVE HIGH because I don’t want my relays to turn on in case my microcontroller freezes etc. e.g. like the Sainsmart relays that can do AC/DC but for AC I stick to the solid-state, more pricey but rock-solid.