Disable bulbs when dimming

Hi! I’ve got three Ikea Tradfri bulbs in a ceiling fan. I have them configured in a Home Assistant light group. In addition to the normal dimming, I’d like to disable some of the bulbs at low dimming settings. This is what I have in mind:

0%: Off
1%-10%: One bulb
11%-20%: Two bulbs
21%-100%: All three bulbs

Any advice on how to accomplish this? Off the top of my head, two possibilities are

  • Create an automation that listens for the light group brightness and disables bulbs based on thresholds
  • Create a custom component