Create "macro/subprogram/function" to be reused with different inputs

Hi all,

Short question: Is there a possibility to create a macro/subprogram/function (how to call this?) that groups a complete program (incl filtering, templating, automations, …) to be reused with different inputs sensors?

Long question: I currently have a configuration with 2 sensors (mqtt based) and 2 input_numbers. On these sensors/inputs I do various things: filtering, deriving some new template sensors, … . With all this info I’m running 3 automations that send emails, show states on the UI, …

Now I need to copy this complete program a couple of times, where every program is fed with other inputs (every time 2 other sensors and 2 other input_numbers).

How can this be done?

Thx!!

The closest concepts in Home Assistant are Blueprints and Packages. However, neither does everything that you want.

I was already afraid that Blueprints and Packages would be the only possible “solution”, unfortunately they don’t cover everything :frowning: