Switch controlled by both mechanical and electrical force

I am trying to make a lamp switch, controlled by esp8266 module, which can also be controlled by simple mechanical switch.

So I want to find relay like this: latch relay

But I also want this same relay switched mechanically.

Does a mechanism like this exist? I haven't found one.

PS I dont want to control this relay by current produced after I push mechanical switch. I want mechanical switch to toggle its state.

That relay is not a latching relay. It is a latching behavior module. The board holds the signal state but current is needed continuously nonetheless.

True bistable relays can be mechanically overridden but I doubt you have a legitimate reason to. I don't think you have any tenable idea why you don't want a switch that does whatever you mention in the PS.

Get a basic relay with NO and NC contacts, get a switch, play around with a 3-way switch circuit, and you'll have something like you want.

I understand how to do something like this:

|500x270

The relay can be switched by both button (or switch) and by internet.

The problem with this design is that if my esp 8266 breaks, button won't work as well as internet control.

What I want is something like this:

|500x270

where if wifi control fails (esp 8266 fails), mechanical button would still work.

use switch connected parallel to relay

When I saw the title I pictured a throw switch (regular wall switch) that has to be physically flipped.

The button is much better.

Don't forget to code in a timer that keeps the relay (and any flourescent lighting) from being cycled too fast.

If it's for energy saving then consider a 5 or 10 minute delay after hitting the button before turn-off. That way one person can hit the button and leave and another come in before timeout, hit the button and cancel the timeout. Although that system would need an indicator led to show the timing-out status. A nice red-green led could serve that well.

tibnew: The problem with this design is that if my esp 8266 breaks, button won't work as well as internet control.

Why would it break? So long as it's constructed with reasonable care the chip will last for many decades.

You shouldn't be playing with mains if you have such little faith and knowledge in your components. And couldn't be clear about the difference between a switch and a button.

There is no way to mechanically override that relay since it is a continuously energized coil.

INTP: You shouldn't be playing with mains if you have such little faith and knowledge in your components. And couldn't be clear about the difference between a switch and a button.

There is no way to mechanically override that relay since it is a continuously energized coil.

Well, actually I wanted to make a light switch, but since the light would be toggled by both the switch and internet, it doesn't make sense to make a switch because it just toggles the light. Switch position doesn't represent the light's state. So it makes sense to use a button. But it doesn't really matter.

I know that playing with mains is dangerous) Thank you for worrying)

I also know that latching relay is controlled by the current.

Maybe I wasn't quite clear but I am wondering if a device (similar to relay) exists, which can be controlled both by current and by hand. Relay is controlled only by current.

I just thought that this kind of mechanism would be more reliable than just electronic stuff. I could be wrong of course)

You could wire a light switch between the relay and lamp, at least you could turn it off by hand.

GoForSmoke: You could wire a light switch between the relay and lamp, at least you could turn it off by hand.

It would have to be in parallel, not series (which is what I imagine 'between' means)

tibnew: Maybe I wasn't quite clear but I am wondering if a device (similar to relay) exists, which can be controlled both by current and by hand. Relay is controlled only by current.

I can't say I've ever seen one. But is very easy to wire, the simple method as mentioned above is to use a 2-way switch circuit, but replace one of the switches by the relay. That has a small disadvantage that the internet switch will rely on the manual switch being in the "off" position to work correctly.

If you have a source of 5V, then you can wire the manual switch in parallel (on the 5V side), but you will need a diode to protect the output of the esp866.

INTP: It would have to be in parallel, not series (which is what I imagine 'between' means)

I don't think so.

The relay has mains AC running on 2 wires to the lamp.

Switch in series on 1 of those will break the circuit when open.

Switch in parallel will short the 2 wires won't it? Sure, the light will turn off but.....

GoForSmoke: Switch in parallel will short the 2 wires won't it? Sure, the light will turn off but.....

what? parallel to relay. the load (bulb) is still in circuit

With a dead short between the relay and load, you expect what?

https://en.wikipedia.org/wiki/Series_and_parallel_circuits#Switches_2

https://en.wikipedia.org/wiki/Series_and_parallel_circuits#Switches_2

I followed that link, it left me on the search results page with the wikipedia article up top so I went there and used Edit->Find to see every occurrence of the word switch. They were all in one short section with no diagrams.

Switches

Two or more switches in series form a logical AND; the circuit only carries current if all switches are closed. See AND gate.

And that's it.

1 lightbulb and 1 switch connected to power, calculate the load:

Consider them to be resistors in parallel with the switch being either infinite or zero ohms. Open switch, the load is the resistor, all current flows through the resistor. Close the switch and tell me what current flows through the resistor.

I see internet examples of wiring 2 switches in parallel with a light bulb, but the parallel switches are in series with the light bulb.

GoForSmoke: ... the parallel switches are in series with the light bulb.

of course, who said something else?

If you want the mechanical switch to override the relay (only other switch) then you will need something besides a wired OR-gate made of the two. Yes, switches wired in parallel make an OR-gate.

Actually the relay controls power to the bulb and the one switch overrides power to the bulb. I would put the switch in series with the bulb since in parallel with the bulb the switch would short the power.

OP needs the switch if the ESP is not powered and then I assume the relay is open

3-way switch circuit with traveler, using a NO/NC relay and a 3-way (SPDT) manual switch is how to have a light controlled both by mcu and a manual switch. I mentioned this in post #1. Activating either mcu or manual switch toggles the state of the light. If mcu fails, it's a normal, manual light switch.

All of this other crap came about as the OP's combination of inherent distrust in the reliability of devices and the paramount importance that this one light, being the sole source of light and warmth for 10 families, means it must be 100.1% workable even when it doesn't.