UI Rule Definition: Temperature trigger

I am trying to define a rule using the UI that triggers when a zigbee (MQTT) thermometer reaches a temperature.

This is the second rule I define, so I am fairly inexperienced here.

One of the problems that I have is that all options given seem to be somehow applicable: Item, Channel, Thing (my thermometer has all of those), state changes/updates …

the UI seems to focus on ON/OFF OPEN/CLOSED, so I am not sure rules can be triggered by value thresholds.

What is the correct way to define a thermometer UI rule trigger based on temperature?

Some general info on things and items are available here and the difference between update and change in a rule is explained e.g. here

What you most likely want is a rule based on item change. The ON /OFF / Closed /Open values in the UI are just examples to help building a rule, but you enter any other value, as long as the item supports the value.

I agree…

I think the rule should trigger on the temperature item change, without specifying anything else… because there is another field for the action to execute only if… temperature <= 5.

I don’t think it makes sense for the rule to trigger at a particular temperature… because it is possible that on the way up or down the thermometer skips that particular value.

the thing is that I don’t think the rule is triggering in this form, at all.

this is the code that my UI definition generates:

triggers:
  - id: "1"
    configuration:
      itemName: TermometrodelTrastero_Temperature
    type: core.ItemStateUpdateTrigger
conditions:
  - inputs: {}
    id: "3"
    configuration:
      itemName: TermometrodelTrastero_Temperature
      state: "5 |°C "
      operator: <=
    type: core.ItemStateCondition
actions:
  - inputs: {}
    id: "2"
    configuration:
      itemName: Enchufedelradiador_OnOffSwitch
      command: ON
    type: core.ItemCommandAction

I also tested adding some units as some threads suggested, but still I don’t see the rule working.

Short answer - no. You can trigger on change or update, and then compare to thresholds in scripted code or conditions.

but shouldnt the rule up there trigger? why do you think is not doing so?

What makes you think it doesn’t trigger? You need to check beyond it just not doing what you want. Start simple, no condition - does it trigger then?

I think that’s duff though - the | pipe is a magic units designator only within DSL scripts.

Ok, I have removed the Units and updated from 3.1.0 to 3.2.0…

trying to see if the rule triggers or not…

Looks like that was it… it is now working.

1 Like