UK Light switches – My experiences (2020)

In the U.K., that would be called a “two way” setup. Two switches in different locations that control the same light. (In the US, It’s called a “three way.”)

https://www.lightwiring.co.uk/two-way-switching-3-wire-system-new-harmonised-cable-colours/

A “two gang” is two switches In the same switchbox, each controlling a different light.

image

These can be combined, so that there is a two gang switch in each of the locations for the 2 way. In that case one of the two gangs on each switch is controlling the same light, but the other gang could be controlling anything at all. :sunglasses:

1 Like

2 way works fine with a module, but I do not think it would work with these switches. You would need to set up a standard 1-way at the main switch (one wait Live and connection to lamp) and use a smart button at the other location. Then create a rule to toggle the status.

1 Like

A 2-way circuit as used on a staircase can cause problem when you want to use smart switches at both locations. I have seen the following approaches.

  1. Use a micro module at one location that controls the lights, but have momentary wired switches at both locations, this approach will for example work with a FIbaro Z-Wave micro module
  2. Use two smart wired switches but one has to be configured as a slave to the other and whatever lighting system is being used then keeps them in sync
  3. Use smart switches specifically designed for 2-way use depending on the brand, see this https://lightwaverf.com/blogs/news/2-way-switch as one example
  4. Use a smart wired switch at one location and a wireless smart switch at the other end, I believe Lutron use this approach with their Pico wireless switch/remote being used at one end

I am waiting for a new product to launch but I believe it works using method 2 from my list and this seems to mean this approach always needs their own matching hub.

2 Likes

I use micro mudules (Fibaro) at a couple of 2-way locations and also a 2-way with intermediate. all working fine and using the existing wall switches. Only real challenge is fitting them behind the switch due to the depth of the back box.

2 Likes

Sorry to pounce on this thread…but hoping for some views…

Hey guys, reading this with interest…I have a bathroom fan that is wired into a fused spur and a light switch all in one (see pictures here.

Unfortunately there is no switch live on the fan that would allow me to run the fan after the light switches off for say 10 minutes

In the ceiling rose is also yeelight that is connected with alexa etc. I would quite like to use a smart switch to control the light and the fan…

My thoughts are to disconnect and separately connect the fan into its own fused spur and then connect the new fcu to the light switch so that i can still control the fan and the light independently. In reality, what i would then look to do is replace the existing light switch with a smart switch connected via , and then use a new smart switch to control the light and the fan, and potentially also trigger additional leds that i am fitting using the gledopto controller.

All my light switches have neutral and as you can see from the above link, it seems like the fan is feeding something else as well, although not sure what that could possibly be…?

Does anyone have any suggestions on which 2 gang lightswitch to use to control the light and the fan in the way suggested that connects to smart things bearing in mind all of the wires in that box!?

Thanks

1 Like

Hi,

Great thread, really useful.

So am I correct in understanding that none of these 3 gang light switches can be properly controlled by SmartThings?

A single gang is fine as SmartThings can be set to see a single generic zigbee button
The 2nd gang might be possible with the correct customised device hander
A 3rd or 4th gang just isnt working correctly. Fine for turning on and off the hard wired lights, but incapable of firing off routines etc.

Is that right?

Spent so long looking for a decent multi gang switch that works with smart things I think I’m going mad. Wonder if it’s easier to find something for a different hub, such as Hubitat?

Thanks,

Nigel

1 Like

Had my double switch working perfectly on SmartThings before I made the switch to another Hub. I haven’t changed the number of child devices to three to test more but assume that it would work, although if smart home equipment has told me anything it’s don’t assume!

Maybe an Aeotec dual Nano? Control two devices separately and has energy monitoring. You can also have them controlled by switches to the unit as well so it’s like a triple win. Have a look at them online.

Hi all, I’m new to ST. I have the 2 gang Yagusmart zigbee switch. I’ve got it connected and changed to a Zigbee Multi Switch. One switch is used to connect the normal light switch and the second as a smart switch to turn a Philips Hue table lamp on/off.

For some reason after the light switch is on for about 3 mins it automatically turns off. It does not matter if I use the switch itself or the App, they keep turning off by themselves. This is the same for the wired light and the Philips Hue light.

Any ideas or tips would be gratefully appreciated.

Hi there and welcome to the forum. Install the device handler in the above post: UK Light switches – My experiences (2020)

When you resync (or include it again) it they will create a device per switch and will work fine. One parent device and one child.

Hope this helps, there are a few posts about this above as well.

Hey AverageJoe90

When you had the 2Gang Yagusmart switch (no neutral) working did it turn off after 2 minutes or would the light remain on until turned off? I have the same issue as McjUK and a few others.

I’m wondering if the one you bought may have been slightly different than the ones on sale at the moment.
It definitely seems to be something to do with the Device Handler as when disconnected from smartthings the switch works as a normal light switch without timing out.

I’m glade it’s not just me. I know I’m new so I thought it was something I’d done or not done. I’m going to remove it and add it again but as a single switch to see if the problem still persists.

No they worked as you would expect them too. No turning off. I recommend adding as a device, changing to the device handler above (do not delete device) then press and hold the button to re-add them whilst in inclusion mode until found again. Once this is done it will auto create a child device for you to rename (second switch). Once done they should work as expected and provide live feedback (as in if you press the switch it will show in the app)

If you have any trouble I can post the device handler I was using originally.

1 Like

If you could post your original device handler that would be great.

I’ve had no luck with any of the zemismart device handlers listed, they all work to some degree but no matter what I try and modify the switches still turn off after 2 minutes and there are no errors in the logs either.

I’ve noticed in the Data Section of the Device:

  • application: 41
  • endpointId: 01
  • manufacturer: _TZ3000_fvh3pjaz
  • model: TS0012
  • onOff: catchall
  • zigbeeNodeType: SLEEPY_END_DEVICE

Does the zigbeeNodeType make any difference as to why the switch keeps turning off?
If so how do I go about changing this as I’ve looked in the Device Handler and I can not find this anywhere.
Cheers

The one I bought was in the link in the first post where I wrote the review. I’ve even used that link to buy more :+1: when I roll out of bed I will hunt down the DTH and post below. Have you added the handler like I said? Did it create a child device for the other switch? I don’t think the end point should make a different as the handler should work this out.

Hi, I have a double switch Yagusmart with no neutral and it works fine/normal. I bought it a couple of months back from Amazon UK I have always used the Smartthings default handler, i.e. “Zigbee Multi Switch”

Hi guys,

Thanks for the replies, I have tried the ZigBee Multi Switch, and the various zemismart handlers linked above, they all create a parent and child and turn on and off the lights as designed then proceed to turn off after 2 minutes…

@impee is your switch showing as a sleepy end device or a router? It’s starting to look like either the switch has changed or the move from the classic app to the current app has changed something?

Does anybody know what variables the poll() method accepts? Maybe increasing the polling rate might work…

Mine shows this for the main button:

  • application: 41
  • endpointId: 01
  • manufacturer: _TYZB01_mtlhqn48
  • model: TS0012
  • onOff: catchall
  • zigbeeNodeType: SLEEPY_END_DEVICE

The 2nd button (child device) doesn’t show much.

/*
 *  Zemi  ZigBee Switch - touch
 * 
 *  Copyright 2020 SmartThings
 *
 *  Licensed under the Apache License, Version 2.0 (the "License"); you may not
 *  use this file except in compliance with the License. You may obtain a copy
 *  of the License at:
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 *  Unless required by applicable law or agreed to in writing, software
 *  distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
 *  WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
 *  License for the specific language governing permissions and limitations
 *  under the License.
 *
 *  author : fuls@naver.com
 */
public static String version() { return "v0.0.2.20200426" }
/*
 *   2020/04/26 >>> v0.0.2.20200426 - Support to old Jemi swtich version
 *   2020/04/25 >>> v0.0.1.20200425 - Initialize
 */

import java.lang.Math

metadata {
    definition(name: "TEST Double Switch", namespace: "zemismart", author: "Onaldo", ocfDeviceType: "oic.d.switch", vid: "generic-switch", genericHandler: "ZLL") {
        capability "Actuator"
        capability "Configuration"
        capability "Refresh"
        capability "Health Check"
        capability "Switch"

        command "childOn", ["string"]
        command "childOff", ["string"]

        // Zemi ZigBee Multi Switch
        fingerprint profileId: "0104", deviceId: "0002", inClusters: "0000, 0003, 0004, 0005, 0006", manufacturer: "Feibit Inc co.", model: "FB56+ZSW1GKJ2.5", deviceJoinName: "Zemi Zigbee Switch"
        fingerprint profileId: "0104", deviceId: "0002", inClusters: "0000, 0004, 0005, 0006", outClusters: "0000", manufacturer: "Feibit Inc co.", model: "FB56+ZSW1HKJ2.5", deviceJoinName: "Zemi Zigbee Switch 1"
        fingerprint profileId: "0104", deviceId: "0002", inClusters: "0000, 0003, 0004, 0005, 0006", manufacturer: "Feibit Inc co.", model: "FB56+ZSW1IKJ2.5", deviceJoinName: "Zemi Zigbee Switch 1"

        fingerprint profileId: "0104", deviceId: "0002", inClusters: "0000, 0003, 0004, 0005, 0006", manufacturer: "Feibit Inc co.", model: "FB56+ZSW1GKJ2.7", deviceJoinName: "Zemi Zigbee Switch"
        fingerprint profileId: "0104", deviceId: "0002", inClusters: "0000, 0004, 0005, 0006", outClusters: "0000", manufacturer: "Feibit Inc co.", model: "FB56+ZSW1HKJ2.7", deviceJoinName: "Zemi Zigbee Switch 1"
        fingerprint profileId: "0104", deviceId: "0002", inClusters: "0000, 0003, 0004, 0005, 0006", manufacturer: "Feibit Inc co.", model: "FB56+ZSW1IKJ2.7", deviceJoinName: "Zemi Zigbee Switch 1"

        fingerprint profileId: "C05E", deviceId: "0000", inClusters: "0000, 0003, 0004, 0005, 0006, 0008, 1000", outClusters: "0019", manufacturer: "FeiBit", model: "FNB56-ZSW01LX2.0", deviceJoinName: "Zemi Zigbee Switch"
        fingerprint profileId: "C05E", deviceId: "0000", inClusters: "0000, 0003, 0004, 0005, 0006, 0008, 1000", outClusters: "0019", manufacturer: "FeiBit", model: "FNB56-ZSW02LX2.0", deviceJoinName: "Zemi Zigbee Switch 1"
        fingerprint profileId: "C05E", deviceId: "0000", inClusters: "0000, 0003, 0004, 0005, 0006, 0008, 1000", outClusters: "0019", manufacturer: "FeiBit", model: "FNB56-ZSW03LX2.0", deviceJoinName: "Zemi Zigbee Switch 1"

        fingerprint profileId: "C05E", deviceId: "0000", inClusters: "0000, 0003, 0004, 0005, 0006, 0008, 1000", outClusters: "0019", manufacturer: "3A Smart Home DE", model: "LXN-1S27LX1.0", deviceJoinName: "Zemi Zigbee Switch"
        fingerprint profileId: "C05E", deviceId: "0000", inClusters: "0000, 0003, 0004, 0005, 0006, 0008, 1000", outClusters: "0019", manufacturer: "3A Smart Home DE", model: "LXN-2S27LX1.0", deviceJoinName: "Zemi Zigbee Switch 1"
        fingerprint profileId: "C05E", deviceId: "0000", inClusters: "0000, 0003, 0004, 0005, 0006, 0008, 1000", outClusters: "0019", manufacturer: "3A Smart Home DE", model: "LXN-3S27LX1.0", deviceJoinName: "Zemi Zigbee Switch 1"
    }

    preferences {
        input type: "paragraph", element: "paragraph", title: "Version", description: version(), displayDuringSetup: false
    }

    // simulator metadata
    simulator {
        // status messages
        status "on": "on/off: 1"
        status "off": "on/off: 0"

        // reply messages
        reply "zcl on-off on": "on/off: 1"
        reply "zcl on-off off": "on/off: 0"
    }

    tiles(scale: 2) {
        multiAttributeTile(name: "switch", type: "lighting", width: 6, height: 4, canChangeIcon: true) {
            tileAttribute("device.switch", key: "PRIMARY_CONTROL") {
                attributeState "on", label: '${name}', action: "switch.off", icon: "st.switches.light.on", backgroundColor: "#00A0DC", nextState: "turningOff"
                attributeState "off", label: '${name}', action: "switch.on", icon: "st.switches.light.off", backgroundColor: "#ffffff", nextState: "turningOn"
                attributeState "turningOn", label: '${name}', action: "switch.off", icon: "st.switches.light.on", backgroundColor: "#00A0DC", nextState: "turningOff"
                attributeState "turningOff", label: '${name}', action: "switch.on", icon: "st.switches.light.off", backgroundColor: "#ffffff", nextState: "turningOn"
            }
        }
        standardTile("refresh", "device.refresh", inactiveLabel: false, decoration: "flat", width: 2, height: 2) {
            state "default", label: "", action: "refresh.refresh", icon: "st.secondary.refresh"
        }
        main "switch"
        details(["switch", "refresh"])
    }
}

def isUnexpectedEndpoint(String model) {
    switch (model) {
        case 'FB56+ZSW1HKJ2.5':
        case 'FB56+ZSW1IKJ2.5':
        case 'FB56+ZSW1HKJ2.7':
        case 'FB56+ZSW1IKJ2.7': return true
        default               : return false
    }
}

def installed() {
    log.debug "installed()"
    def endpointCount = getEndpointCount()
    if (endpointCount == 1) {
        // for 1 gang switch - ST Official local dth
        setDeviceType("ZigBee Switch")
    } else if (endpointCount > 1) {
        def model = device.getDataValue("model")
        if (isUnexpectedEndpoint(model)) {
            device.updateDataValue("endpointId", "10")
        }
        // for multi switch, cloud device
        createChildDevices()
    }
    updateDataValue("onOff", "catchall")
    refresh()
}

def updated() {
    log.debug "updated()"
    updateDataValue("onOff", "catchall")
    refresh()
}

def parse(String description) {
    Map eventMap = zigbee.getEvent(description)
    Map eventDescMap = zigbee.parseDescriptionAsMap(description)

    if (!eventMap && eventDescMap) {
        eventMap = [:]
        if (eventDescMap?.clusterId == zigbee.ONOFF_CLUSTER) {
            eventMap[name] = "switch"
            eventMap[value] = eventDescMap?.value
        }
    }

    if (eventMap) {
        def endpointId = device.getDataValue("endpointId")
        log.debug "eventMap $eventMap | eventDescMap $eventDescMap"

        if (eventDescMap?.sourceEndpoint == endpointId) {
            log.debug "parse - sendEvent parent $eventDescMap.sourceEndpoint"
            sendEvent(eventMap)
        } else {
            log.debug "parse - sendEvent child  $eventDescMap.sourceEndpoint"
            def childDevice = childDevices.find {
                it.deviceNetworkId == "$device.deviceNetworkId:${eventDescMap.sourceEndpoint}"
            }
            if (childDevice) {
                childDevice.sendEvent(eventMap)
            } else {
                log.debug "Child device: $device.deviceNetworkId:${eventDescMap.sourceEndpoint} was not found"
                def parentEndpointInt = zigbee.convertHexToInt(endpointId)
                def childEndpointInt = zigbee.convertHexToInt(eventDescMap?.sourceEndpoint)
                def childEndpointHexString = zigbee.convertToHexString(childEndpointInt, 2).toUpperCase()
                def deviceLabel = "${device.displayName[0..-2]}"
                def deviceIndex = Math.abs(childEndpointInt - parentEndpointInt) + 1
                createChildDevice("$deviceLabel$deviceIndex", childEndpointHexString)
            }
        }
    }
}

private getEndpointCount() {
    def model = device.getDataValue("model")

    switch (model) {
        case 'FNB56-ZSW01LX2.0' : return 1
        case 'FNB56-ZSW02LX2.0' : return 2
        case 'FNB56-ZSW03LX2.0' : return 3
        case 'FB56+ZSW1GKJ2.5'  : return 1
        case 'FB56+ZSW1HKJ2.5'  : return 2
        case 'FB56+ZSW1IKJ2.5'  : return 3
        case 'FB56+ZSW1GKJ2.7'  : return 1
        case 'FB56+ZSW1HKJ2.7'  : return 2
        case 'FB56+ZSW1IKJ2.7'  : return 3
        case 'LXN-1S27LX1.0'    : return 1
        case 'LXN-2S27LX1.0'    : return 2
        case 'LXN-3S27LX1.0'    : return 3
        default                 : return 0
    }
}

private void createChildDevices() {
    log.debug("createChildDevices of $device.deviceNetworkId")
    def endpointCount = getEndpointCount()
    def endpointId = device.getDataValue("endpointId")
    def endpointInt = zigbee.convertHexToInt(endpointId)
    def deviceLabel = "${device.displayName[0..-2]}"

    for (i in 1..endpointCount - 1) {
        def endpointHexString = zigbee.convertToHexString(endpointInt + i, 2).toUpperCase()
        createChildDevice("$deviceLabel${i + 1}", endpointHexString)
    }
}

private void createChildDevice(String deviceLabel, String endpointHexString) {
    def childDevice = childDevices.find {
        it.deviceNetworkId == "$device.deviceNetworkId:$endpointHexString"
    }
    if (!childDevice) {
        log.debug("Need to createChildDevice: $device.deviceNetworkId:$endpointHexString")
        addChildDevice("smartthings", "Child Switch Health", "$device.deviceNetworkId:$endpointHexString", device.hubId,
                       [completedSetup: true, label: deviceLabel, isComponent: false])
    } else {
        log.debug("createChildDevice: SKIP - $device.deviceNetworkId:${endpointHexString}")
    }
}

private getChildEndpoint(String dni) {
    dni.split(":")[-1] as String
}

def on() {
    log.debug("on")
    zigbee.on()
}

def off() {
    log.debug("off")
    zigbee.off()
}

def childOn(String dni) {
    log.debug("child on ${dni}")
    def childEndpoint = getChildEndpoint(dni)
    def endpointInt = zigbee.convertHexToInt(childEndpoint)
    zigbee.command(zigbee.ONOFF_CLUSTER, 0x01, "", [destEndpoint: endpointInt])
}

def childOff(String dni) {
    log.debug("child off ${dni}")
    def childEndpoint = getChildEndpoint(dni)
    def endpointInt = zigbee.convertHexToInt(childEndpoint)
    zigbee.command(zigbee.ONOFF_CLUSTER, 0x00, "", [destEndpoint: endpointInt])
}

/**
 * PING is used by Device-Watch in attempt to reach the Device
 * */
def ping() {
    return refresh()
}

def refresh() {
    def cmds = zigbee.onOffRefresh()
    def endpointCount = getEndpointCount()

    if (endpointCount > 1) {
        def endpointId = device.getDataValue("endpointId")
        def endpointInt = zigbee.convertHexToInt(endpointId)

        for (i in 1..endpointCount - 1) {
            cmds += zigbee.readAttribute(zigbee.ONOFF_CLUSTER, 0x0000, [destEndpoint: endpointInt + i])
        }
    } else {
        cmds += zigbee.readAttribute(zigbee.ONOFF_CLUSTER, 0x0000, [destEndpoint: 0xFF])
    }

    return cmds
}

def poll() {
    refresh()
}

def healthPoll() {
    log.debug "healthPoll()"
    def cmds = refresh()
    cmds.each { sendHubCommand(new physicalgraph.device.HubAction(it)) }
}

def configureHealthCheck() {
    Integer hcIntervalMinutes = 12
    if (!state.hasConfiguredHealthCheck) {
        log.debug "Configuring Health Check, Reporting"
        unschedule("healthPoll")
        runEvery5Minutes("healthPoll")
        def healthEvent = [name: "checkInterval", value: hcIntervalMinutes * 60, displayed: false, data: [protocol: "zigbee", hubHardwareId: device.hub.hardwareID]]
        // Device-Watch allows 2 check-in misses from device
        sendEvent(healthEvent)
        childDevices.each {
            it.sendEvent(healthEvent)
        }
        state.hasConfiguredHealthCheck = true
    }
}

def configure() {
    log.debug "configure()"
    configureHealthCheck()

    //other devices supported by this DTH in the future
    def cmds = zigbee.onOffConfig(0, 120)
    def endpointCount = getEndpointCount()

    if (endpointCount > 1) {
        def endpointId = device.getDataValue("endpointId")
        def endpointInt = zigbee.convertHexToInt(endpointId)

        for (i in 1..endpointCount - 1) {
            cmds += zigbee.configureReporting(zigbee.ONOFF_CLUSTER, 0x0000, 0x10, 0, 120, null, [destEndpoint: endpointInt + i])
        }
    } else {
        cmds += zigbee.configureReporting(zigbee.ONOFF_CLUSTER, 0x0000, 0x10, 0, 120, null, [destEndpoint: 0xFF])
    }
    cmds += refresh()
    return cmds
}