Issues with temperature range as trigger

I am using a temperature as a trigger, but I can’t seem to make it work.

In the logs, clearly the temp is above the set point (70 °F) , however the rule never triggers. My guess is that it has something to do with the way temperature is handled, but the topics I’m finding aren’t super helpful. This seems like it should be a quick answer from anyone who knows what they’re doing. Can you help?

configuration: {}
triggers:
  - id: "3"
    configuration:
      itemName: LocalWeatherandForecast_ApparentTemperature
      state: ">70 °F"
    type: core.ItemStateChangeTrigger
conditions: []
actions:
  - inputs: {}
    id: "1"
    configuration:
      type: application/vnd.openhab.dsl.rule
      script: logInfo("Testing", "Temp changed to above 70 degrees F.")
    type: script.ScriptAction

I don’t code so I can’t comment on the rule, but, are you comparing numbers to numbers? Or are you comparing strings to numbers? Double check that.

It’s the Unit of Measurement (the degree sign and the scale label) that is screwing it up. I just don’t know how to get around that. It is neither a string nor a number. There are LOTS of posts about this being a PITA for everyone, and I’m hoping that these UoM numbers will one day be just regular numbers. But in the meantime I’d love to know how to work around it.

You can’t trigger with a range (>70 °F) but only for a discrete value (70 °F) or for a general change (no state at all)-
But you can use a condition instead, so delete the state for the trigger and create a “But only if” Condition with LocalWeatherandForecast_ApparentTemperature >70 °F

1 Like

Thank you. That’s very helpful.

You’re welcome :slight_smile: