SmartenIT ZBWS3 [2014]

Not sure what to suggest at this point either. Change batteries in the switch and try again from scratch?

In case it is helpful to anyone, you’ll find the SmartApp below that I used with the 3-button contact switch to control selected devices.

/**
 *  3 Button Switch for Light and Plug Control
 *
 *  Copyright 2014 Seth Jansen
 *
 *  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.
 *
 */
definition(
    name: "3 Button Switch for Light and Plug Control",
    namespace: "",
    author: "Seth Jansen",
    description: "Turn on/off lights, plug-loads, or other events using a 3-button switch where...",
    category: "My Apps",
    iconUrl: "https://s3.amazonaws.com/smartapp-icons/Convenience/Cat-Convenience.png",
    iconX2Url: "https://s3.amazonaws.com/smartapp-icons/Convenience/Cat-Convenience@2x.png",
    iconX3Url: "https://s3.amazonaws.com/smartapp-icons/Convenience/Cat-Convenience@2x.png")


preferences {
    section ("Select your 3-button switch") {
		input "contact1", "capability.contactSensor"
	}
	section ("Select loads for each button to turn on/off") {
		input "switch1", "capability.switch", title: "Button 1:"
        input "switch2", "capability.switch", title: "Button 2:"
        input "switch3", "capability.switch", title: "Button 3:"
	}
}

def installed() {
	log.debug "Installed with settings: ${settings}"

	initialize()
}

def updated() {
	log.debug "Updated with settings: ${settings}"

	unsubscribe()
	initialize()
}

def initialize() {
	subscribe(contact1, "contact", contactChangeHandler)
	subscribe(contact1, "contact2", contactChangeHandler)
    subscribe(contact1, "contact3", contactChangeHandler)
}

def contactChangeHandler(evt) {
    log.debug "$evt.name"
	log.debug "$evt.value"
    
    def switchState = switch1.currentValue('switch')
    
    log.debug "$switchState"
      
    if (evt.name == "contact") {
		if (switch1.currentValue('switch') == "off") {
			switch1.on()
		} else if (switch1.currentValue('switch') == "on") {
			switch1.off()
		}
    } else if (evt.name == "contact2") {
        if (switch2.currentValue('switch') == "off") {
			switch2.on()
		} else if (switch2.currentValue('switch') == "on") {
			switch2.off()
		}
    } else if (evt.name == "contact3") {
        if (switch3.currentValue('switch') == "off") {
			switch3.on()
		} else if (switch3.currentValue('switch') == "on") {
			switch3.off()
		}
    }  
}
3 Likes

Thanks for the code. I still cants get the switch to change status in my app.

Can this also be used to issue Hello Home commands? I would like to use this to change modes (Party, Movie, etc).

@brianlees, the code I’ve posted above could be relatively easily modified to change modes, I think. You would want to replace the switch.on() and switch.off() commands with mode changes. If you need an example, the Bon Voyage example app has some mode change syntax here: http://docs.smartthings.com/en/latest/smartapp-developers-guide/example-bon-voyage.html

Good luck.

I made some modifications to the original code to use the standard Button Controller SmartApp (and to be used with any button SA in the future).

You should be able to install the following Device Type code, assign it, and use “Button Controller” to configure your buttons (search within SmartSetup in mobile app).

 *  3 Button Remote Zigbee ZBWS3  
 *
 *  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.
 *
 *  Thanks to Seth Jansen @sjansen for original contributions
 */
