SmartThings Community

Aspire Cooper RF9500 Device Type (basic DTH in post 6)

I completely forgot about exclude. Been doing too much ZigBee lately. While attempting to exclude, also keep pressing the button.

1 Like

Thanks for the help, guys. I’ll try the exclusion when I get home from work.

I think I have been pressing the buttons fast enough to keep it awake, even varying how fast I press them to see if it makes any difference (it doesn’t). As long as the LED stays lit or blinking, it should be awake, right?

I’ll also completely kill the ST app before my next attempt, just in case.

1 Like

Ok, make sure you do it in this order to be sure…

1 - Kill ST App
2 - Exclude, keep pressing the button.
3 - Kill ST App
4 - Pair, keep pressing the button.

If it doesn’t pair, try killing the app again and see if it shows up under devices to configure in marketplace.

1 Like

It worked! Seems exclusion did the trick. I’ll keep that in mind next time I have issues… thanks!

Now to get the in-wall relay working…

1 Like

Glad you got it working. I was going to reply to exclude it but forgot. A lot of my unofficially supported devices fail to pair, so i exclude them and add them in and it works.

Armand
–Sent from iPhone

Is there a way to add button hold and battery level to this device type? I tried to add battery with no luck, and can’t figure out how to add button hold events. I’m using this device with the Button Controller+ Smart App. Works, but I don’t have button hold functionality.

metadata {
	definition (name: "Cooper RF9500 (all buttons)", namespace: "thegilbertchan", author: "Gilbert Chan") {
		capability "Actuator"
		capability "Button"
		capability "Configuration"
		capability "Sensor"

		fingerprint deviceId: "0x1200", inClusters: "0x77 0x86 0x75 0x73 0x85 0x72 0xEF", outClusters: "0x26"
	}

	simulator {
		status "button 1 pushed":  "command: 2001, payload: 01"
		status "button 1 held":  "command: 2001, payload: 15"
		status "button 2 pushed":  "command: 2001, payload: 29"
		status "button 2 held":  "command: 2001, payload: 3D"
		status "button 3 pushed":  "command: 2001, payload: 51"
		status "button 3 held":  "command: 2001, payload: 65"
		status "button 4 pushed":  "command: 2001, payload: 79"
		status "button 4 held":  "command: 2001, payload: 8D"
		status "wakeup":  "command: 8407, payload: "
	}
	tiles {
		standardTile("button", "device.button", width: 2, height: 2) {
			state "default", label: "", icon: "st.unknown.zwave.remote-controller", backgroundColor: "#ffffff"
		}
		main "button"
		details(["button"])
	}
}

def parse(String description) {
	def results = []
	if (description.startsWith("Err")) {
	    results = createEvent(descriptionText:description, displayed:true)
	} else {
		def cmd = zwave.parse(description, [0x26: 1, 0x2B: 1, 0x80: 1, 0x84: 1])
		if(cmd) results += zwaveEvent(cmd)
		if(!results) results = [ descriptionText: cmd, displayed: false ]
	}
	log.debug("Parsed '$description' to $results")
	return results
}

def zwaveEvent(physicalgraph.zwave.commands.wakeupv1.WakeUpNotification cmd) {
	def results = [createEvent(descriptionText: "$device.displayName woke up", isStateChange: false)]

    results += configurationCmds().collect{ response(it) }
	results << response(zwave.wakeUpV1.wakeUpNoMoreInformation().format())

	return results
}

// A zwave command for a button press was received convert to button number
def zwaveEvent(physicalgraph.zwave.commands.switchmultilevelv1.SwitchMultilevelStartLevelChange cmd) {
	[ descriptionText: "startlevel $cmd"]
	log.info "startlevel $cmd"
	if (cmd.upDown == true) {
		Integer buttonid = 2
	    log.info "button $buttonid pressed"
		checkbuttonEvent(buttonid)
		}
	else if (cmd.upDown == false) {
		Integer buttonid = 3
    	log.info "button $buttonid pressed"
		checkbuttonEvent(buttonid)
	}
}

// The controller likes to repeat the command... ignore repeats
def checkbuttonEvent(buttonid){

	if (state.lastScene == buttonid && (state.repeatCount < 4) && (now() - state.repeatStart < 2000)) {
    	log.debug "Button ${buttonid} repeat ${state.repeatCount}x ${now()}"
        state.repeatCount = state.repeatCount + 1
        createEvent([:])
    }
    else {
    	// If the button was really pressed, store the new scene and handle the button press
        state.lastScene = buttonid
        state.lastLevel = 0
        state.repeatCount = 0
        state.repeatStart = now()

        buttonEvent(buttonid)
    }
}

