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

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?

Most of the core experts hang out in the core peer assistance thread. :sunglasses: If you ask your question there, they’ll be happy to help.

1 Like

If he is just using the cooper rf9500 it might be better to use Toggimmer as it will be faster response than CoRE.

1 Like

Yes, I’m only using the RF9500.

ST patched the Android app. I was unable to use CoRE or Toggimmer. I’ll give it a try tomorrow.

@whoismoses can you explain why Toggimmer would be faster?

Toggimmer does one thing, CoRE does everything. In this particular case when you press a button and expect it to immediately turn on, even 200-400ms matters. Toggimmer is optimized in the sense that there is less lines of code to execute in order to turn the lights on and use dimming.

2 Likes

Thank you @whoismoses. I’d like to set the dimmer level to 100% when initially turned on. Any recommendations on how to do that?

I added it.setLevel(100) in the switchHandler but the previous state is still maintained.

Did you change this line to it.setLevel(100)?

Yes I did. It does turn on at 100% but the dimming level is off. It keeps the old dimming level. So if the switch was turned off at 50%, turning it back on goes to 100%, and then pressing down on the dimming button continues down from 50% (previous level).

Is there a way to dispatch levelHandler event to have it set to 100%?

Here is the sequence in the logs:

97c50e46-b1fe-4aba-bfd5-afc36fabea81  10:01:37 AM: debug TG -- End levelHandler(evt).
97c50e46-b1fe-4aba-bfd5-afc36fabea81  10:01:37 AM: debug TG -- End setDimmers(val)
97c50e46-b1fe-4aba-bfd5-afc36fabea81  10:01:37 AM: debug TG -- Begin getNextValue()
97c50e46-b1fe-4aba-bfd5-afc36fabea81  10:01:37 AM: debug TG -- Begin setDimmers(val)
97c50e46-b1fe-4aba-bfd5-afc36fabea81  10:01:37 AM: debug TG -- DOWN
97c50e46-b1fe-4aba-bfd5-afc36fabea81  10:01:37 AM: debug TG -- state.sw = 20.
97c50e46-b1fe-4aba-bfd5-afc36fabea81  10:01:37 AM: debug TG -- evt.value = 10.
97c50e46-b1fe-4aba-bfd5-afc36fabea81  10:01:37 AM: debug TG -- Begin levelHandler(evt).
97c50e46-b1fe-4aba-bfd5-afc36fabea81  10:01:32 AM: debug TG -- End switchHandler(evt).
97c50e46-b1fe-4aba-bfd5-afc36fabea81  10:01:32 AM: debug TG -- Current Level = 100.
97c50e46-b1fe-4aba-bfd5-afc36fabea81  10:01:32 AM: debug TG -- Kitchen Cabinets - Left -- Turned on.
97c50e46-b1fe-4aba-bfd5-afc36fabea81  10:01:32 AM: debug TG -- Begin switchHandler(evt).
97c50e46-b1fe-4aba-bfd5-afc36fabea81  10:01:18 AM: debug TG -- End levelHandler(evt).
97c50e46-b1fe-4aba-bfd5-afc36fabea81  10:01:18 AM: debug TG -- End setDimmers(val)
97c50e46-b1fe-4aba-bfd5-afc36fabea81  10:01:18 AM: debug TG -- Begin getNextValue()
97c50e46-b1fe-4aba-bfd5-afc36fabea81  10:01:18 AM: debug TG -- Begin setDimmers(val)
97c50e46-b1fe-4aba-bfd5-afc36fabea81  10:01:18 AM: debug TG -- DOWN
97c50e46-b1fe-4aba-bfd5-afc36fabea81  10:01:18 AM: debug TG -- state.sw = 30.
97c50e46-b1fe-4aba-bfd5-afc36fabea81  10:01:18 AM: debug TG -- evt.value = 20.
97c50e46-b1fe-4aba-bfd5-afc36fabea81  10:01:18 AM: debug TG -- Begin levelHandler(evt).

The problem is that there is logic in the levelHandler that maintains the virtual level…

This might work… Add this method to the Toggimmer app…

def levelUp(evt, theLight, theLevel) {
    log("Begin levelUp(evt...).", "DEBUG")
    
    log("evt.value = ${evt.value}.", "DEBUG")
    log("state.sw = ${state.sw[evt.displayName]}.", "DEBUG")
    log("UP", "DEBUG")
    state.sw[evt.displayName] = theLevel
    
    theLight.setLevel(theLevel)

    log("End levelUp(evt...).", "DEBUG")
}

Then replace the it.on() on the switcHandler

levelUp(evt, it, 100)

This might work, but it isn’t perfect.

Unfortunately, that did not work. Same outcome. The event value stays as-is but the level changes.

What ends up happening is:
state.sw = 100 //changed in the app
evt.value = 0 //looks like maintained by the switch events?

@whoismoses - Do you have a recommendation on how to keep the On/Off state between the dimmer and light synchronized? I find that if someone in my household uses Alexa to turn on the lights, the Cooper Switch is still in the off position. I can press the button on the Copper switch to toggle the on/off state but then in ST the states are not synchronized – one shows ON while the other shows OFF.

I don’t have this issue and you shouldn’t either. See the method below. When there is a switch event (on or off) it loops through the selected lights and toggles them. Can you post a screenshot of your settings for Toggimmer?

def switchHandler(evt) {
	log("Begin switchHandler(evt).", "DEBUG")
	lights.each { it->
    	if(it.currentValue("switch") == "on") {
        	it.off()
            log("${it.label} -- Turned off.", "DEBUG")
        } else {
        	it.on()
            log("${it.label} -- Turned on.", "DEBUG")
        }
    }
	log("End switchHandler(evt).", "DEBUG")
}

Here’s the screenshot:

I’m using your “Beast” device handler. I noticed that when I try to set level 100 in the app the Cooper Switch dim level in ST stays as-is. If it was set to 50% it stays at 50%. The only way I’m able to change the Cooper Switch dim level is using the physical dim buttons on the switch.

@whoismoses Could it be the device handler? If I try to move the dimming level in ST app for Cooper Switch it doesn’t change. Wondering if that’s normal.

The device handler for the cooper switch isn’t really meant to be used in the app. I could take a look at it this week.

The lights you have there, are they just lights (LIFX, HUE) or are they really smart wall dimmers.

1 Like

Thanks. I’m using Osram Lightify LED strip lights which are dimmable in ST app.