Maybe i forgot to say, that badgecond1 is defined via the Properties User-Interface.
This should only show, that the user would put this string as input to the field:
“!== 50”
Here i tried to show what i want to achieve.
For example i want to generate this command line
(which is a working command)
visible: =items[props.badgeitem1].state !== 50
And the user has set the last part of the line via property, typed in as string
“!== 50”
So if the user sets the input string next time to for example
“>== 50”
automatically the command line
visible: =items[props.badgeitem1].state >== 50
shall be generated
The user shall have the chance to not only define the value, but also the logical operator.
And im pretty sure, that items[props.badgeitem1].state = “OFF”
But my badge is always visible, what means that the visible-condition returns “true” somehow?
I don’t think you can accomplish this goal with a simple string the way you are attempting. The YAML parser doesn’t run an eval() on any string variables. So yes, your visible parameter always evaluates to true because it equals the string "!=50".
It is possible to achieve this, but you would have to build a much more complex system that includes separate operator and value properties. Then the visible parameter could select the appropriate comparison and apply it to the value. It would get pretty long depending on how complex you needed it to be but would look something like: