Syntax for creating a list of expressions to check?


#1

1) Give a description of the problem

I want Life 360 to check a list of locations to see if someone has arrived at specific places, but I don’t know the syntax for creating a list

2) What is the expected behavior?

Life 360 should compare the $address1 variable to a list of locations

3) What is happening/not happening?

Unknown syntax to create list. I’ve tried commas, colons, semicolons, spaces, etc…

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

5) Attach any logs (From ST IDE and by turning logging level to Full)

No logs yet - haven’t run yet


#2

Put space before or after " ie "Home ", "Kathleen’s House ", " Kathy’s House "


#3

That puts a space between the words, but I don’t think it differentiates each item in the list.


#4

Something like this… instead of Logging, you can perform an IF and evaluate, then break out of the loop if it matches. You can also skip the "" in list.

image

Output:
4/19/2019, 11:12:45 AM +199ms
+131ms ║"Location1"
+164ms ║"Location2"
+197ms ║"Location3"
+230ms ║"Location4"


#5

ah, ok. Not an expert but I believe you’ll need to do a device list and then an OnEvent from device


#6

I’ll try those ideas, but you’d think the “any of” line would make those other methods unnecessary.


#7

I am not sure this will be helpful, but it does show reading all water leak sensors with some formatted output. I used the formatting portion to set output to 1 decimal place because my 4-in-1 sensor goes to tenths and none of the others do.

It runs every 10 seconds, which is not recommended, but I start and stop the Piston for testing, so it really is not running all the time. If running all the time, you would want it much less frequent (30, 60 minutes or greater) to avoid taxing the hub and more importantly exhausting your batteries very quickly.

I use this code over and over in Test mode to set the offsets for temperature to match between devices. I have 15 Samsung water leak sensors, an accurate Taylor thermometer, and one 4-in-1 device in a box, hence all should read the same. I have achieved a near match (+/- 1 degree) across all of them, though I do not know what happens once the temperature gets to 75 degrees for instance, whether the offsets will still be the same (i.e. whether sensors are linear).

Following is the output:

image