Is it possible that one of the letters in USG-PRO-4 is not simple ASCII? I encountered a problem where the value the user had posted contained a C except it wasn’t ASCII Code 67 but a Cyrillic character with different encoding.
In this thread, the OP has been posting screenshots, whereas we have been posting text. If the OP copies our text (all ASCII) to perform the tests, then it won’t match the attribute’s value if it contains a non-ASCII coded character.
Yeah, it’s a long-shot because that string certainly doesn’t look like it contains some special Norwegian character but it might be worth eliminating this edge-case. If the OP copy-pastes the text from the Template Editor’s results pane to a post, we could inspect it (assuming no conversion takes place during copy-paste).
Maybe not a null (not transferred in copy-paste) but it’s possible to detect non-ASCII characters by examining their hex values. That’s how I spotted the Cyrillic c in this thread.
How did you convert it to a working format? Pretty soon that sensor will populate with other attributes as FW releases on my other devices so I’d like to possibly do it myself to not take up your time
As I suspected, the attribute contains non-ASCII characters. The hyphen isn’t ASCII Code 45 but a multi-byte encoded character.
The problem has been that we have been posting examples for you using standard ASCII characters and you have been using them to match your attribute. The match has always failed because your attribute contains non-ASCII characters (specifically those two hyphens).
The only way to confirm the hypothesis, that your attribute contained non-ASCII characters, was for you to post the attribute’s text. You were always posting screenshots so we couldn’t inspect the attribute’s text.
For future reference, all you need to do is copy the attribute’s text from Developer tools > States in the Attributes column. If you use that in a template, you are certain to use the correct combination of characters.
NOTE
If you’re curious to see the difference between the two kinds of hyphen, an ASCII hyphen is coded as hex 2D (that’s 45 in decimal) whereas what you have is encoded using hex E2 80 91.
Here is a sample file where the first line uses ASCII hyphens and the second line uses your hyphens. It’s impossible to tell the difference between the two like this:
However, when the characters are shown as their hexadecimal encodings, it’s clear there’s a difference in the encoding.