[OBSOLETE] Cooper Aspire Scene Controller RFWC5 and RFWC5D Device Handler [beta release]

Definitely helps with the WAF…

@sainsworth - wanted to say thanks. Two days in your method works like a champ. I’ve actually got two triggers. The first if I hit the button itself, a piston polls the lights, does the math for the appropriate result and sets the indicators. THEN due to ‘input’ from my wife, I did the same exact thing you mentioned above and built a piston that has indicators respond to the state of the devices themselves because apparently she prefers telling Alexa to open the blinds but still wants to see the lights ‘work right’…

I’ve left both pistons intact even though they’re basically doing the same thing, because if you ‘click the button’ you get near instant feedback because of the button press event. If you update the indicators based on device action, I experience a delay of up to 2 minutes while the device states report back because I’m actually acting on the cascaded status of an aggregated virtual device.

@ZebraBlinds, Neal - FYI highly recommend this scene controller when you have multiple blinds in a set, and with Scott’'s DTH it works like it was built for them.

1 Like

You are so kind for explaining, I actually do use WebCore, having a hard time with variables though.
What I was actually referring to was a bit of explanation on the variables you used. I don’t undestrand exactly how it works, neither why on the first bulb you added +1 to the variable, but on the second +2 (and so forth for the other bulbs +4, +8, +16), and also why did you let the bulbs 1 and 2 separately, but you joined the switches on the same trigger.
Finally, how does all of it apply to the keypad with the IndicatorAllSet? (I’m assuming you are syncing all 5 buttons with this piston and not just one).
Thanks a lot

@el_Argen

This variable is an example of what is called a bitmask. it’s a good way to transfer a lot of information in a small package.

First Imagine each indicator as a binary value with 0 being off and 1 being on.
Then imagine all 5 indicators in a row of binary digits.

So to represent from indicator 1 to 5 on, off, off, on, on you would have the number 11001 (read from right to left)

In binary each position (again, from right to left) represents a value. The first is 1, second 2, third 4, fourth 8 (see the powers of 2 progression) etc. With this system you can represent any number with the correct amount of digits. This particular switch supports 5 positions, if all are on , we would represent it as 11111. Converted to decimal, that’s 31.

You can use a binary converter to do this OR, you can calculate the values yourself. If we are talking about switch #1, we determine on or off, then multiply that result by the value that the position represents if it were set to 1. So for position 3 (indicator 3), you determine on or off, then multiply by 4.

What that means is you can represent any combination of ons and offs by doing the math, adding the numbers and sending THAT number to the switch with the IndicatorAllSet() method.

So in our original example: on, off, off, on, on is 11001. The math to convert is:
Indicator 1: on = 1, therefore: 1 * [value of position 1, which is 1] = 1
Indicator 2: off = 0, therefore: 0 * [value of position 2, which is 2] = 0
Indicator 3: off = 0, therefore: 0 * [value of position 3, which is 4] = 0
Indicator 4: on = 1, therefore: 1 * [value of position 4, which is 8] = 8
Indicator 5: on = 1, therefore: 1 * [value of position 5, which is 16] = 16

Add them all up = 1+8+16=25

Send IndicatorAllSet(25) to the controller and it will set that indicator pattern, because it does the binary conversion in the device handler and sets itself accordingly.

I’m using multiplication to determine my numbers, Scott is doing the same thing with addition. Either works.

Make sense?

Nathan has an excellent explanation of the bit map. I think you question also eluded to the fact that button 3 has bulbs one and two on it. That is arbitrary and just happens to be the bulbs I set up to be controlled by that button. I actually I indent to change my setup for buttons 4 and 5 in the near future.

1 Like

Thanks, I’m getting into the variables now.
My only issues are that it takes some time for the indicatorallset to reflect, and that if I turn on or off a switch with the keypad directly via association, it appears that the system never finds out. Any fix (apart from pinging all devices every second)?

You can add a button push in the if statement to trigger on that as well.
I have a similar piston that works on A Cooper controller where I’ve set
buttons 5 to turn on all devices individually controlled with buttons 1-4.
When I push a button the piston checks each device and sets all indicators
correctly. This way I can push 5 to turn all on and then use the othe
buttons to individually turn off devices.

1 Like

Any chance someone had similar info for a Zigbee scene controller? I can only find Z-Wave examples :frowning:

You can likely only find Z-wave examples because these devices are exploiting function('s) implicit to the Z-Wave specification - Z-Wave associations and scenes. Before systems like Smartthings it was the way devices communicated with each other. Why does it have to be zigbee? There are a few zigbee button devices like the Philips and the Osram (or whatever they’re calling themselves now) but it sounds like these aren’t exactly what you are looking for.

Because I already have a Zigbee SC :slight_smile:

Sadly, I can only make it function as buttons. I’d really like control over each indicator led which I assume is coded in firmware to a scene being active.

Yeah, this stuff is very manufacturer specific. Scott’s work interpreting the features Cooper made available with this device and exposing them through his custom DTH is honestly amazing and just a little short of black magic. :slight_smile: You’ll have to research what the device exposes then go with that.

1 Like

Yes the indicators are coded in firmware and come on when a scene is activated (not necessarily that it is active). That said, you do have control thru the DH over each indicator. Commands are exposed to toggle each, set each, or set all indicators (with a bitmask). I’ve been doing this via WebCore and it works well. Because the cooper device is a bit slow the setallindicators command seems to be the best solution if you want set more than one within a few seconds.

About the only functionality that does not work thru ST is the button hold. There just does not seem to be a way to know which button was held.

1 Like

I have the opposite situation with my Zigbee device. I can easily distinguish pressed held released, but can’t directly access the indicators.

I’ve got Sengled Element Classic bulbs that are Zigbee devices. I control them through the Smartlighting App but I’ve noticed that button 1 has flipped. The automation tied to button 1 will activate when the LED is on and I press the button turning it off. The other four buttons operate as expected.

Alternatively, because these are Zigbee devices, not z-wave and thus cannot be controlled directly, is a Smart App (Smartlighting or WebCoRe) the most appropriate way to control them?

The DH really just tells smartthings that the button was pushed. I could see how you might get out of sync and be on when off and so forth. I’m guessing you can get them all out of sync if you activate them elsewhere.

You are correct that you must use an app of some sort in ST to control Zigbee devices. To solve your problem you should look for the button press. Then check the indicator status to determine if you activate or deactivate your device. I’m not sure Smart lighting will give you the flexibility to do that so WebCoRe may be the best path.

2 Likes

You’re right; Smartlighting doesn’t have the capability to check the status of the LED. I’ll be playing with WebCoRe tonight.

Is this snippet from my piston the correct way to get WebCoRe to control my Zigbee lamps from the RFWC5? I’m not home so I can’t test it. I was hoping someone could confirm it.
Thanks

This looks great I have been looking for a replacement for my insteon keypad. https://www.smarthome.com/insteon-2334-232-keypad-dimmer-switch-dual-band-6-button-white.html
I miss it
Are you able to control the indicator lights from webcore? The reason I ask I would like the last two-button indicators to show the garage doors are open or closed. Open indicator on

1 Like

Yes you can do all kinds of wonderful things with the indicators in webcore.

and the garage - dang why didn’t I think of that??? I’ve got two doors, two unused slots on mine and - runs off to go code something up

Haha I only allowed the buttons to close the doors not open them. Just an FYI.

I’m unable to toggle the indicators. I even used the sample webcore posted earlier.
It looks like “buttonPressed” is the same function as “indicatorToggle”.