[BUG REPORT] URL Encode: % not encoding

@bravenel
C8-pro, C7: Platform Version: 2.4.3.158
Pretty self explanatory but probably a PIA none the less.


Things pretty much die at the first %.

Can you show a rule where you expect URL encoding but don't see it? This rule isn't such an example -- see below if that is confusing.

In this one, you're setting a string variable to a value that interpolates the value of a variable named " of the class passed with greater than 85", which presumably does not exist (is null) on your hub, so this result would be expected. Percent signs are used to enclose hub variable names in many places of the RM UI that allow for arbitrary string input, this included.

Maybe using a hub variable works?

Moved the %, still seems to work.

You don’t appear to be using URL encoding in your screenshots either.

Here’s a rule that’s been running on my hub for a while.

The rule sets a local variable to a device attribute, then URL encodes the variable, and sends an http get with the URL encoded output.

No issues here. Perhaps I’m misunderstanding the problem the OP is trying to describe?

ETA: apologies for the weird formatting in the screenshot, taken from my iPhone.

Are you confusing the variable "encoded" with something else? Or, maybe I am missing something.

Ok I get it now. There is no variable called % of the class passed with greater than 85%.
I also see my example was not clear.

I'm trying to push a square peg through a round hole.
Here is my real world square peg:
The journey started with trying to post a ssml text fragment. Meaning I was trying to post some text dressed with some ssml elements. The exact text looks like this:
"First line.angle bracketbreak time="5s"/angle bracketSecond line." Oh joy I can't even post the exact string. The first sign things are not going to go well was when Rule Machine politly stripped away the contents between the angle brackes. So I couldn't construct the string I wanted to post. Thinking I could outsmart this I thought I would encode the brackets myself, like this: "First line.%25break time="5s"/%25Second line." And there it is, instead of the desired test I reference a variable called "25break time="5s"/".
So now I understand why this can't be done. I was hoping to be able URL encode this: "First line.%25break time="5s"/%25Second line." to get around the problem.

Thanks for your help. Enjoy your turkey.

Ah, I see more clearly now :sun_behind_small_cloud:

Have you tried creating a variable called Ā« percent Ā» with a value of Ā« % Ā»? That is what I have done in the past to use the Ā« % Ā» symbol in a string.

Ā« 50%percent% passed with more than 85%percent% Ā» will show as Ā« 50% passed with more than 85% Ā»

Something like this?

That’s different than what I have done, but if it works, then all good! :blush: