Cooper 5 scenes

Cooper Aspire. Controller of scenes. He work very in smartthings with SAAINS drivers.

I spoke with SAINS github for its drivers. I asked him if he knew hubitat and if he intended to migrate his drivers. Not for now but he's not against someone trying to adapt his code to Hubitat. Here is the link for his code.

SAAINS Cooper

I have many of these switches and that would be very appreciated if someone could adapt it.

1 Like

I managed to convert the drivers. But I fail to include the device in Hubitat.

The device is excluded. I try to include it in smartthings and it works. I exclude it, I try with Hubitat it does not work. I start with smartthings and it works. So my device is really exclusive and ready for inclusion.

I experienced the same thing with Samsung Connect. The Cooper 5 button is possible to include in Smartthings but impossible in the new HomeConnect.

This is command class for this Device.

So youre saying this device will not pair to Hubitat even as a device?

Exactly. it does not add to Hubitat. I thought too that it would be added and after I would try with different drivers to make it work. But no. discover device runs continuously and detects nothing. I stop Hubitat's discovery mode and start the smartthings discovery mode and it instantly detects it.

I already talked about my problem with the technical support of Smartthings. I asked them why this device was running SmartthingsHUB V2 and not the new HomeConnect HUB. They told me that the new Hub did not support this type of devices. When my Cooper came out of the box and had never been included in any Hub, I managed to include them in HomeConnect. The technical support told me it was impossible. Yet I managed to add 5. When I excluded them and I wanted them back. I never succeeded. I would have liked to have a new one that has never been included to do the same test with Hubitat but I do not have any more.

One reason Hubitat won't discover a device is that it is still associated with another controller.
Have you tried a factory reset on the device?

  1. Press and hold the scene 1, 3 and 5 buttons at the same time for 5 seconds. Do not press any other scene controller buttons at this time. Release buttons 1,3 and 5.

  2. While in this state now press and release the 'All OFF' button. A successful reset of the RFWDC will be indicated on the device by continuous blinking of all 5 LED's.

I thought the same when I had trouble connecting them to HomeConnect. I did the factory reset several times. The Cooper when they are no longer included in any Hub. Lights turn on from 1 to 5 continuously until they are associated with a Hub. I will try tonight a tip from someone who has had the same problem. Factory reset five or six times until he returns. I'll give you news soon.

I managed to add it. But the way to successfully add it is not standard.

While the Cooper was trying to associate, I activated the z-wave repair. My cooper to stop flashing. At the bottom of the z-wave repair list, my device was there and it was written at the end of DISCOVER. I press it and my device is now adding.

I added the driver that I migrated from smartthings and it works perfectly. Same as the configuration is much simpler than in smartthings. This device allows you to control multiple devices on the same button. Ex. Button 1: light 1 30%, light 2, 90%, light 3 60%, switch 1 ON. When you activate the switch, the lights will go to the chosen level and maintaining it, the scene will vary keeping the ratio of each light and without HUB.

Drivers Cooper Scene Controller 5 button (RFWC5)
https://pastebin.com/jykvhdjU

Hi @tjeannot44 and other members.....

Im new to Hubitat and its experience. I have been using veraedge for years but switching all of my devices over, one at a time..... I have total 6 Cooper 5 scenes button keypads, about 30 switches including few dimmers and roller shades. Hoping you can please assist me setting one of my cooper 5 scenes keypad with certain scenes so that i can get all others to work with my hubitat. I have managed to installed the drivers as mentioned about on your post but beside that i cannot seems to configure my cooper 5 scene keypad/its button to control any scenes/lights. Not sure what i have done wrong here, perhaps not too sure if i have setup my scenes correctly. If you could please assist me with my keypad/5 button setup that would be greatly appreciated.

Thanks in advance!

when I wrote this device, HUBITAT did not support the "SENDHUBCOMMAND" yet. I am sending you today the new Handler that I modified after he added the "SENDHUBCOMMAND".

As for the association, use your Vera to exclude the COOPER and make sure that it is ready for inclusion in HUBITAT.

Thank you for your reply @tjeannot44.

I have already excluded the cooper 5 button switch with Vera and have successfully added to HE with your original device handler. Thatโ€™s the furthest I went, couldnโ€™t configure to work itโ€™s buttons with any GE/Jessco switch or scenes. Send me the new modifier as request, perhaps some short steps to get these 5 buttons enabled that would be greatly appreciated!

Cheers,

/**

  • Copyright 2015 SmartThings
    *https://graph-na02-useast1.api.smartthings.com/ide/device/editor/93342121-e596-4896-ac33-49d9553cfee6#
  • 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.
  • Version .14 Added Indicator control commands
  • Version .15 Updated Instructions
  • Version .16 Changed levels from 0-100 to 0-99
  • Version .17 Changed indicator attributes from "On" and "Off" to "on" and "off" to consistent with a switch
  • Version .18 Added all indicator set command
  • Version .19 Added buttonpush state to prevent indicator set and toggle commands from triggering a button event.

*/
metadata {
definition (name: "Cooper Aspire Scene Controller RFWC5 RFWC5D", namespace: "saains", author: "Scott Ainsworth") {
capability "Actuator"
capability "PushableButton"
capability "Configuration"
capability "Sensor"
//capability "Switch"
//capability "switchLevel"

    command "IndToggle"
    command "Indicator1Toggle"
    command "Indicator2Toggle"
    command "Indicator3Toggle"
    command "Indicator4Toggle"
    command "Indicator5Toggle"
    command "IndicatorSet" , ["number", "number"] //Inumber, OnorOff
    command "IndicatorAllSet", ["number"] //IndValue
    command "CheckIndicators" //use to poll the indicator status
    command "initialize"

   
    attribute "currentButton", "STRING"
    attribute "numberOfButtons", "number"
    attribute "Indicator1", "enum",  ["on", "off"]
    attribute "Indicator2", "enum",  ["on", "off"]
    attribute "Indicator3","enum",  ["on", "off"]
    attribute "Indicator4","enum",  ["on", "off"]
    attribute "Indicator5","enum",  ["on", "off"]
    attribute "IndDisplay", "STRING"
   
    // zw:L type:0202 mfr:001A prod:574D model:0000 ver:1.13 zwv:2.78 lib:01 cc:87,77,86,22,2D,85,72,21,70
    //Controller Replication-21;
    //Application Status-22;
    //Switch Multilevel 0x26
    //Scene Controller Conf-2D;
    //Scene Activation-2B
    //Configuration-70;
    //Manufacturer Specific-72;
    //Node Naming-77;
    //Association-85;
    //Version-86;
    //indicator-87;
    // Hail-82????????
   
   
    fingerprint type: "0202", mfr: "001A", prod: "574D", model: "0000",  cc:"87,77,86,22,2D,85,72,21,70"
}

preferences {
            input (
            type: "paragraph",
            element: "paragraph",
            title: "Configure Scenes",
            description: "The Cooper controller can control devices via scenes and/or via association.  Scene capable devices are those which report 2B,2C in the Raw Description. Scene capable devices must have scenes locally configured. Scenes 251-255 are reserved to configure buttons not assigned another scene#. Entries for associated devices must be followed by a level setting. On off devices use 0 or 255, dimable devices use 0 to 99. You must press the configure tile to activate the configuration.  It will take a few minutes complete"
        )
section {
    input "sceneNum1", "number", title: "Button 1 scene ID (1-250)", required: false
    input "dimdur1", "number", title: "Button 1 scene dimming duration (0-60) seconds", required: false
    input "sceneCap1", "text", title: "Button 1 Scene Capable Device IDs example (A3, 12, 25)", required: false
    input "assocCap1", "text", title: "Button 1 Devices via association, Device ID followed by level(0,1-99,255) example(03, 99, 0E, 255)", required: false}
section {
    input "sceneNum2", "number", title: "Button 2 scene ID (1-250)", required: false
    input "dimdur2", "number", title: "Button 2 scene dimming duration (0-60) seconds", required: false
    input "sceneCap2", "text", title: "Button 2 Scene Capable Devices example (A3,12, 25)", required: false
    input "assocCap2", "text", title: "Button 2 Devices via association, Device ID followed by level(0,1-99,255) example(03, 99, 0E, 255)", required: false}
section {
    input "sceneNum3", "number", title: "Button 3 scene ID (1-250)", required: false
    input "dimdur3", "number", title: "Button 3 scene dimming duration (0-60) seconds", required: false
    input "sceneCap3", "text", title: "Button 3 Scene Capable Devices example (A3, 12, 25)", required: false
    input "assocCap3", "text", title: "Button 3 Devices via association,Device ID followed by level(0,1-99,255) example(03, 99, 0E, 255)", required: false}
section {
    input "sceneNum4", "number", title: "Button 4 scene ID (1-250)", required: false
    input "dimdur4", "number", title: "Button 4 scene dimming duration (0-60) seconds", required: false
    input "sceneCap4", "text", title: "Button 4 Scene Capable Devices example (A3, 12, 25)", required: false
    input "assocCap4", "text", title: "Button 4 Devices via association, Device ID followed by level(0,1-99,255) example(03, 99, 0E, 255)", required: false}
section {
    input "sceneNum5", "number", title: "Button 5 scene ID (1-250)", required: false
    input "dimdur5", "number", title: "Button 5 scene dimming duration (0-60) seconds", required: false
    input "sceneCap5", "text", title: "Button 5 Scene Capable Devices example (A3, 12, 25)", required: false
    input "assocCap5", "text", title: "Button 5 Devices via association, Device ID followed by level(0,1-99,255) example(03, 99, 0E, 255)", required: false}
 }

simulator {

}

tiles (scale: 2){
    standardTile("Indicators", "device.IndDisplay", width: 6, height: 4) {
        state '${currentValue}',label:'${currentValue}', icon: "st.unknown.zwave.static-controller", backgroundColor:"#ffffff"
    }
    standardTile("configure", "device.configure",width: 6, height:2, inactiveLabel: false, decoration:"flat") {
        state "off", label:"Configure Scenes", action:"configure"
    }

    main "Indicators"
    details(["Indicators", "configure"])
}

}

def parse(String description) {
def result = null
def cmd = zwave.parse(description)
if (cmd) {
result = zwaveEvent(cmd)
log.debug "Parsed ${cmd} to ${result.inspect()}"
} else {
log.debug "Non-parsed event: ${description}"
}
result
}

def zwaveEvent(hubitat.zwave.commands.basicv1.BasicSet cmd) {
def result = []
def cmds = []
//result << createEvent(descriptionText: "${device.displayName} Button Action")
state.buttonpush = 1
cmds << response(zwave.indicatorV1.indicatorGet())
sendHubCommand(cmds)
//log.debug "$result"
result
}

def zwaveEvent(hubitat.zwave.commands.sceneactivationv1.SceneActivationSet cmd) {
def result = []
def cmds = []
//result << createEvent(descriptionText: "${device.displayName} Button Action")
state.buttonpush = 1
cmds << response(zwave.indicatorV1.indicatorGet())
sendHubCommand(cmds)
//log.debug "$result"
result
}

def zwaveEvent(hubitat.zwave.commands.indicatorv1.IndicatorReport cmd) {
def events = []
def event = []
def event2 =[]
def indval = 0
def onoff = 0
def priorOnoff = 0
def ino = 0
def ibit = 0
def istring = ""
indval = cmd.value
if(state.lastindval == indval &&(now() -state.repeatStart <2000 )){ // test to see if it is actually a change. The controller sends double commands by design.
//log.debug "skipping and repeat"
createEvent([:])
}
else{

istring = "IND " + Integer.toString(indval+128,2).reverse().take(5) // create a string to display for user
event = createEvent(name: "IndDisplay", value: "$istring", descriptionText: "Indicators: $istring", linkText: "device.label Indicators: $istring")
events << event

for (i in 0..4) {
    ibit = 2**i
    ino = i + 1
    onoff = indval & ibit
    priorOnoff = state.lastindval & ibit
    //log.debug "$ino is $onoff , piorOnoff is:$priorOnoff ibit is $ibit"
    if (onoff != priorOnoff){
    //log.debug "$ino first if true"
        if (onoff) { //log.debug "$ino second if true"
           event = createEvent(name: "Indicator$ino", value: "on", descriptionText: "$device.label Indicator:$ino on", linkText: "$device.label Indicator:$ino on")
        } else { //log.debug "$ino second if false"
            event = createEvent(name: "Indicator$ino", value: "off", descriptionText: "$device.label Indicator:$ino off", linkText: "$device.label Indicator:$ino off")
        }
    events << event
    if (state.buttonpush == 1){
        event2 = createEvent(name:"button",value:"pushed",data:[buttonNumber: ino],descriptionText:"$device.displayName button $ino pushed",linkText:"$device.label Button:$ino pushed",isStateChange: true)
        events << event2
    }
    } //else { log.debug "$ino first if false"}
}
state.lastindval = indval
state.repeatStart = now()

events
}
}

def zwaveEvent(hubitat.zwave.Command cmd) {
def event = [isStateChange: true]
event.linkText = device.label ?: device.name
event.descriptionText = "Cooper $event.linkText: $cmd"
event
}

def configure() {
log.debug("executing configure hub id is: $zwaveHubNodeId")
def cmds = []

//the buttons on the controller will not work with out a scene load in.  Use 251-255 if no scene number is specified in the preferences
def s1 = 251
def s2 = 252
def s3 = 253
def s4 = 254
def s5 = 255


if (sceneNum1) s1 = sceneNum1
if (sceneNum2) s2 = sceneNum2
if (sceneNum3) s3 = sceneNum3
if (sceneNum4) s4 = sceneNum4
if (sceneNum5) s5 = sceneNum5

//will use 0 for dimming durations unless a value is entered
def d1 = 0x00
def d2 = 0x00
def d3 = 0x00
def d4 = 0x00
def d5 = 0x00


if (dimdur1) d1=dimdur1 else d1 = 0x00
if (dimdur2) d2=dimdur2 else d2 = 0x00
if (dimdur3) d3=dimdur3 else d3 = 0x00
if (dimdur4) d4=dimdur4 else d4 = 0x00
if (dimdur5) d5=dimdur5 else d5 = 0x00

//for each button group create a sub to run for each button
cmds += buttoncmds(1, s1, sceneCap1, assocCap1, d1)
cmds << zwave.associationV1.associationGet(groupingIdentifier:1).format()
cmds << zwave.sceneControllerConfV1.sceneControllerConfGet(groupId:1).format()
cmds += buttoncmds(2, s2, sceneCap2, assocCap2, d2)
cmds << zwave.associationV1.associationGet(groupingIdentifier:2).format()
cmds << zwave.sceneControllerConfV1.sceneControllerConfGet(groupId:2).format()
cmds += buttoncmds(3, s3, sceneCap3, assocCap3, d3)
cmds << zwave.associationV1.associationGet(groupingIdentifier:3).format()
cmds << zwave.sceneControllerConfV1.sceneControllerConfGet(groupId:3).format()
cmds += buttoncmds(4, s4, sceneCap4, assocCap4, d4)
cmds << zwave.associationV1.associationGet(groupingIdentifier:4).format()
cmds << zwave.sceneControllerConfV1.sceneControllerConfGet(groupId:4).format()
cmds += buttoncmds(5, s5, sceneCap5, assocCap5, d5)
cmds << zwave.associationV1.associationGet(groupingIdentifier:5).format()
cmds << zwave.sceneControllerConfV1.sceneControllerConfGet(groupId:5).format()

// send commands
log.debug "$cmds"
log.debug "Please Wait this can take a few minutes"
delayBetween(cmds,3500)
}

// Parse the user input and create commands to set up the controller -- called from config
def buttoncmds(btn, scene, scenelist, assoclist, dimdur)
{
def cmds = []
def lList = 0
def alist = []
def alists = []
def atlist = []
def amap = [level:0, anodes: []]

//log.debug "assoclist is:$assoclist"

//add clear associaton cmd to the list
cmds << zwave.associationV1.associationRemove(groupingIdentifier: btn, nodeId:[]).format()

// add the levels to the data structure.
if (assoclist) {
atlist = assoclist.tokenize(', ')
// log.debug "atlist is: $atlist"
lList = atlist.size()
for (int i = 1; i <= lList; i+=2) {
if(alist.every { it != atlist[i]}) { alist << atlist[i] } // if the value is not in alist then add it.
}
alist.each{amap = [level: it, anodes: []] //add the levels to the data structure
alists << amap //build the matrix
}

// fill the matrix with nodes ordered with levels log.debug "afterif alists:$alists i is:$i x is:$x"
for (int i = 1; i <= lList; i+=2) {
for (int x = 0; x < alist.size(); x++){
def bob = alists[x]
if (bob.level == atlist[i]) {bob.anodes << atlist[i-1]}
}
}
// log.debug "alists is now: $alists"
}
// for each list of ids
// <<create association set commands
// <<create configuration set commands
for (int i = 0; i <=alists.size(); i++){

def thisset = alists[i]
def nodestring = ""
def thislevel = [0x32]
//log.debug "alists $i is $thisset"
if (thisset){
    def alevel = thisset.level as int
    nodestring = thisset.anodes.join(", ")
    //log.debug "nodestring is: $nodestring"
    //log.debug "xxxx $thisset.level.value"f
    if (alevel <= 99 && alevel >= 0){          
        thislevel[0] = thisset.level as int
       
        }
    if (alevel == 255){
        thislevel[0] = thisset.level as int
        }
    //log.debug "thislevel $i is $thislevel"
    }
cmds << AssocNodes(nodestring,btn,0)
    log.debug "setting configuration commands for button:$btn Level:$thislevel"        
cmds << zwave.configurationV1.configurationSet(parameterNumber:btn, size:1, configurationValue: thislevel).format()
}

// <<scene set commands
// <<create association set commands for scenes

cmds << zwave.sceneControllerConfV1.sceneControllerConfSet(groupId:btn, sceneId:scene, dimmingDuration:dimdur).format()
log.debug "setting scene commands for button:$btn scene:$scene dimmingduration:$dimdur"
cmds << AssocNodes(scenelist, btn, 1)

return (cmds)
}

def Indicator1Toggle(){
IndToggle(1)
}
def Indicator2Toggle(){
IndToggle(2)
}
def Indicator3Toggle(){
IndToggle(3)
}
def Indicator4Toggle(){
IndToggle(4)
}
def Indicator5Toggle(){
IndToggle(5)
}

def IndToggle(Inumber){
def ibit = 2**(Inumber-1)
def Onoff = state.lastindval ^ ibit
state.buttonpush = 0 //upcoming indicatorGet command is not the result of a button press
delayBetween([
zwave.indicatorV1.indicatorSet(value: Onoff).format(),
zwave.indicatorV1.indicatorGet().format(),
],500)
}

// because of delay in getting state.lastindval delays of at least 1 second should be used between calling this command.
def IndicatorSet(Inumber, OnorOff){
def Onoff = 0
def ibit = 2**(Inumber-1)

if (Inumber >=1 && Inumber <=5){
if (OnorOff == "On" || OnorOff ==1){
Onoff = state.lastindval | ibit
//log.debug "this is $ibit Onoff on: $Onoff lastindval is: $state.lastindval"
} else {
Onoff = state.lastindval & ~ibit
//log.debug "this is $ibit Onoff off: $Onoff lastindval is: $state.lastindval"
}
state.buttonpush = 0 //upcoming indicatorGet command is not the result of a button press
delayBetween([
zwave.indicatorV1.indicatorSet(value: Onoff).format(),
zwave.indicatorV1.indicatorGet().format(),
],300)

} else {log.debug "$device.id Indidcator set out of range"}
}

