If that @AndrewFG 's suggestion doesn’t work try putting it in quotes: e.g. “25 V”.
However, this smells of an XY Problem. Putting the state there in the trigger is only ever going to trigger the rule on an exact match. If you used “25 V” the rule won’t trigger for 24 V, 26 V nor even for 25.0 V. There is only one case I can think of where it makes sense to use numbers in the trigger like this and no cases where it makes sense to use a number with a unit.
2025-01-31 14:14:36.526 [WARN ] [el.core.internal.ModelRepositoryImpl] - Configuration model 'pv.rules' has errors, therefore ignoring it: [192,37]: mismatched input '|' expecting 'then'
using “0 V” is at least accepted, will need to verify once it happens.
I’m monitoring my solar inverter’s string voltages. When it drops to 0V I’d like to make a few setting changes. I used a rule with an if statement but want to avoid the unnecessary triggering.
when
Item <item> changed
then
if(<item> == 0|V) {<do_stuff>}
end
The triggering doesn’t cost anything. At least it doesn’t cost significantly more than the if statement. The rule will still trigger and the value will be compared to your value. The only real difference is where the if statement lives.
With managed rules and the other rules languages something like this is better handled in a rule condition. JS’s rule builder and I think jRuby both support rule conditions similar to what you find in managed rules even with file based rules.