Accessing device attributes when writing pistons


#1

Is there a way of reading a device’s attributes when writing pistons (or indeed in the wider webcore site) as I periodically have a device whose attributes are really unclear (or that I could really do with knowing the detail of at that moment) and currently I have to keep a “debug” piston that just writes stuff to my messages queue - which is really inefficient. I know I could probably write the device:attribute in the evaluation console but that doesn’t autocomplete and generally I have no idea what the attributes are!

In particular, if you are interested, I’m fighting the NST Weather device today, trying to find which attribute represents precipitation probability % (its listed in the attributes when I use it as a physical device but its not obvious which that is when I write an expression!)

Cheers

–Chris


#2

Have you looked in the smartthings ide website for your device. If you click in your device it should list all the attributes and their current values


#3

Yeah but while the names are the same as when I choose the device in a piston and the attribute from menues, the names there don’t align with the attribute names when I do [device:attribute] in an expression - I get a totally different set of attributes presented

Maybe the issue here is actually with how the expression is showing me available attributes


#4

When using [device:attribute]. It will show you a ton of attributes that may not pertain to your device. If you would select physical device, instead of expression it will show all the attributes That “should” be available. You can then go from there and use them as an expression. Capitalization and spelling matter of course