Automation triggers multiple entities action send message with affected entity name

At the moment I have many automations for this.

for example:

alias: zu Warm OG Gang
description: ''
trigger:
  - platform: template
    value_template: >-
      {{ states('sensor.netatmo_haus_buro_og_aussen_og_temperature')|float >
      states('input_number.aussen_zu_warm') | float }}
condition:
  - condition: state
    entity_id: binary_sensor.lumi_lumi_sensor_magnet_aq2_on_off
    state: 'on'
  - condition: time
    after: '09:00:00'
    before: '22:00:00'
action:
  - service: telegram_bot.send_message
    data:
      title: Es wird warm draußen
      message: Fenster OG Gang ist noch offen
      target:
        - 599787743
        - 862559030
        - 980139273
  - service: script.alexa_sprachausgabe_im_ganzen_haus
    data:
      message: Es wird warm draußen. Fenster noch offen.
      type: announce
mode: single

How is it possible to put many entities in one trigger and in the action

For example I have this sensors:

  • binary_sensor.lumi_lumi_sensor_magnet_aq2_on_off
  • binary_sensor.homematicip_fenster_und_turkontakt_mit_magnet_3

These two entities are supposed to be in the trigger. And when the automation strikes, she should write me the name of the currently open window and say it via Alexa.

Fore Excample:
It’s getting warm outside, window first floor corridor, ground floor living room still open.

I guess you want to reduce the number of automations by having more triggers / more entities per trigger.
It depends a bit on the use case but one can add:

  1. multiple entities to a state trigger
  2. multiple triggers to an automation

Next it is possible to add a trigger.id and variables to the trigger that can help manage the actions.
Below an example of what I use to restore automation states (that one can toggle in the dashboard).

alias: Time based state restore
description: >+
  Restores states of enabled or disabled automations and forgotton lights. 

trigger:
  - platform: state
    entity_id:
      - automation.front_motion_detect
      - automation.door_openclose_alert
    to: 'off'
    for:
      minutes: 30
    variables:
      trigger_service_call: automation.toggle
  - platform: state
    entity_id:
      - group.01_hallway
      - light.color_temperature_light_25
      - group.02_hallway
    to: 'on'
    for:
      hours: 1
    variables:
      trigger_service_call: light.turn_off
condition: []
action:
  - service: '{{ trigger_service_call }}'
    data: {}
    target:
      entity_id: '{{ trigger.entity_id }}'
mode: queued

Please also have a look at the docs: