Variable string to be blank

HI, i'm trying to set up a number of GV or local variables to display the name of a door and window if they are open. When my rain sensor senses rain, my intention is to get echo speaks to say "its raining and the Patio Door, Kitchen Window, front door are open (and so forth) However how i've worked out how to get a variable to stamp the string if its open, however how do i get it to display a null or a blank if the contact is closed. So i have 8 windows, if 4 are closed and 4 are open, i only want my echo to mention the 4 open ones? ive only just started the rule so far so dont read to deep into the screenshot.

Under the Variable command, you have the option to remove a specific string:

Alternatively, there is an app that can do most of this for you. It is called: Device Status Announcer. You could have a rule that triggers it when it is raining, and you can add some text to say before the names of the open doors and windows.

3 Likes
If (contact1, contact2, contact3...contact# all closed) THEN
Set VARIABLE to ""
1 Like

You could also just erase everything and use Select string operation, string remove, and put %theVariableName% in string to remove box

2 Likes

Thanks guys, appreciate your time. I must say @Sebastien your pointer towards the TTS has saved me so much time. This is a gem!

3 Likes

Is there some reason you can't use just a single blank character in the string? I do it all the time. It shouldn't cause any TTS speech.

2 Likes

Hi how do I add a blank, the default appears to ask for a character?

A space is a character. Hit the spacebar.

OMG, I'm sick with frustration. I can't believe I never assumed this! Thanks again

1 Like