In your If argument, expand to select Save Matching Devices to and select the variable openwindow
In your Then,
Use {openwindow} <----“this is typed in just like text”
Speak {openwindow} is open
This also depends on if you have your Virtual Switch setup correctly…
For your Virtual Switch, it should be something like this:
Define Variable-windows
Devices-Define Devices-Select all Contacts
If any of “Variable” {windows} <—“this is now available down in the device section” changes
Then
–If Any of {windows} are open
Then with with VS, turn on
–If All of {windows} are closed
Then with with VS, turn off
Notice that the two “If” statements are under the first “Then” section
You could also use an Else with VS, turn off but I just rather do it like stated above.
The VS is not really needed unless you just want to see if there is a window open but not necessarily know where…
I would just get rid of the VS and do a Piston something like this:
Define Variable-windows
Devices-Define Devices-Select all Contacts
Define a Variable-openwindow
Devices
If any of “Variable” {windows} changes
Then
–If Any of {windows} are open
Save Matching Devices to {openwindow}
Then with Speaker
Speak {openwindow} is open
I had to do something similar but for 4 sets of blinds. This is the only way that I was able to get it to work. It required a little bit of work but it’s rock solid.
It would work just as well with spoken command. Just remember, the longer the list the longer it will take to run. You might want to group them by room. The connectors are there to add the "and"s in so it looks/sounds right.
Also, don’t make two “speak text” requests. It will start the first and then be interrupted by the second. You have to group everything into one. Use an expression like this:
variable " windows are currently open."
Anything between the “” will be treated like text.
Also, just FYI, when you call out “currenteventdivice”, that is actually your switch, not the windows.