[BETA] Device Attribute Iterative Storage (RRD)

Yes, I was missing the .name. So simple. However, what I have done does not work as expected or wanted

if(notifyDevice){
notifyDevice.each{
if((it.name == "Restart-log" && !res) || (it.name != "Restart-log" && res))
it.deviceNotification(valString) }
}

I expected if name =Restart-log and res was false it would write out to Restart-log only
or if not Restart-log and res was true would write out to all other names

I get it writes out to all names when true. I have to look at this more closely. I am sure it is simple.

Drop a

log.debug “${it.name} $res”

(don’t copy/paste - ipad isn’t generating the proper quotes)

Ran it twice, once true and once false. Names are Buffet and Restart.log

Try “${it.name}” in your if

will try - I have been able to see individual items by using notifyDevice[0] % notifyDevice[1]. I am sure it is incrementing some variable. if i could put that in it should work.

       if((${it.name} == "Restart-log" && !res) || (it.name != "Restart-log" && res)) 

gives error

Need the quotes around it.

if(("${it.name}" == "Restart-log" && !res) || (" ${it.name " != "Restart-log" && res)) 

"${it.name}" returns Notification Tile. Explains the no matching

1 Like

notifyDevice[0] returns 1st list name [1] returns the second

i think there must be hidden characters in name.

if(notifyDevice){
for (i = 0; i < 2; i++){
if(notifyDevice[i] != "Restart-log") log.debug notifyDevice[i]
returns -zDining-Kit- and Restart-log. But I can't get it to == "Restart-log"

Maybe notifyDevice[i].toString().trim()

if(notifyDevice[i] =~ "Restart-log")

=~ fixed it.

Thanks for your help

1 Like

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