Am I going mad, or does the status page give a leading space when the power (“Watts”) is 0? (also it is a string rather than a number). Is this a very minor bug that happens to be causing me an issue, or is it done this way for a reason (and I should find a solution in my Node red code)
Thanks so much!
In the code the Watts value is formatted to eliminate decimal places using the String class which becomes a string Json variable, hence the quotes. Apparently String produces that leading blank when the value is zero. I suppose an alternate approach of converting the value to an integer would have worked as well and generated a numeric Json value rather than the quoted string. You should be able to find a workaround.
1 Like
What a strange quirk! Thank you, will try and set up a trim step before processing and should cover all bases.
It’s one of those things that might cause unintended consequences if it were changed.
1 Like
I thought that might be the case, but was also curious as to how it happened! Thank you!