Quick and dirty way to compare device attributes?


#1

1) Give a description of the problem

I want to see if several presence detectors have the same location (address1)

2) What is the expected behaviour?

I’d like to compare address1 of several devices and save them to a “matching devices” list

3) What is happening/not happening?

Can’t figure out the logic

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


#2

How about comparing the Life360 devices to address1 in the Compare to box


#3

The problem is, the piston looks at the address of each device and, if they’re not home, but at an address on my saved list, it’ll tell me the location (School, work, Grandma’s house, etc.) It ignores anyone who is at home. The output is as such:

Situation A
Wife is at work
Daughter is at Grandma’s house
Son is at school

But if they’re in the same place, I’ll get:

Situation B
Wife is at work
Daughter is at Grandma’s house
Son is at Grandma’s house

I’d like the piston to group any devices that are at the same place:

Situation C
Wife is at work
Son and Daughter are at Grandma’s house

So, if I just put the list in the Compare box, I’ll still get situation B. But if I can save matching devices that have the same location - whatever that location is - to a new device list, then I can create Situation C.

DevTogether = Son and Daughter
DevApart = Wife

I know it seems kinda silly, but now that I’ve had success modifying my other pistons to group devices, the Tinkerer in me is trying to do it here, too. I could probably do this with several lines of code, but this would do what I need in one line, if it was possible.


#4

At this point, about the only thing I can imagine is doing a For/Next loop through all my destinations, saving all matching devices to each destination to a variable, and doing a COUNT() of those devices. Any count of 2 or more would mean matching destinations. We’ll see if it works.

[EDIT] Crap, it only works with devices…

[EDIT] Nevermind…did it as an expression instead


#5

Well, here is my Monsterpiece…all 24 chunks of it…I will be absolutely amazed if it works, lol!

[Edit] Nope…can’t use my list of locations as devices. :frowning: