Expanding the alert component

Would it be possible to expand the alert-component to be able to handle “conditions”?

So you could configure specific alerts (temperature-level, humidity-level, etc.) not to be triggered under specific conditions (such as if you’re not at home, during the night, during media-playback etc.)

How is this not way more popular? :grinning:

You can achieve this by using a template binary sensor to calculate your alerting condition.
For example:

binary_sensor:
  - platform: template
    sensors:
      temperature_alert:
        {{ states.sensor.temp_home.state | int < 18 and is_state("device_tracker.mobile", "home") }}
alert:
  temperature:
    entity_id: binary_sensor.temperature_alert
2 Likes