Wildcard event_data matching for automation?

I’d like to run a shell command any time a state_changed event occurs on an entity in a given domain. For example:

    platform: event
    event_type: state_changed
      entity_id: sensor.*  # I want this to match all sensor entities
    service: shell_command.forward_state_changes

It seems like entity_id must match exactly in order for the automation to run. Is there a way to do this?

Just a guess: receive ANY event - state_change, run through ALL entities in your domain and check if the triggered one belongs to it.