Devices and their attributes


#1

1) Give a description of the problem
Having trouble addressing device attributes.
This excerpt from one of my pistons works to increase the volume of my home speakers. The " : volume" attribute that you see in the For Loop “$device : volume” works. However, I cannot address the " : volume" attribute outside of the For Loop. I understand that it may be a DTH issue. But I suspect that I am not coding the IF statement correctly.

2) What is the expected behaviour?
I want an IF statement as follows :

IF Kitchen_Speaker : volume is less than 90
DO…

3) What is happening/not happening?
I cannot address an individual device volume. For example, when I attempt to address “Kitchen_Speaker : volume”, the " : volume" attribute is not available.

**4) Post a Green Snapshot of the piston![image|45x37]


#2

Does the for loop work properly? When you use variables like $device WebCoRE doesn’t assume anything abut the DTH since it could contain anything. This means it will let you use all sorts of attributes which ultimately may or may not be valid. If the for loop works fine, then the attribute is there but not sure why it is not recognized. One simple way around it would be to define a variable for that speaker and then the if should have no problem. Whether it will actuall8y work or not will still depend on the DTH.


#3

Worked perfectly ! Sometimes solutions are just staring you in the face. Thanks !