Use explicit speed in rules

In a rule how do I check speed in a comparison:

rule "do something on strong wind"
when
    Item weather_wind_speed changed
then
    if (previousState < 30|km/h && weather_wind_speed.state >= 30|km/h ) {
        // do something 
    }
end

This results in errors like:

 Script execution of rule with UID 'weather-3' failed: The name 'h' cannot be resolved to an item or type; line 23, column 31, length 1 in weather

Try 30|"km/h". I think that’s what I did in my system, but I don’t have it in front of me right now to check.

Also you might need to do weather_wind_speed.state > 30|"km/h"

If @rpwong’s suggestion doesn’t work try escaping the / with \/ as in "30|km\/h". If that still doesn't work you can explicitly create a QuantityType with QuamtityType.valueOf(“30 km/h”)`;

Another suggestion: switch to jsscripting or jruby

Yes sorry, I over simplified the actual code when posting here. It had state in it. Fixed the first post.

Will try!

This did the trick.