Trying to build expression to show status of a variable list of devices


#1

1) Give a description of the problem
I have a variable that will build a list open devices (doors), and want to have an SMS message automatically text me to let me know if the contact was opened or closed. The expression for this is on line 30.

2) What is the expected behavior?
I receive a message similar to: “Front door opened” or “Front and back doors opened”

3) What is happening/not happening?
I’m not getting the list of doors from the string variable.

**4) Post a Green Snapshot of the piston!


#2

try “ALERT, {DeviceList}”


#3

Your expression doesn’t look correct. You should have double quotes around the text you want displayed and then the variables should be separate and not inside braces. Are you using the expression choice or the argument choice? You want expression and then use the variable in that. Don’t use argument.


#4

I have something similar that you can probably build on. The matching device list is generated when a switch is turned on, you can use a different event. In this, I’m only interested in the open and unlocked.

My use case: I tell Alexa, I’m leaving


#5

Hi, sorry for the late reply to this!!

I can use a property of an object I have by something like [front door : contact], which will give me the open/close status of that contact right?

What I was hoping to do is use that kind of property for the devices in my devicelist variable


#6

You have to pick the capability and the state from the drop-downs in WebCore. Easiest way would be to create a piston using backup code and copy the backup code from the example piston above. Then it will ask you what devices you want to use for each. That will at least give you a working version that you can play with and see what exactly we’re talking about. It’s much simpler than you’re making it.


#7

I don’t think it will work how you want it, you’d probably have to do a for-each loop.