RM Stripping out Special Characters on String

@bravenel
RM won't allow me to put in a string in this format to play a sound on Echo Speaks but works in WC:

<audio src="soundbank://soundlibrary/alarms/air_horns/air_horn_02"/>

As soon as I put it in, the text disappears.

I tried using the speak option in RM too and get same results, do you know of a way to get this kind of a string in RM?

I put this string in the Speak command on the Device page of the device itself and it works perfectly fine. My goal is to get my Echo Dot to play a sound when the garage door is closing using a RM rule.

There's a workaround by using WC or Echo Speaks app but was hoping to be able to do this within RM itself without using workarounds. Is there a way to allow RM to use the <> characters?

Did you try it to see if it would work? I played around with the polly voice commands in RM and Echo speaks and they work, but they are not displayed in the string in RM properly.

So it may not display properly but it may work,

[Edit]
I had not done this in awhile so I tried a quick test and it doesn't work using polly voices either, it strips out all the special characters. I thought I had done this with RM and worked at one time. I did verify , as you noted, it can be done with WebCore. The phase below works in WebCore but not in RM. Although webcore strips out the characters in the display of the piston as well.

<speak>I can speak in a <prosody pitch="high">higher pitched voice</prosody>, or I can speak <prosody pitch="low">in a lower pitched voice</prosody></speak>

I believe there was something in the dim and distant past, that special characters could cause issues with RM rules.
I think there was an update to RM that stripped out any special characters.
Not 100% certain but it does ring bell with me. :bell:

Try putting the string in a local (or global) variable and then using the variable instead in RM by %variable-name% because I believe I saw this solution a short time ago.

I tried that, variables have the same issue. I have also tried HTML encoding the string.

The issue has to do with html in text inputs. There are security problems with html in text inputs for apps, so these are stripped.

1 Like

Okay, Echo Speaks does use a textarea to enter the markup.
Would it be possible to use textarea for options for TTS also a markup type that uses textarea for variables and parameters?

1 Like

Anybody figure this one out? Otherwise going to have to do some ugly code hacks to get it to work with echo speaks :frowning: still searching

This is my current hack, to minimise the number of echo speaks actions. The quotes are ignored by ES and are used to segregate the speech from regular devices.



that's what I'm doing now too.

Download the Hubitat app