Awesome, i’ll give it a test.
I’m confused. Where does the power come from, if not from the switch side or the ceiling fixture? Aren’t both the hot and neutral in the same cable from the breaker box?
I’ll try to explain once more:
Neutral goes directly to the ceiling. No permanent neutral in switch box.
Live goes to switch box. From switch to ceiling. No permanent live on ceiling.
No, they are not in the same cable.
Hence the question.
It is quite common in older buildings where I live.
Now I’m also confused, based on the explanations across multiple posts. Could you do a wiring diagram here to illustrate what you have got, and what you are trying to achieve? This is probably one of those “help us so that we can help you” situation.
I have the same setup on one of my lights
Live going to the ceiling light from the switch and only neutral at the ceiling light.
I was able to use the R4 with Tasmota to make it smart
No it is not the case… ferbulous already answered my original question. I hoped that my idea was original but fortunately (or unfortunately) Sonoff has already manufactured it, albeit in one product only. But I guess it is better than no product at all.
What in my description of the situation trips you off? It is quite simple.
The only places I can install relays and still have physical switch function plus smarts, are:
- in the switch box (but needs to be no-neutral relay, that is what they are built for, but they have some issues nowadays with low wattage LED lighting)
- on ceiling where I have neutral and SWITCHED live. Which is what I was asking. Which is what Magic Switch Mode of the Basic R4 apparently provides.
I ordered a bunch of R4 and will receive them in a couple of days, so I will flash esphome or tasmota on them and see.
Might need to backup the stock firmware for each one, just incase
Please let us know how you make out. I’m not really sure where you plan to install one of these in your diagram. I thought I was familiar with wiring, going back to the old knob-and-tube days, but I haven’t run into a fixture wired the way you describe. I’d be very interested in hearing how you solve this one. Thanks!
I always bring neutral to my smart devices, because I can.
I never use Sonoff, because I don’t need to.
But the idea of Magic Mode is brilliant, allow few millisecond switch-off to be sensed while maintaining device powered (from caps?). Much better than other “no-neutral” implementations.
Well… Good for you. In my house built from scratch, I not only brought neutral through the switch box, but also distributed 24V DC around the house for powered sensors, solenoid locks and wall panels, etc which I step down to 12V or 5V with a buck converter as needed.
But this is not one of those cases. It is an apartment in a 300+ year old building with walls 1m thick with electrical wiring ca 100 years old and covered with a lot of plaster. I really, really, REALLY do not want to replaster everything just to get a ceiling lamp smart. Never mind that all such renovations MUST be approved by a local heritage foundation.
If you already have 2-way switches, the “operation” should be minimal with Magic Mode approach.
Another option would be battery operated wireless switches (buttons)…
The diagram helps. I’m sure it would trigger more discussions.
EDIT: Indeed there were more discussions already.
If anyone is interested, I flashed 4 Sonoff Basic R4 relays with ESPHome and got magic Switch Mode working beautifully. Took some tuning of “timeout” parameter, because my switches produce ca 4000 μs gap when wired this way and I think the magic_switch component’s default is 12000 μs, but otherwise smooth sailing.
As you were interested - this is how i connected it:
Basic R4 is installed inside the ceiling lamp fixture.
When switched, Basic R4 detects a ~4000 μs gap in Live and toggles the relay. So switch continues to work and I have control from HA.
4ms, really short. How is esphome taking care of the sensing? Interrupt call with tiny debounce?
That’s a great solution, thanks!
What I can’t figure out is what happens to the ESP32 when the power briefly goes down while the SPDT switch is being flipped? Is it so short that the CPU just keeps chugging, or is there some sort of battery or capacitor storage to see it through the drop? Just curious.
Yeah, i did not really draw it, the pic was from Sonoff materials
And they have one wire between switches - then you need to bridge twice.
You wrote ~4000 μs.
ok, that explains a lot.
yeah, sorry