I’m on vacation at the moment, and won’t be home until mid-week.
The gist of what you want to study is this:
- Let’s say you make an expression variable called
sensorsthat contains an array of the sensors you want to monitor:
- You can use this with the
iterate()expression function to make an array of tripped sensors in
iterate( sensors, if( getstate( _, "urn:micasaverde-com:serviceId:SecuritySensor1", "Tripped") == "1", _, null ) )
- You can make an array of the names of those sensors in
iterate( tripped_sensors, getattribute( _, "name" ) )
- You can make a text
messageout of that with
"Alert Zones " + join( tripped_names, ", " )[note there is a space after the comma inside the second parameter to join()]
You can then send that string to your TTS if the number of tripped sensors > 0. Then
len() function will give you the length of the array.