Sort entities by state automatically

Hi all,

I integrated Google Calendar within HA. Within my calendar, I am searching for 4 types of different recurring events. So far I succeeded and I now have 4 sensors within my overview, showing me when the next event is for all 4 types. So for example:

Event Type A: Aug 2nd
Event Type B: Aug 1st
Event Type C: Aug 17nd
Event Type D: Aug 12nd

Now I would like to order them, in the time they are appearing, so:
B, A, D, C

This is simply changing the order of sensors. However, when B occurred, it will only recurr again on the 1st of September. Therefor I would like to move it to the final place in the overview.

Is it somehow possible, to define the order of entities based on an attribute or state?

Did you find a solution to this? I’m looking at doing something similar for the Anniversaries custom component.