Creating a Status report


#1

Hi all! I’m trying to create a piston that when triggered will text me, or push notify me, a status report of my “things”. This is also sort of a stepping stone for me to learn more about variables and do more advanced things.

I can create constant variables with lists of the lights, presence sensors, and contact sensors I want to check, but I’m stuck from there. What I’d like to happen is, when the piston is triggered, create a list of the lights that are on, contracts that are open, and presence sensors are present. Then send me a message saying “Lights a, b, and c are on, contacts x, y, and z are open, and presence sensor 1 is present.” Or simply “Nothing to report.”

Can anyone point me in the right direction about how I would do this or more advanced things with variables? Thank you all, as always!


#2

This is an example you can modify to your needs. This one just checks on contacts and locks.


#3

Here’s an example I knocked up for you… list your lights and contacts in the first two variables… when triggered it sends an SMS listing lights on and contacts open… and uses expressions to switch between all off / is on / are on, depending on quantity of matching devices.

So you’ll get a message like:

“The living room, kitchen and bathroom lights are on and all contacts are closed”


#4

Thank you both! The “save matching devices” part is what I’ve been missing! @Robin, I like the syntax of the message. I didn’t even think of that! Thank you!


#5

This is so much neater than the piston I hacked together to do the same.

If there a way to populate the device list automatically so that when further devices are added in future the piston would not need edited?

eg
device lights = all devices with “light” or “lamp” in device name
or
device lights = all devices of type light


#6

I know of no way to do that dynamically.

You could use global variables instead of local ones, but the global variables would still need to be updated manually and it would slow the piston right down due to the devices not being specifically referenced within the piston.


#7

How did you generate the “save matching devices” line? I can’t find that in any action or IF statement menus, and when I import your example it doesn’t open a dialog box or anything when I click on it.

It’s almost like I don’t have that function and my webCoRE instance treats it like plain text.

Edit: found it in the settings section - never mind! :slight_smile: