Automation: "If PM2.5 > 10" doesn't catch larger jumps

I’d like to add an automation that turns on an air purifier if the PM2.5 concentration is above a threshold level. In the automation section, I can choose “PM2.5 concentration changes > 10”, but this only fires IF the concentration changes AND the new concentration is > 10 AND the old concentration is < 10. If, for some reason, the air purifier doesn’t turn on (perhaps because it’s disconnected), and the concentration changes from 10 to 11, from 11 to 14 etc., the automation doesn’t fire anymore.

The critical point is the last AND; I don’t want it. I want an automation that fires IF the concentration changes AND the new concentration is > 10.

Is this possible at all?

Look at this Threshold - Home Assistant

1 Like

As stated, that’s expected behavior.

What you want is to change the trigger to watch for any change.
Then in the automation conditions allow further action if the value is over 10 or something like that.

1 Like

Yeah, except that the built-in changes trigger requires one of the values above, below.

Change the trigger from the device trigger you currently have to an entity state trigger.

1 Like

This is my trigger, if it helps:

# Percent / seconds = gradient
# 150 / 180 = 0.8333
  - platform: trend
    sensors:
      kitchen_pm25_rising:
        entity_id: sensor.airquality_particulate_matter_2_5_m_concentration
        sample_duration: 60
        max_samples: 30
        min_gradient: 0.8333
        device_class: smoke

It works off a 50% change over a period of 60 seconds. I find it very accurate.
I’m not sure whether that’s an “entity state trigger”, @Troon .

This is the solution. If instead of Device::AQM I just Entity::AQM-PM2.5`, I can filter against a numerical state, e.g., >10.