Notifications on high CO2

Situation

we have multiple sensors from IKEA that read, amongst other values, CO2. to get notifications, when the CO2 in a room goes over a limit, we had to add a notification that adapts to each sensors room

the sensors: ALPSTUGA air quality monitor

to accomplish that, we just named all the sensors the same as the room they're in, and then use their name directly in the notification

automations.yaml

the automation can be mostly set up through the gui, but the resulting modification in automations.yaml should look like this (use entity_id: all to select all available devices to send a message to):

- id: "1789566059442"
  alias: Co2
  description: ""
  triggers:
    - trigger: air_quality.co2_crossed_threshold
      target:
        floor_id: 2nd_floor
      options:
        behavior: each
        for: 00:00:00
        threshold:
          type: above
          value:
            active_choice: number
            number: 1000
  conditions: []
  actions:
    - action: notify.send_message
      metadata: {}
      data:
        message: "{{ trigger.to_state.name }} too high"
      target:
        entity_id: all
  mode: single

The resulting notifications