def IndicatorAllSet(IndValue){

if (IndValue <=31){
state.buttonpush = 0 //upcoming indicatorGet command is not the result of a button press
delayBetween([
zwave.indicatorV1.indicatorSet(value: IndValue).format(),
zwave.indicatorV1.indicatorGet().format(),
],300)

} else {log.debug "$device.id Indidcator set out of range"}
}

def CheckIndicators(){
state.buttonpush = 0 //upcoming indicatorGet command is not the result of a button press
delayBetween([
zwave.indicatorV1.indicatorGet().format(),
],100)

}
def initialize() {
sendEvent(name: "numberOfButtons", value: 5)
state.lastindval = 0
}

def installed() {
initialize()
configure()
state.updatedLastRanAt = now()
}

def updated() {
if (!state.updatedLastRanAt || now() >= state.updatedLastRanAt + 5000) {
state.updatedLastRanAt = now()
log.debug "Executing 'updated'"

    initialize()

}
else {
    log.trace "updated(): Ran within last 5 seconds so skipping."
}

}

def AssocNodes(txtlist,group,hub) {

def List1
def List3 = []
def cmd = ""
if (txtlist){
List1 = txtlist.tokenize(', ')
List3 = List1.collect{Integer.parseInt(it,16)}
if (hub){
List3 << zwaveHubNodeId
}
}
else if (hub){
List3 = zwaveHubNodeId
}

log.debug "associating group for button:$group: $List3"

cmd = zwave.associationV1.associationSet(groupingIdentifier:group, nodeId:List3).format()

return (cmd)
}

// convert a hex string to integer
def integerhex(String v) {
if (v == null) {
return 0
}

return v.split(',').collect { Integer.parseInt(it, 16) }

}

Thank you again @tjeannot44 , I have installed your above new device handler and changed my cooper aspire type to new handler. Now what is the process to assign buttons to scenes or other switches to work via cooper 5 scenes keypad? really appreciate all you assistance getting me up and running with this keypad and im quite excited to get other keypads working via HE.

The Handler you have right now is to directly associate a button with a switch. If you associate the button with a dimmer, the Cooper will be able to dim them. You can create a scene directly in the 5 button. Once finished the Cooper can activate a scene and dim it without a HUB.

You must enter the z-wave address of the device ex. (2E) If there are several separate ones by a comma. ex. (2E, 5C, 34) If you want to create a scene, you have to enter the levels. A dimmer between 0-99 and a switch 0 or 255. ex. (2E, 44 5C, 255 34.99) When you finish, you have to press CONFIGURE and wait about a minute for the cooper to associate the buttons.

That's where i get stumped, i cant figure out these addresses, such as 2E, for example, see attached picture of one of my GE switch called "play room" and its #'s, & copper1 keypad commands. please help me figure out the required details as to how to extract these details and where to add them. such as "z-wave address of the device ex. (2E) If there are several separate ones by a comma. ex. (2E, 5C, 34) If you want to create a scene, you have to enter the levels. A dimmer between 0-99 and a switch 0 or 255. ex. (2E, 44 5C, 255 34.99)"





Could you please kindly assist me getting the above details please :pray: thank you

Read this tread.

He wrote the device handler, I only converted it. Everything is to explain. This device handler is made to run z-wave devices and only z-wave devices. The address to put is a z-wave address provided by the HUB.

Thank you so much @tjeannot44 for you help with this.... i have finally got it going....i had to reset/disconnect & reconnect power the switch after so many tries and then started all over again...and it worked the first time..... bingo..... I think i had sent way to many commands to configure and the switch stopped updating to new commands; therefore wasn't updating...

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.