New trigger automation : smart trigger by device_class

With the grows of area methodology and the use of device_class, it could be very useful to trigger automation by the state of a device_class.

Need : I’d like to trigger my automation smarter than listing all my entities in my automation or creating a manual group for them.

Goal : With the minimum configuration, I want to trigger my automation by entity’s device_class

It could be very similar to the state trigger but instead of filling entity_id with a list of entities or a manual group, we only need to put a device_class.

A quick example to show how it could be implemented :

- id: 'turn_on_light'
  mode: single
  alias: 'Turn on light'
  description: ''
  trigger:
    - platform: state
      device_class: "motion"
      from: "off"
      to: "on"
  condition: []
  action:
    - service: light.turn_on
      target:
        area_id: "{{ area_id(target.entity_id) }}"

Thanks a lot,
Lou_Juicy