// Handle a button being pressed
def buttonEvent(button) {
	button = button as Integer
	def result = []
    updateState("currentButton", "$button")   
        // update the device state, recording the button press
        result << createEvent(name: "button", value: "pushed", data: [buttonNumber: button], descriptionText: "$device.displayName button $button was pushed", isStateChange: true)
    result
}

def zwaveEvent(physicalgraph.zwave.commands.basicv1.BasicGet cmd) {
    [ descriptionText: "$cmd"]
    if(1){
		Integer buttonid = 1
        log.info "button $buttonid pressed"
		checkbuttonEvent(buttonid)
    }
}

def zwaveEvent(physicalgraph.zwave.commands.basicv1.BasicSet cmd) {
	[ descriptionText: "$cmd"]
    if(1){
		Integer buttonid = 1
        log.info "button $buttonid pressed"
		checkbuttonEvent(buttonid)
    }
}

def zwaveEvent(physicalgraph.zwave.commands.switchmultilevelv1.SwitchMultilevelStopLevelChange cmd) {
        createEvent([:])
}


def zwaveEvent(physicalgraph.zwave.Command cmd) {
	[ descriptionText: "$cmd"]
}

// Update State
def updateState(String name, String value) {
	state[name] = value
	device.updateDataValue(name, value)
}

From my testing of the zwave events it send the switch does not send hold. I wish it did for dimming.

I’ll take a look at adding battery.

1 Like

Need some help, added my rf9500 device handler. When I hit the buttons I can see in activity button 1 works, button 2 and 3 dim and brighten by 10% each press.

I got the on and off working with the ST smart lighting.

How do I get it to dim? Am I setting this up wrong?

I think Smart Lighting can only set a set level not variable. I do this kind of thing with CoRE. BTW - What kind of lights are you trying to dim or are you just updating another wired dimmer?

It’s a Hue bulb in a lamp. I know I could use a philips remote, but I want to setup some triggers also and the philips cannot do that.

Never looked at core…guess I need to

Want to try this?

I wrote this a few months back.

Awesome!!! that worked.

Only issue I see if fast clicking down will keep going till it hits like 10%, fast clicking up goes to 100% on the switch, but the light ends up anywhere from 30-75% bright.

Any idea why?

I might try a double press of button 1 to make the light 100%

I got used to slow dimming. I haven’t touched the code in a while. I’ll take a look at it soon.

Maybe this section could be changed to just be 25, 50, 75, 100 … 4 presses instead of 9??

switch(currentValue.toInteger()) {
case 100…80:
result = "100"
break
case 79…60:
result = "80"
break
case 59…40:
result = "60"
break
case 39…25:
result = "50"
break
case 24…20:
result = "40"
break
case 19…15:
result = "30"
break
case 14…10:
result = "20"
break
case 9…5:
result = "10"
break
case 4…0:
result = "5"
break

        default: 
        	result = "100"
    }

Yes you can change that.

Honestly I have my house so automated I rarely touch a switch. That said, I have 13 or so of these switches so I know I have to figure out why sometimes it goes to 100%. Just haven’t had time to debug.

Actually I had an outstanding pull request. I did some quick testing and the changes work, but I am not sure they solve the 100% issue. Also, still feel free to update the switch case. I’ll probably modify it at some point.

Here is what I changed, seems to work great for the times I tested it…If I have something wrong let me know …thanks again.

if(direction.toUpperCase() == “DOWN”) {
switch(currentValue.toInteger()) {
case 100…76:
result = "75"
break
case 75…51:
result = "50"
break
case 50…26:
result = "25"
break
case 25…11:
result = "10"
break
case 10…6:
result = "5"
break
case 5…0:
result = "0"
break

        default: 
        	result = "0"
    }
    return result
} else {
	switch(currentValue.toInteger()) {
    	case 100..75:
        	result = "100"
            break
        case 74..50:
        	result = "75"
            break
        case 49..25:
        	result = "50"
            break
        case 24..0:
        	result = "25"
            break
        
        default: 
        	result = "100"
    }

I just updated my code a bit, take a look in GitHub. A little different than yours. Yours will work also.

@mrsmartypants @whoismoses @JDRoberts - Can you guys help setup the device?

I received the device from Amazon today and did the following:

  1. Installed @whoismoses device handler ST-Cooper-RF9500-Beast (via Gihub repo)
  2. Added device to ST. Showed up as Z-Wave device

When I access the new device in ST and press any of the buttons ST app often crashes. What do I need to do to link the device to turn lights on and off?

What it looks like on the phone:

Update 1:

Incorrect device type was set. Fixed that and looks better. On to lighting rules…

Update 2:
On/Off is now working using smart light automation. I’d like to create a CoRE piston for dimming. Anyone have a sample rule?

Thanks!

1 Like

Are you only using the RF9500 for this automation?