Usings attributes as variable

I would like to know if I might be possible to use the current attribute value of a device as variable in a argument.

For example, I would like to use a button to change the color of an RGB Bulb, a single click should add +20 to the hue value, a double click -20.

If Hue >0 and Hue < 345 then
SetHue = current_hue_value +20

1 Like

Thanks for posting! Just to confirm, what kind of button are you referring to?

I noticed this was posted in the Web category, so I assumed you were referring to a tile on a SharpTools web dashboard (eg. via the SharpTools Rule Engine), but just wanted to double check that you weren’t referring to Tasker or Android widgets or something else.

Correct, using the sharptools rules engine. I would like to make a smartthings (physical) button changing the colors of a RGB bulb, so my 6 y.o daughter can easily change the colors of here bedroom.

Ah, ok. So each click of the physical SmartThings button would cycle through the colors of a RGB bulb.

Thanks for sharing the specific example! Variables are on our hit list, but not available yet. In the meantime, you could use a set of IF conditions to cycle through different Hues.

@James any other thoughts?