Is there a way to only have some groups defined during a particular time range? Or perhaps only follow a YAML config “!include” during certain time ranges?
I’ve set up a bunch of groups in the groups.yaml file. I’ve been using many of them to put together devices/entities for the various outlets and plugs and lights for the holidays. I only really care about these particular groups during the winter holiday period. Once that is done, I will re-use many of the same entities for other tasks.
I know I could enable/disable related automations. I was thinking that enabling/disabling groups could be another way to accomplish what I want. As I’m thinking about it, I also realize its possible that leaving automations enabled but calling on groups that were disabled could result in undesirable errors / log messages.
I’m not sure this answers your exact question, so I may be a bit off-base. Here’s what I do for the holidays:
Add an all-day Google calendar item that says “Christmas.” It starts when we want to light up the holiday lights and ends when we no longer have the lights up. This definition goes in my google_calendar.yaml file that is in the root configuration directory (here’s the HA reference to setting this up if you don’t already have it: Google Calendar Event - Home Assistant (home-assistant.io)):
Created a binary_sensor.christmas_lights in my binary_sensor.yaml file with the following template. When the calendar item is on, so is the binary_sensor: