Same Automation for multiple entities

Hey, I want to send a notification if a windows is open for more than 15 minutes and the outside temperature is below the inside temperature.
So far, nothing special - but I want to have this on a per room basis (if window roomA open and temperature roomA < outsideTemp …). Best would be to collect the rooms where the rule applies in a list to send that via notication (kind of similar to the battery_state blueprint).

Advaned features would be to have a summer and a winter mode, where in summer it is the other way around. But that could also be just another automation then.

Does anybody know if there is a blueprint for this, I couldn’t find any.

cheers!

Here is my automation, it’ll send a message to my Telegram-group and will mention the opened doors through my Google speakers. You can adapt to your needs, like change “state” to “numeric_state” so it triggers at a certain temperature. The “trick” of the “customized” warning is {{trigger.to_state.name}} because this will mention the device that has triggerd the automation. I’m getting warned several times, due to the repeat.

alias: Melding - Deuren te lang open
description: ""
trigger:
  - platform: state
    entity_id: binary_sensor.koelkast_vriezer_deur_contact
    to: "on"
    for:
      hours: 0
      minutes: 1
      seconds: 30
    id: koelkast open
  - platform: state
    entity_id: binary_sensor.voordeur_deur_contact
    to: "on"
    for:
      hours: 0
      minutes: 1
      seconds: 0
    id: voordeur open
  - platform: state
    entity_id:
      - binary_sensor.achterdeur_deur_contact
    to: "on"
    for:
      hours: 0
      minutes: 1
      seconds: 0
    id: achterdeur open
condition: []
action:
  - choose:
      - conditions:
          - condition: state
            entity_id: binary_sensor.koelkast_vriezer_deur_contact
            state: "on"
        sequence:
          - repeat:
              while:
                - condition: state
                  entity_id: binary_sensor.koelkast_vriezer_deur_contact
                  state: "on"
                - condition: template
                  value_template: "{{ repeat.index <= 5 }}"
              sequence:
                - service: notify.telegram
                  data:
                    title: WAARSCHUWING!!!
                    message: >-
                      Waarschuwing! Om {{now().strftime("%H:%M") }} stond de
                      {{trigger.to_state.name}} al enige tijd open.
                - service: tts.cloud_say
                  data_template:
                    entity_id: media_player.woonkamer
                    message: >-
                      Waarschuwing! Om {{ states('sensor.human_time') }} stond
                      de {{trigger.to_state.name}} al enige tijd open.
                - delay:
                    hours: 0
                    minutes: 1
                    seconds: 30
                    milliseconds: 0
      - conditions:
          - condition: or
            conditions:
              - condition: state
                entity_id:
                  - binary_sensor.voordeur_deur_contact
                  - binary_sensor.achterdeur_deur_contact
                state: "on"
              - condition: trigger
                id: voordeur open
              - condition: trigger
                id: achterdeur open
        sequence:
          - repeat:
              while:
                - condition: or
                  conditions:
                    - condition: state
                      entity_id:
                        - binary_sensor.voordeur_deur_contact
                        - binary_sensor.achterdeur_deur_contact
                      state: "on"
                - condition: template
                  value_template: "{{ repeat.index <= 3 }}"
              sequence:
                - service: notify.telegram
                  data:
                    title: WAARSCHUWING!!!
                    message: >-
                      Waarschuwing! Om {{now().strftime("%H:%M") }} stond de
                      {{trigger.to_state.name}} al enige tijd open.
                - service: media_player.volume_set
                  data:
                    volume_level: 0.6
                  target:
                    entity_id: media_player.woonkamer
                - service: tts.cloud_say
                  data_template:
                    entity_id: media_player.woonkamer
                    message: >-
                      Waarschuwing! Om {{ states('sensor.human_time') }} stond
                      de {{trigger.to_state.name}} al enige tijd open. De CV
                      wordt op 14 graden gezet om te besparen op de
                      energiekosten.
                - service: climate.set_temperature
                  data:
                    temperature: 14
                  target:
                    entity_id: climate.nefit
    default: []
mode: single