SwiidInter Cord Switch (DTH in post 8)


(Chris Petzny) #1


most of my lighting at home is done with table lamps, so I was wondering if anyone has tried the SwiidInter Z-Wave cord switch (link below) with SmartThings? I know I could use the SmartThings Outlet, but I would like to retain manual control.


Swiid lamp switches
(Chrisb) #2

Never used it, but it should work. Z-wave will generally work without issue if it’s not any sort of fancy/odd device, and this looks like a pretty standard on/off item.

I like the idea too.


Love it. Certainly the path I would take if only such switch was available here in NA :rage:

(Beckwith) #4

It might need a custom device type to support the long press functionality.

(Chris Petzny) #5

So in order to connect this, do I first have to connect it to a Z-Wave controller, or can it be directly added to SmartThings?

Sorry, I’m a newbie…



Should connect to your hub. If your switch connects to the hub but cannot be fully controlled (i.e. long press) you may need to look for a custom device type which is basically code written by either ST or the members here. Until this is an issue, dont worry about it. Get the switch connected to your hub first by using your app “Market Place/Connect New Device” option.

(Chris Petzny) #7

So I finally got one of the cord switches and it kind of works in ST as a generic “Z-Wave Switch”. However, it does not report its current status by default. So if you switch it on using ST, then switch it off manually, ST still thinks it’s on. In order for the switch to report its status, it has to be set to Association Group 2. And in order to do that, I believe I need a custom device type.

I’m not much of a coder, so I would love it if someone here could have a go at writing a custom device type. I’d even be happy to sponsor the effort by supplying a switch to anyone willing to take it on.

There is some basic information on the manufacturer website.
The user manual: http://www.swiid.com/medias/documents/ZCS-User-s-manual-vBAT2-02.12.2014.pdf
Advanced settings: http://www.swiid.com/medias/documents/advanced-swiidinter.pdf

I have a bunch of table lamps that I would love to use these with, so it would really make my day if someone could help with this.


(Robin) #8

I had the same problem with the Swiid cord switch, you need to associate with group 2.

Try the following custom device handler which is my first ever attempt at Groovy, press the configure button when connected and status updates should come through without the Lutron patented tech.

I still want to figure out responding to the long press trigger but haven’t managed that yet… thinking along the lines of rule machine custom command but I’m stuck on getting long press through a switch instead of a button.

metadata {
	definition (name: "swiidinter Cord Switch with Association", namespace: "smartthings", author: "Robin Winbourne") {
		capability "Actuator"
		capability "Switch"
		capability "Polling"
		capability "Refresh"
		capability "Sensor"
        capability "Configuration"

command "configure"
		fingerprint inClusters: "0x25"

	// simulator metadata
	simulator {
		status "on":  "command: 2003, payload: FF"
		status "off": "command: 2003, payload: 00"

		// reply messages
		reply "2001FF,delay 100,2502": "command: 2503, payload: FF"
		reply "200100,delay 100,2502": "command: 2503, payload: 00"

	// tile definitions
	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.switch.on", backgroundColor: "#79b821"
				attributeState "off", label: '${name}', action: "switch.on", icon: "st.switches.switch.off", backgroundColor: "#ffffff"
		standardTile("refresh", "device.switch", width: 2, height: 2, inactiveLabel: false, decoration: "flat") {
			state "default", label:'', action:"refresh.refresh", icon:"st.secondary.refresh"
standardTile("configure", "device.configure", inactiveLabel: false, decoration: "flat", width: 2, height: 2) {
state "configure", label:'', action:"configure", icon:"st.secondary.configure"
		main "switch"

def parse(String description) {
	def result = null
	def cmd = zwave.parse(description, [0x20: 1, 0x70: 1])
	if (cmd) {
		result = createEvent(zwaveEvent(cmd))
	if (result?.name == 'hail' && hubFirmwareLessThan("000.011.00602")) {
		result = [result, response(zwave.basicV1.basicGet())]
		log.debug "Was hailed: requesting state update"
	} else {
		log.debug "Parse returned ${result?.descriptionText}"
	return result

def zwaveEvent(physicalgraph.zwave.commands.basicv1.BasicReport cmd) {
	[name: "switch", value: cmd.value ? "on" : "off", type: "physical"]

def zwaveEvent(physicalgraph.zwave.commands.basicv1.BasicSet cmd) {
	[name: "switch", value: cmd.value ? "on" : "off", type: "physical"]

def zwaveEvent(physicalgraph.zwave.commands.switchbinaryv1.SwitchBinaryReport cmd) {
	[name: "switch", value: cmd.value ? "on" : "off", type: "digital"]

def zwaveEvent(physicalgraph.zwave.commands.configurationv1.ConfigurationReport cmd) {
	def value = "when off"
	if (cmd.configurationValue[0] == 1) {value = "when on"}
	if (cmd.configurationValue[0] == 2) {value = "never"}
	[name: "indicatorStatus", value: value, display: false]

def zwaveEvent(physicalgraph.zwave.commands.hailv1.Hail cmd) {
	[name: "hail", value: "hail", descriptionText: "Switch button was pressed", displayed: false]

def zwaveEvent(physicalgraph.zwave.commands.manufacturerspecificv2.ManufacturerSpecificReport cmd) {
	if (state.manufacturer != cmd.manufacturerName) {
		updateDataValue("manufacturer", cmd.manufacturerName)

def zwaveEvent(physicalgraph.zwave.Command cmd) {
	// Handles all Z-Wave commands we aren't interested in

def on() {
		zwave.basicV1.basicSet(value: 0xFF).format(),

def off() {
		zwave.basicV1.basicSet(value: 0x00).format(),

def poll() {

def refresh() {

def invertSwitch(invert=true) {
	if (invert) {
		zwave.configurationV1.configurationSet(configurationValue: [1], parameterNumber: 4, size: 1).format()
	else {
		zwave.configurationV1.configurationSet(configurationValue: [0], parameterNumber: 4, size: 1).format()

def configure() {
                zwave.associationV2.associationSet(groupingIdentifier:2, nodeId:zwaveHubNodeId).format(), 

Smart Switch that updates it's status with ST quickly?
Hive with ST (UK)
(Chris Petzny) #9

Thank you, thank you, thank you!! This works a treat. I don’t really need the long press, but the status indication is essential. Of course, if you do get it to work, I’ll look forward to an updated device handler.



Thanks very much for this, I am very new to Smartthings but have invested in some Fibaro Universal Dimmer 2’s and some SwiidInter Cord Switch’s which seem perfect for my wife to continue using everything if required but so I can also play with home automation.

Just 1 question am I right in thinking I can just add my SwiidInter Cord Switch to the smart things then publish the code you have given in my device handles, make the switch use that code and everything will work perfectly with my SwiidInter Cord Switch?

The bit I don’t understand is talking about “Association Group 2” I cant work out how to change the association group, does the code you have give us do the association for me?

Is so sound ideal and really appreciate this!

(Robin) #11
  1. Add cord switch to Smartthings
  2. Go to the IDE, create new device handler (from code), paste my code, save and publish.
  3. Go to devices in IDE, set cord switch to use new code.
  4. View the device in the mobile app and then press the configure tile which will sort the association stuff for you to allow state reporting.


Thank You sounds simple enough, the cord switches should arrive middle of next week will get them wired in and sorted.

Really appreciate your help and code

(Robin) #13

They are not perfect btw… But best thing I could find for now though.

They make a very quiet but constant electrical hum, nothing to worry about (I emailed the manufacturer and got a reply with a detailed technical explanation) but it can be a little annoying if used on a bedside lamp (which never helps with wife approval).

Also, these cord switches are known to hang from time to time, for me that’s 1-2 times a month. Simply switching off and on at the wall instantly solves the hang so not really a biggie.

You made a great choice on the Fibaro 2’s… Really reliable devices and easy to install. Also loads of community support on this forum with device handlers etc.


Yeah they seem to be the only option that allows the wife to carry on using the light as normal but allows me to tinker hehe! If you find anything better in the future please let me know, the hum does worry me, the first ones are for side lamps in the living room but I also want to use some on the bed side lamps.

I cant think of another way do achieve this other than these for the bedside lamps.

Am I right in my thinking that the hum is only there when the lamps are set to on and the switches are silent when off?

The hanging doesn’t worry me if its very infrequent.

Yeah think I understand the Fibaro 2’s I will be using Hijar’s code hopefully this should work perfectly. I have also bought the bypass as I use LED’s around the entire house so thought it wise to avoid issues with small loads.

Any other devices you recommend that allow my home to go from a dumb device to a smart device? I like both the Fibaro’s and SwiidLinter’s as you wouldn’t really know the smart integration is there.

(Robin) #15

Wife acceptance is certainly key… Make sure that whatever you do, it can be controlled manually the old fashioned way. Just changing from toggle wall switches to momentary ones got me in hot water lol.

The hum is there for both on and off states I’m afraid… very quiet though. Personally I hardly notice it anymore and my wife has never noticed it (though if I pointed it out to her she would hear nothing else and would lay in bed all night worrying it was about to explode)

I actually don’t use the physical button on the cord switches anymore… For the bedside lamp I have a Remotec Scene Master mounted on the side of the bedside table and my dining table lamp is switched through motion / lux / time of day. I could just get rid of the cord switches and use wall warts, but no point changing it now.

Reccomend the following:

Remotec Scene Master
Fibaro universal sensor (I use for the doorbell)
Fibaro RGBW (I use for my decking lights)
Fibaro dual relay (switching anything that does not need dimming, i.e. Bathroom fans, magnetic locks etc.)
Fibaro motion sensor
Fibaro dimmer 2
Nest thermostat
Nest protect

I may seem a bit of a Fibaro fan (I am) but I strongly reccomend against getting the Fibaro ‘The Button’ unit… It sucks and fails to send half the button presses you make to the hub. If you want a battery powered button controller, the Remotec Scene Master is awesome and never misses a command.

And don’t be tempted by the Fibaro hub, it pales in comparison to the openness and functionality of Smartthings.

If you want a true smart home, make sure you use the CoRE smartapp by @ady624.


Thanks very much, the humming at all times does worry me (not from a point of view of blowing up but the annoyance level) but I will test it with my lamp in the living room first to see first hand. There is obviously more background noise in the living room but will give me a good idea.

I wont bring it up with the wife though if I can live with it and she doesn’t hear it I have learnt to not mention it hehe

Some great product will have a good look through them, I’m currently on with putting Logitech Harmony remotes in each room as I have a Roku 3 box linked to each TV so these work idea for having a single remote control everything on the TV but also have home automation buttons which is proving very handy. 1 remote to do everything in each room sort of thing.

Just out of interest if your wife wanted to get up in the night and put the bedside lamp on what would she use now? Old habits die hard and all that, I have to make sure any tinkering I do doesn’t actually make turning lights on for her more difficult it really isn’t worth the ear ache hehe

Yeah the Fibaro product seem great for the UK market, I am thinking of setting up something in the porch which uses ambient light and motion to turn on the porch light, like a security light for inside the house but I only want it to come on when its dark enough to do so, would seem daft to come on, on a nice day just because is senses someone in the porch.

I chose the smartthings hub because of the integration with the Logitech Harmony and seems a wise move as the development for it on here is fantastic if it doesn’t officially support smartthings someone seems to have made sure it will work 1 way or another! Not really read about CoRE smartapp, but will do some research now.

Cant wait for my For my Fibaro dimmer and switch to turn up tomorrow so I can have a tinker when I get home from work

(Robin) #17

She sometimes fumbles for the cord switch but normally just presses button 1 on the Remotec Scene Master.

I run a vinyl printer / cutter at work so, to help her remember which button does what, I have made square stickers for each button with pictures of the corresponding light fittings.

She also uses the Smartthings widget on iOS when she’s feeling particularly daring!!

What really drives her mad is Thursday nights. If the bins haven’t been put out the bedside lamp refuses to turn off!! (Presence sensors in waterproof bags stuck to each bin)

For your porch, just use a Fibaro Motion sensor combined with the standard smart lighting app. Set it up to only work between 30min before sunset through to 30min after sunrise. Lux settings are useable but takes a lot of trial and error to get right.

Happy tinkering!!


Yeah not sure so my Mrs is really going to take to getting her phone out to turn the bedside lamp on or picking up a remote but we will see…

My SwiidInter Cord Switch arrived today so I have just finished remove the old in-line switch and replaced, installed with Smartthings, then attached your code and its working beautifully works on and off by the button but also by Smartthings and updates perfectly so when it in manually turned on Smartthings can see that it has been pressed. Great Job! Also I have added the Smartthings to my Logitech Harmony remote so now from my TV remote I can turn the light on and off, once I have all the lights in each room linked to the TV remote that belongs in the room it will be very handy… and I will be broke!

I can hear the buzz but its pretty minimal, will test it over the next few night by swapping my bedside lamp with this one and see if I notice it, my tinnitus is far worse than the buzz anyway!

Haha great idea on the bins! I’m in a good routine of putting them out though. Do the bin lorries not smash the sensor though when they lift them up?

Will probably invest in a Fabio Motion sensor for the porch, would you recommend this over the Smartthings one?

I have a baby on way and all the nursery stuff just arrived today so next couple of nights will be dedicated to building that (only 7 weeks to go!) but hopefully I will get a spare hour or 2 on the weekend to install the Fabio Dimmer, I did most of the hard work for it this weekend, separating a 3 gang switch in 2 separate switches so I would have some room to install the dimmer, so everything is there and ready to just install the dimmer in the switch box, drop the ceiling light and install the bypass then get it setup and running hopefully!

Thanks again for the help and your code is superb, did you ever get anywhere with tinkering with the long press on these cord switches? Would be quite nice to be able to set a long press on my bedside light to turn off say the lights downstairs if I have left one on or something.

(Robin) #19

No joy on the long press… Gave up on that ages ago :frowning:

Wife is happy using the remotec scene master. It’s more similar to a wall switch than a remote. I have it mounted next to the bedside light with a picture of the lamp stuck on button 1… She can’t go wrong.

She is also getting used to a cheap tablet I have mounted on the wall by the front door. It’s running the Smart Tiles app so is fairly intuitive for her to use.

She would never fire up the Smartthings app to switch a light however, but sometimes she uses the iOS widget to run a routine of set the thermostat.

My 3 year old daughter however loves the ST app lol… Especially the RGB decking lights!!

I always forget to take the bins out and they collect at 5am so never any time to remember in the morning. I placed the presence sensors in waterproof bags, glued into a recess on the underside of each bin. That way they are away from the mechanics of the bin compactor. I also solvent glued a rigid plastic plate over each sensor just in case the bin gets dumped on a raised stone or something.

I have both the Smartthings and Fibaro motion units… I upgraded to the Fibaro as it has adjustable sensitivity parameters to avoid false triggers. The Smartthings sensor has a habit of detecting ghosts and spiders… Not too bad if just switching a light but a pain in the butt when it sets off the SHM.

I wouldnt mess about splitting multiple switches into multiple back boxes just to make room for the Fibaro dimmers. If you have hollow stud walls just hang them on longer wires behind the back box (electrically compliant so long as it’s still accessible and to be double safe I placed them in small junction boxes to avoid the risk of wires touching the metal studs). Otherwise just install them in the ceiling.

Good luck with the little one, if you don’t get things installed before the birth you’ll be waiting at least a year… Work, work, work, sleep (not much), work, cry, work!


Ah well the long press would have been an absolute treat, real shame that as I like the idea of pressing something to shut down all light in the house before bed just in case. Maybe I will invest in 1 of those battery powered switches for the side of my bedside table or something

Managed to get both the Swiid Cord Switch and Fibaro Dimmer switches installed and working perfectly for me now, my LED bulbs are not dimmable so just have them as off on switches at the moment, took quite a bit of tinkering with settings to get the dimmer performing correctly but I have the settings perfect from the living room light now.

I have seen quite a few people using tablets, how are you powering the tablet just got a power supply plugged in and hidden away somewhere?

Sounds like the Fibaro is a far superior motion sensor and worth the few quid more over the Smartthings then.

Yeah when I get stuck in splitting the switches last week I did think about just hiding the Fibaro out of the switch box but I was too deep and into it by then, this way does also give me the option to put a dimmer on all 3 lights now so I can have 2 more dimmer outside the switch boxes in the future.

Thanks excited and nervous at the same time which I am sure is just the same as every expecting parent for the first time. Finished the nursery over the last couple of nights so almost ready for her now, need to get a few more dimmers bought and wired in though if I want to my little project done you are right as I’m about to have zero time and a lot of tiredness!