Simplify code or alternative to using secrets in automations? long lists of entity_id's otherwise

I use the secrets file in my automation to stop having to change the same things in multiple automations. For example I have many different automations checking various sensor states. When I add or change which sensors need to be checked I just change it once in my secrets file. Here is the code showing the commented out line before the use of secrets and the uncommented line showing the use of secrets. This works fine but in the recent HA updates the use of secrets in any YAML files other than configuration has issues and I get "error loading automation (500) if I try to edit them in the UI. Is there an alternative way of simplifying the code and any future changes to the entities?:

- id: '1609452279387'
  alias: Check Beam Offline - any
  description: Notify if the beam sensor goes offline
  trigger:
  - platform: state
   # entity_id: binary_sensor.set_input,binary_sensor.beam_input_2,binary_sensor.beam_input_3,binary_sensor.beam_input_4,binary_sensor.beam_input,binary_sensor.cowshed_beam,binary_sensor.alarm_input
    entity_id: !secret all_sensors
    to: unavailable
  condition: []
  action:
  - service: notify.all_devices
    data:
      message: '{{ trigger.to_state.attributes.friendly_name }} disconnected - possible
        tamper??'
      title: Offline Warning
  - service: persistent_notification.create
    data:
      message: '{{ trigger.to_state.attributes.friendly_name }} disconnected - possible
        tamper??'
      title: Offline Warning
  mode: single

What is the reason for not using a group?

thanks for the quick response. No, groups are probably exactly what I need. Just a newbie so wasn’t familiar with their use and haven’t used them before. I will try that out.

Ah, ok. No offence. :slightly_smiling_face:
Just in case you haven’t discovered it yet: You are able to refresh code changes in your groups without restarting HA. Just press the refresh button on server control.