Skip to content
View in the app

A better way to browse. Learn more.

Power Forum - Renewable Energy Discussion

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Light switch wiring I don't understand

Featured Replies

Background: The wife is unimpressed by the SmartLife stuff I’ve set up so far, but she does see a need for being able to switch on a light in our entrance hall. A Tuya smart switch will do that job! In fact it solves another problem for me because the current switch is 2 gang, and the second gang powers two exterior lamps which are night sensing. But that arrangement is easily defeated by just turning the switch off. So if I can set up schedules on SmartLife then I don’t care if that switch gets turned off - it will just turn on again according to the schedule (this is not fool proof, but it is better, and besides I can set up multiple schedules to turn it on).

So I’ve been reading about the smart light switches. I’m hoping I won’t have to call in an electrician because well it’s a light switch, and I change one of those, can’t I?

A lot of these smart switches cater for wiring where there is no neutral. I assume they mean no neutral wire in the switch box.

OK. So what do I have? Well I don’t understand this. Well… maybe I do, but I how I use it with the smart switch is another story.

A picture is worth a 1000 words. The first image shows the wiring in the box. I assume the brown wire is hot (live) and the other two connectors are routed to the two lights. I am unhappy with the color coding, but maybe this is acceptable (also I can't do anything about it.

The second image shows the light fitting itself. Now there are three wires. I am assuming that one of the brown wires is the live from the switch box, and that N and E are fed directly to the fitting through the ceiling.

Now the smart switches all seem to have two ways of being connected. First is when there is live and neutral present (I assume they mean in the box) and that seems not to be the case here. But the second case requires a connection to the N terminal on the smart switch and a capacitor across the globe itself. Can that work here? There only seems to be one connector from the globe to the box.

This may not be according to standards. IDK. I am not an electrician. Am I getting worried about nothing?

20260101_150347.jpg

20260101_150404.jpg

Edited by Bobster.
Was incomplete

  • Bobster. changed the title to Light switch wiring I don't understand
  • Author

I think I'm OK. Here's a nice, clear wiring diagram for a commonly available switch. It shows both scenarios - L&N in the box and L only. I think I have the right hand side arrangement.

I don't understand what the capacitor is doing here, but I can manage this. The light fitting even has chocolate box inside to make life easier.

Smart-WiFi-Light-Switch-touch-panel-dual-neutral-connections.jpg

1 hour ago, Bobster. said:

I think I'm OK. Here's a nice, clear wiring diagram for a commonly available switch. It shows both scenarios - L&N in the box and L only. I think I have the right hand side arrangement.

I don't understand what the capacitor is doing here, but I can manage this. The light fitting even has chocolate box inside to make life easier.

Smart-WiFi-Light-Switch-touch-panel-dual-neutral-connections.jpg

Concerning your first post: The colour coding is not good or compliant. Lazy workmanship just to slap captyre in there. Suppose to use Single GP wire red and use a sealed junction box in the roof space. Red is live. You should only see red wires and if the electrician was adamant to use captyre only brown, no earth on the switch( double insulated) and captyre in pvc conduit. But wondering if the fitting side has a PE connection. Very poor crimping on the earth connection crimping tool was not used instead sidecutter or pliers was used to crimp the ferrule.

Second post: Why the capacitor is needed in the no-neutral wiring (right-hand diagram) In a no-neutral smart switch installation, the switch must still power its electronics when the light is OFF. Since there is no neutral at the switch, it draws a small standby current through the lamp. With LED lamps, this leakage current causes flicker, ghost glow, or random flashing. The capacitor is installed across Live and Neutral at the first/closest light fitting to provide a bypass path for this standby current. This allows the switch to power itself without passing current through the LED driver, keeping the lamp fully off. The capacitor is not for the lamp — it is part of the switch’s power supply in no-neutral installations. It is not required when a neutral is present at the switch. Typical value: 0.33–0.47 µF, 275VAC, Class X2 (non-polarised).

Edited by TaliaB

  • Author

The house has been modified in stages, and the color scheme for the wiring in the switch boxes is not consistent. Over the years various bits of work have been done and... Let's say cost was a consideration. I did open another box, for a 3 gang switch and there the wires to the lights were all red.

Thanks for the explanation of the capacitor. That fitting... An LED lamp is OK in there, but a CFL always glows slightly.

So when the neutral is present in the box, the smart switch is using that only to power itself, it still only switches the live. And in the situation I have the capacitor allows current back to the smart switch but avoids a short?

Thanks for the explanation @TaliaB if I may say so, you add real value here.

Edited by Bobster.

11 hours ago, Bobster. said:

The house has been modified in stages, and the color scheme for the wiring in the switch boxes is not consistent. Over the years various bits of work have been done and... Let's say cost was a consideration. I did open another box, for a 3 gang switch and there the wires to the lights were all red.

Thanks for the explanation of the capacitor. That fitting... An LED lamp is OK in there, but a CFL always glows slightly.

So when the neutral is present in the box, the smart switch is using that only to power itself, it still only switches the live. And in the situation I have the capacitor allows current back to the smart switch but avoids a short?

Thanks for the explanation @TaliaB if I may say so, you add real value here.

Thanks for posting the picture with the cap method of wiring. Also great to read how @TaliaB explained the circuit. This will open up using the smart switch where there is no neutral wire.

  • Author
16 minutes ago, Scorp007 said:

Thanks for posting the picture with the cap method of wiring. Also great to read how @TaliaB explained the circuit. This will open up using the smart switch where there is no neutral wire.

Most of these smart light switches are advertised as catering for a situation where the neutral is in the ceiling and only the live is in the box. But the information they give is usually for electricians. I am not an electrician. They always provide wiring diagrams but not as clear as the one I found and posted. That gave me confidence that I can do the job. You always get the capacitor in the box with the switch.

I want to fit two switches in fact, maybe more going forwards. The other box has the L & E in the box, but not connected to the switch.

The next problem I have to solve is one of those lights on a stairwell that has two switches controlling it. I think it can be done with the smart switches, but I need to experiment with the two that I'm about to fit to see what methods and properties they expose to Tuya. This job is not strictly necessary. I am justifying it on the grounds that I will have the same style of switch throughout the house.

The first two switches are justifiable. Both have lights that should come on at night and do, because they have night-sensing globes in them. But that scheme is easily defeated, and it bothers my sense of pernicketiness that they don't all switch on at exactly the same time. Additionally, the one I posted pictures of has a light that we would like to be able to turn on remotely when we're on our way home.

Yes, we could just leave it on. It's an LED. Draws next to nothing. But where's the fun in that?

Edited by Bobster.
clarity

3 hours ago, Bobster. said:

Most of these smart light switches are advertised as catering for a situation where the neutral is in the ceiling and only the live is in the box. But the information they give is usually for electricians. I am not an electrician. They always provide wiring diagrams but not as clear as the one I found and posted. That gave me confidence that I can do the job. You always get the capacitor in the box with the switch.

I want to fit two switches in fact, maybe more going forwards. The other box has the L & E in the box, but not connected to the switch.

The next problem I have to solve is one of those lights on a stairwell that has two switches controlling it. I think it can be done with the smart switches, but I need to experiment with the two that I'm about to fit to see what methods and properties they expose to Tuya. This job is not strictly necessary. I am justifying it on the grounds that I will have the same style of switch throughout the house.

The first two switches are justifiable. Both have lights that should come on at night and do, because they have night-sensing globes in them. But that scheme is easily defeated, and it bothers my sense of pernicketiness that they don't all switch on at exactly the same time. Additionally, the one I posted pictures of has a light that we would like to be able to turn on remotely when we're on our way home.

Yes, we could just leave it on. It's an LED. Draws next to nothing. But where's the fun in that?

I am following what you found. Someone sent me a hand drawn sketch where he did not have a neutral. He got it from a family member. I did not study it and suggested as a hand on guy I can provide a fish tape to draw in a neutral. Shows you little knowledge is dangerous.

My Sonoff is in my heat pump. Sometimes it takes long to connect to WiFi when I want to manually switch on the heat pump. If I had time I put moving the Sonoff to next to my geyser then at least I could manually switch the pump on.

I also have a kitchen light where I only have a one way switch and would like to be able to use APP or a wall switch. But also much lower on my wish list.

  • Author
6 hours ago, Scorp007 said:

My Sonoff is in my heat pump. Sometimes it takes long to connect to WiFi when I want to manually switch on the heat pump. If I had time I put moving the Sonoff to next to my geyser then at least I could manually switch the pump on.

I'm using a CBI smart controller for that. It fits right into the DB (DIN or Samite). I don't control the pump with it, it's just monitoring.

Since one Tuya device can react to another's status or consumption, and since I have another ASC on the guest geyser, I should be able to ensure that only one can run at a time.

You can integrate Sonoff & Tuya, but you need an interface device on the Sonoff side.

I'm inclining towards Tuya (which includes CBI) because I want one app controlling everything.

  • Author
16 hours ago, Bobster. said:

I'm using a CBI smart controller for that. It fits right into the DB

And I saw today a similar Sonoff device. They call it a "smart monitor", but, like CBI's "smart controller" it is really a timer with energy monitoring functionality.

[EDIT] This does provide the functionality I describe, but it doesn't fit into a DB. It is also limited to 20A. Sonoff have a geyser controller which looks like the same thing, but rated for 25A.

Edited by Bobster.

7 hours ago, Bobster. said:

And I saw today a similar Sonoff device. They call it a "smart monitor", but, like CBI's "smart controller" it is really a timer with energy monitoring functionality.

[EDIT] This does provide the functionality I describe, but it doesn't fit into a DB. It is also limited to 20A. Sonoff have a geyser controller which looks like the same thing, but rated for 25A.

I am using a basic Sonoff and tapped into a circuit that only powers a relay so no need to have the main current going through the Sonoff miniature relay.

Just a personal opinion and note if you plan to use HA:

I've removed all tuya devices from my setup and moved to sonoff for everything. I ran into a problem with tuya in the early days integrating it into HA where it would become unresponsive or flaky when the cluster of devices became to big. My personal observation is also the power readings are also more delayed on tuya in HA when the device supports it. I found sonoff to be more responsive in the power readings with no delays just the normal internet lag you get.

If you plan to use the app only this is less of a issue but but having to deal with multiple apps to control your smart devices becomes a hassle which is where HA usually comes in where you can consolidate all IOT devices and if you are locked into an eco system already it becomes expensive to switch. Luckily I found this out early on and opted to switch over.

My neighbor has some tuya devices in his setup and I still see the same observation as above in his setup.

  • Author

Thanks @-cK- . HA is not totally off the radar. I have Pi with HA loaded, I've never got further than that. HA can integrate with my Goodwe inverter. That's attractive.

For Tuya devices does HA still need to deal with the Tuya cloud?

The app I really liked in terms of interface was Google Home, but it still requires one to register devices in the appropriate cloud. It allows short cuts to be created, and it is phone aware so can do things like looking at who is home on the basis of the WiFi picking up the phone. So you can then say if Husband not home and Wife not home then...

I certainly want to have one app on the phones that are not mine. And preferably with a slick interface. I'm the nerd in the family. If I grapple with registering devices in different clouds, and writing the logic for the automations then that's my world, and will keep me out of mischief. But I'm not getting any younger, and I was recently in hospital after an unexplained black out, so I want to have something that is not only easy for others to use, but easy for somebody else to take over. IFTTT, for example, is a bit simple for my liking, but it's also easy for regular folks to look at and understand.

56 minutes ago, -cK- said:

Just a personal opinion and note if you plan to use HA:

I've removed all tuya devices from my setup and moved to sonoff for everything. I ran into a problem with tuya in the early days integrating it into HA where it would become unresponsive or flaky when the cluster of devices became to big. My personal observation is also the power readings are also more delayed on tuya in HA when the device supports it. I found sonoff to be more responsive in the power readings with no delays just the normal internet lag you get.

If you plan to use the app only this is less of a issue but but having to deal with multiple apps to control your smart devices becomes a hassle which is where HA usually comes in where you can consolidate all IOT devices and if you are locked into an eco system already it becomes expensive to switch. Luckily I found this out early on and opted to switch over.

My neighbor has some tuya devices in his setup and I still see the same observation as above in his setup.

I dont use HA personally so havent had the issues with lag and unresponsiveness. I have quite a few devices at the moment and almost every plug in the kitchen has a Tuya smart switch. I use smart life to create the logic for when what comes on etc. Because I have a small inverter (3.6kW) and am off-grid, when a kettle is on for example and some extra stuff to the point where the power exceeds 2500W, the app automatically switches off the other high power devices until the power drops back to below 1000W. Almost elminates any possibility of overloading the inverter and having to reset it.

There is a whole bunch of stuff one can do with the app and the switches are the size of a gate remote rated for 16A so pretty good in my opinion. I plan on expanding it to add the pool which has a non wifi based timer. Lights are all automated outside but they are motion sensor based and have no need to use a smart switch for that. They are around 25W with the smallest being 18W and pick up any movement within 15 meters so if there isnt anyone walking outside it is pitch dark bar the occasional cat. They have a remote so if I want to turn them on manually I can do it from the comfort of my house.

Energy monitoring is done by the app also. I have no dongle on the inverter and dont plan on buying one. So I use a CT based energy monitor (2 gang) that measures the kitchen and the rest of the house. Each smart switch has energy monitoring also so I get plenty of information.

I dont particularly care about PV generation as in the 10 months I have had solar the batteries are always charged and wont be buying a generator to supplement power. Not bad considering I use GEL batteries.

Tuya.jpeg

Edited by Denns

@Bobster. Yes Tuya still needs to go through the cloud, there was a tuya local integration but seeing how my setup has my IOT on a VLAN and my HA on my main network and due to initial configurations with the solar setup and the fact I never could get the main network to bridge to the vlan without breaking my whole network setup all my IOT must go through cloud at this point so I never fiddled with that and I think it might no longer be working as it is unmaintained it think but don't quote me on that.

So initial pairing is still via the app for which ever route you go but once pulled into HA everything else is done from HA on my setup.

@Denns The lag is only present on HA as far as I recall the app itself works fine.

Where this became a deal breaker for me was with my cascade shutdown rules as everything on my home is on the 5kW inverter and if the Geyser, stove, 2x AC's and microwave is all on at the same time this can trip the inverter and if that load persist beyond the 10s buffer of the inverter has for spikes like this it becomes important to not have 5-10s delays in power readings. With my sonoff's I get near instant power readings when turning on the device with live reading updates where tuya seems to be on 5s+ refresh updates. As I knew I was going the HA route this was an important factor to consider given the scope of my setup with about 55 sonoff's deployed at this point in time.

16 minutes ago, -cK- said:

@Denns The lag is only present on HA as far as I recall the app itself works fine.

Where this became a deal breaker for me was with my cascade shutdown rules as everything on my home is on the 5kW inverter and if the Geyser, stove, 2x AC's and microwave is all on at the same time this can trip the inverter and if that load persist beyond the 10s buffer of the inverter has for spikes like this it becomes important to not have 5-10s delays in power readings. With my sonoff's I get near instant power readings when turning on the device with live reading updates where tuya seems to be on 5s+ refresh updates. As I knew I was going the HA route this was an important factor to consider given the scope of my setup with about 55 sonoff's deployed at this point in time.

I see, I havent paid attention to the speed of the updates as because everyone in the home knows not to run multiple things simultaneously. Its more as an additional step as sometimes someone can forget. A 5 second delay in such a situation wouldnt cause a problem. But it does look like Sonoff is better with speed. If someone switches on a kettle and immediately goes to switch on the microwave and something else I suspect I will run into your issue. So far it hasnt been the case.

7 minutes ago, Denns said:

I see, I havent paid attention to the speed of the updates as because everyone in the home knows not to run multiple things simultaneously. Its more as an additional step as sometimes someone can forget. A 5 second delay in such a situation wouldnt cause a problem. But it does look like Sonoff is better with speed. If someone switches on a kettle and immediately goes to switch on the microwave and something else I suspect I will run into your issue. So far it hasnt been the case.

Yes everyone in my home also knew until that one day they didn't and tripped the inverter, hence this rule in my setup exist. 😅

image.png

@Bobster.

The next problem I have to solve is one of those lights on a stairwell that has two switches controlling it. I think it can be done with the smart switches, but I need to experiment with the two that I'm about to fit to see what methods and properties they expose to Tuya. This job is not strictly necessary. I am justifying it on the grounds that I will have the same style of switch throughout the house.

Depending on the unit you are looking at usually these mini tuya/sonoff should be capable of doing 2 way switching as the light switches itself is wired to control the 2 way function, you are just intercepting the live wire and sending that to the light from the smart switch and a signal wire to the switches and the smart switch then detects whether or not to turn on the light. Have one in my hallway configured like this.

image.png

Edited by -cK-

  • Author
1 hour ago, -cK- said:

So initial pairing is still via the app for which ever route you go but once pulled into HA everything else is done from HA on my setup.

But then surely if HA wants to turn on a Tuya device, the instruction to go to the on state must go through the Tuya cloud?

Just trying to figure out where the latency you mention is.

1 minute ago, Bobster. said:

But then surely if HA wants to turn on a Tuya device, the instruction to go to the on state must go through the Tuya cloud?

Just trying to figure out where the latency you mention is.

Yes the instruction will still go through the cloud. I think it has something to do with their API polling rate for the integration in HA itself.

You will switch on the the switch and it will power up but then the sensor giving you the power reading from the same device will take up to 5 seconds to provide the power reading and the reading thereafter also seems intermittent kind of like there is a refresh rate limit. I'll try and log in on my neighbors setup tonight see how his is performing currently but last time I setup 'n dashboard for him it was still sluggish with the readings.

Edited by -cK-

  • Author
12 minutes ago, -cK- said:

I think it has something to do with their API polling rate for the integration in HA itself.

OK. So Sonoff and Tuya have different plug ins on HA, probably developed separately, and the Sonoff plug in is quicker.

  • Author
On 2026/01/08 at 2:13 PM, -cK- said:

Yes everyone in my home also knew until that one day they didn't and tripped the inverter, hence this rule in my setup exist. 😅

image.png

@Bobster.

The next problem I have to solve is one of those lights on a stairwell that has two switches controlling it. I think it can be done with the smart switches, but I need to experiment with the two that I'm about to fit to see what methods and properties they expose to Tuya. This job is not strictly necessary. I am justifying it on the grounds that I will have the same style of switch throughout the house.

Depending on the unit you are looking at usually these mini tuya/sonoff should be capable of doing 2 way switching as the light switches itself is wired to control the 2 way function, you are just intercepting the live wire and sending that to the light from the smart switch and a signal wire to the switches and the smart switch then detects whether or not to turn on the light. Have one in my hallway configured like this.

image.png

I think that with smart light switches it's quite easy. You have two switches. One controls the light. The second controls the first switch.

So

  • Turn on S1 and the light comes on

  • Turn on S2 and S1 is turned on

  • Turn off S2 and it sends an off signal to S1
    etc

I need to just state that here I was going on about Sonoff readings being virtually live on power readings and low and behold this feature just broke last week just before the weekend ☹️

Needless to say a crap ton of automations is now broken in my HA setup that was dependent on these live readings as it seems something on Sonoff/Ewelink side was changed or broke as now the readings only update if you open the app and that device power reading section and as soon as you close it it stops again.

Waiting to see if they will resolve this or if the integration developer on HA can maybe find a bypass.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.