Hello, I’ve been using Home Assistant for the last couple of months and have tried searching for an answer to this problem to no avail. I’m hoping the community can make some suggestions.
I have set up a couple of daily timers for some sockets which look like the below, but this is limited because if I want to add another timer I need to create a whole new one, going to the effort of adding every sensor, input, automation and group to the configuration by copying and pasting then changing the names for each one to keep everything separate.
Ideally I’d like to be able to do the following:
- Create a template function, or group of functions.
** For example this could be sensors, input_numbers, automations, groups. - Use this group to create multiple instances.
So for example I might have something like:
- input_boolean.enabled
- sensor.on_time
- sensor.off_time
- automation.timer
- group.timer
Then say these could be grouped in some kind of “timer” template so you could do something like:
- instance_template.timer
** input_boolean.enabled
** sensor.on_time
** sensor.off_time
** automation.timer
** group.timer - instance.timer.living_room_light
- instance.timer.hall_light
- etc
And then each individual one would automatically create the necessary sensors, for example:
- input_boolean.living_room_light.enabled
- sensor.living_room_light.on_time
- input_boolean.hall_light.enabled
- sensor.hall_light.on_time
- etc
Other places this would be useful would be to declare multiple instances of things such as temperature sensors, lights, sockets, switches, etc.
Does anyone have any ideas about how to go about doing something like this? Am I missing an existing feature or would this be a good suggestion for a new one?