metadata {
    definition (name: "3 Button Remote (ZBWS3)", namespace: "thegilbertchan", author: "Gilbert Chan") {
        capability "Button"
        capability "Configuration"
                
        attribute "button2","ENUM",["released","pressed"]
        attribute "button3","ENUM",["released","pressed"]        

        fingerprint endpointId: "03", profileId: "0104", deviceId: "0000", deviceVersion: "00", inClusters: "03 0000 0003 0007", outClusters: "01 0006"
    
    }
    // Contributors

    // simulator metadata
    simulator {
    }

    // UI tile definitions
    tiles {
        
        standardTile("button1", "device.button", width: 1, height: 1) {
            state("released", label:'${name}', icon:"st.button.button.released", backgroundColor:"#ffa81e")
            state("pressed", label:'${name}', icon:"st.button.button.pressed", backgroundColor:"#79b821")
        }
        
        standardTile("button2", "device.button2", width: 1, height: 1) {
            state("released", label:'${name}', icon:"st.button.button.released", backgroundColor:"#ffa81e")
            state("pressed", label:'${name}', icon:"st.button.button.pressed", backgroundColor:"#79b821")
        }        

        standardTile("button3", "device.button3", width: 1, height: 1) {
            state("released", label:'${name}', icon:"st.button.button.released", backgroundColor:"#ffa81e")
            state("pressed", label:'${name}', icon:"st.button.button.pressed", backgroundColor:"#79b821")
        }
        
    main (["button3", "button2", "button1"])
    details (["button3", "button2", "button1"])
    }
}

// Parse incoming device messages to generate events
def parse(String description) {
    log.debug "Parse description $description"
    def name = null
    def value = null              
    if (description?.startsWith("catchall: 0104 0006 01")) {
        name = "1"
        def currentST = device.currentState("button")?.value
        log.debug "Button 1 pushed"           
            
    } else if (description?.startsWith("catchall: 0104 0006 02")) {
        name = "2"
        def currentST = device.currentState("button2")?.value
        log.debug "Button 2 pushed"        

    } else if (description?.startsWith("catchall: 0104 0006 03")) {
        name = "3"
        def currentST = device.currentState("button3")?.value
        log.debug "Button 3 pushed"         
    } 

    def result = createEvent(name: "button", value: "pushed", data: [buttonNumber: name], descriptionText: "$device.displayName button $name was pushed", isStateChange: true)
    log.debug "Parse returned ${result?.descriptionText}"


    return result
}


def parseDescriptionAsMap(description) {
    (description - "read attr - ").split(",").inject([:]) { map, param ->
        def nameAndValue = param.split(":")
        map += [(nameAndValue[0].trim()):nameAndValue[1].trim()]
    }
}

private getFPoint(String FPointHex){                   // Parsh out hex string from Value: 4089999a
    Long i = Long.parseLong(FPointHex, 16)         // Convert Hex String to Long
    Float f = Float.intBitsToFloat(i.intValue())   // Convert IEEE 754 Single-Precison floating point
    log.debug "converted floating point value: ${f}"
    def result = f

    return result
}


// Commands to device

def configure() { 
    log.debug "Binding SEP 0x01 DEP 0x01 Cluster 0x0006 On/Off cluster to hub"         
        def configCmds = [

        "zdo bind 0x${device.deviceNetworkId} 0x01 0x01 0x0006 {${device.zigbeeId}} {}", "delay 500",
        "zdo bind 0x${device.deviceNetworkId} 0x02 0x01 0x0006 {${device.zigbeeId}} {}", "delay 500",        
        "zdo bind 0x${device.deviceNetworkId} 0x03 0x01 0x0006 {${device.zigbeeId}} {}", "delay 1500",        
        ]
    log.info "Sending ZigBee Bind commands to 3 Button Switch"
    return configCmds
    }
4 Likes

I would like to see if I can make my “PIN Code” SmartApp (in Beta) work with this 3-Button wall switch.

Anybody have one of these Wall Switches and want to help me debug / integrate? So far, my App works with the Aeon 4-Button Minimote and the Enerwave 7-Button…

Thanks!!!

I have a question for anyone using this switch. Can the double tap app be used with it? I was thinking that if double tap could be modified to set dimming levels then this switch could be used to dim tcp or ge link bulbs to a preset level.
Thanks.

@thegibertchan: It looks like the code you modified was the Device Type to give this device the capabilities of a Button instead of a Contact Switch? I was able to switch device types and use it with the Button Controller SmartApp. The delays between events were a little bit longer, perhaps because the Button Controller waits to see if a button is being held instead of just pushed? Also, your code should credit @JohnR since he wrote the Device Type. I just posted the code for turning items on/off based on the contact switch Device Type he wrote.

In the process of testing this new device type, with button capabilities, my buttons stopped working. I need to do more testing to determine why but for now I’m back to using it as a contact switch.

