And I think you also miss a command if the state is between 41 and 56. What happens if the humidity is first 60% and drops to 41%. The fan stays at 100%
My suggestion, change the item to Number (as @rossko57 have said) and use a switch-case statement with also a command for the 41-56 range.
Number HumBadkamerBG "Vochtigheid WC-Badkamer BG [%s %%]" <humidity> {channel="mqtt:topic:broker:BadkamerBG:Humidity"}
That does not work…
2020-07-04 17:26:18.970 [ERROR] [pse.smarthome.core.items.GenericItem] - Tried to set invalid state 59.2 (StringType) on item HumBadkamerBG of type NumberItem, ignoring it
I then put “var” in the rules, but I don’t know enough about that.
@ljsquare
Right. To test I set the first at 40%. That was 54%. Because the rule does nothing, I wanted to fix that first.
Type number : Temperature [stateTopic="tele/BadkamerBG/SENSOR"]
//Type string : Temperature [stateTopic="tele/BadkamerBG/SENSOR", transformationPattern="JSONPATH:$.BME280.Temperature"]