Create input entities programmatically/dynamically?

I’d like to be able to create (and delete!) new input entities (e.g. input_number, input_boolean, etc.) dynamically/programmatically. Here’s my goal:

I want to be able to allow users to create (and delete) an arbitrary number of alarms to wake them up (kind of like you can in most smartphone alarm clock apps). When a user hits the “new alarm” button, HA should create the corresponding set of input entities (the time for the alarm, whether or not it’s enabled, etc.), and display that via Lovelace.

I’m ambivalent about whether or not these new entities should persist across restarts of HA. (If they disappear when I restart HA, I’ll live with that for now.)

AFAICT, there’s no way to do this, even with AppDaemon. This post is the closest I’ve found, but it didn’t have a solution. It’s also over two years old, so maybe new features have been added to HA since then that I just can’t find?

Thanks in advance!

In HACS there is an app that creates groups (Add Domain Group (group.all_*)). Maybe you can use this as an example ?

That may be useful. Can you give a link?

Just set a state to an entity_id you want to create. The entity will appear. But you need to loading the service manually according to what domain you create.

Whoah! I didn’t realize you could do that!

Is there a way to then delete that entity too?

Also forgive my ignorance, but can you elaborate on what you mean by “you need to load the service manually according to what domain you create”?

Sorry, it should be called “service_registered”
You can check this code i shared last year.