@ErnieG: I tested the double tap app and it did not appear to be working. However, that may be due to the issue I was having with the button Device Type and not that app in particular. I’ll let you know if I learn more on further testing.

@cassmie: I was forced to re-join the device to my network. I may have learned something that will help with your issue. I did a factory reset on the buttons as indicated in their instructions. I then rejoined the device and set the contact switch Device Type. I believe this is where you were stuck with seeing buttons but no actions as a result of pressing them. Try this:

Login to the IDE web interface > My Device Types > select the 3 Button Zigbee Toggle > in right column Set Location > pick the physical device that is your 3 button switch > Install > Select the configure button. I wasn’t seeing any responses on my buttons either until I pressed this button and it sent the Zigbee binding commands. Fingers crossed that this might resolve your issue!

2 Likes

@sjansen: that did the trick, needed to get bound. Thanks for your help.

I did try the button device type and seems to be working ok so far.

Can someone take a picture of this device in use? I would love to see what it looks like wall mounted. I’m very curious about the thickness. I would love to use this in our kitchen area to switch between different modes - as in Party Mode, Movie Mode, etc… I think it might meet the WAF.

Is the only option for 3 switches, is there a one switch version of this?

@brianlees: Mine isn’t wall mounted but I held it up for perspective.


|162.5x250

@swindmiller: only 3-button from this provider. I know of at least one manufacturer planning a 1-button in 2015.

2 Likes

Awesome!!! Great news, thanks!

@sjansen Thanks! That was very helpful. It looked really thick online. This is a much better perspective.

I’m having trouble even getting the device paired. Is there any secret to that process? I followed the instructions for the ZBWS3B: factory reset, then batteries in, add device in smartthings (iOS) app. The smartthings app never successfully finds the device. However, if I close it and reopen, i’m prompted to configure a new device.

Nothing shows up in the logs no matter what device type I set the ZBWS3B as. Any ideas?

Thanks.

EDIT:
I followed @sjansen’s guide above about installing the device type from the IDE and configuring the device which binds the device and that did the trick.

1 Like

Does anyone have this working to trigger Hello Home Actions, not just toggle end devices, using the button controller code from @thegibertchan ?

I’m thinking about buying one of those soon. It looks like the button controller app already includes the ability to assign hello home phrases to buttons, so it looks like it would work

The button controller app does include the scene management code, and that app works very well with the minimote. But it doesn’t work at all, for example, with the GE remotes unless they’re initialized by a different zwave controller first.

The reason is technical. In order for a button device (switch or remote) to be able to act as a secondary controller (which is what you need for it to handle Hello Home Actions), when the button device first joins the network it has to be told by the primary controller (the ST hub in this case) that it will be acting that way.

There is a specific standard sequence for this during initialization, but it appears that ST doesn’t use it. It appears that ST does this at a different point in the JOIN process. The minimote accepts that, but many switches and secondary controllers don’t.

So you end up with a switch that can toggle local devices on and off, but can’t use Hello Home Actions because it was never fully paired as a secondary controller.

Because the version 1 ST controller is not certified for use with either Zwave or zigbee, you can’t be sure that it will accept secondary controllers of either type, you just have to try each device and see. ST uses a subset of the open protocols for each standard, but you can’t tell just from looking at the app code if it will work as the end device may be implementing parts of the standard that ST does not.

I hope that will change by generation 3. The recent announcement of Dora Hsu’s hiring also said ST was going to make additional investments in certification, a good thing. :blush:

We should also note that the minimote, which does work with Hello Home Actions, Is a zwave device. The SmartenIt wall switch is zigbee. I have asked in two topics if anyone actually has the SmartenIt working as a secondary controller to implement Hello Home Actions, but have not received a response as yet. So if any does have it working for that, not just for toggling local zigbee end devices, please do let us know.

Also, Cooper Industries has a very similar battery powered wall switch called the Aspire, but that one is Zwave, not Zigbee. It might work like the minimote, or it might fail like the GE, I haven’t seen anyone report on it one way or the other yet.

1 Like

Maybe I’m missing something, but why does it need to be a secondary controller to toggle HH Actions? If I can toggle them using virtual buttons, shouldn’t you be able to do the same with a physical device with multiple real buttons?

2 Likes