Hi, i'm looking to see how (if it's even possible) to generate a list of switch entities that i can pass to something like a service.turn_off. Here's my use cases:
- I have 10 smart outlets, with a left and right switch entity, which i want to incorporate into this list. They all follow the entity naming scheme of
switch.outdoor_outlet_(number 1 through 10)_(left/right). - These outlets all have a helper boolean which is used to define if it's enabled (basically if it'll be used in this automation). These all follow the naming scheme of
input_boolean.outdoor_outlet_(number 1 through 10)_(left/right)_enabled_christmas. - These outlets also all have an input select to set what side of the house the outlet provides power to. I have a
Road SideandDrive Sideoption. These all follow the naming scheme ofinput_select.outdoor_outlet_(number 1 through 10)_(left/right)_location_christmas - Depending on the trigger ID of the automation, the switches will be selected if they meet any of the following criteria:
a. Triggered byTurn all onANDinput_boolean.outdoor_outlet_(number 1 through 10)_(left/right)_enabled_christmasis true.
b. Triggered byTurn drive side onANDinput_boolean.outdoor_outlet_(number 1 through 10)_(left/right)_enabled_christmasis true ANDinput_select.outdoor_outlet_(number 1 through 10)_(left/right)_location_christmasisDrive Side.
c. Triggered byTurn road side onANDinput_boolean.outdoor_outlet_(number 1 through 10)_(left/right)_enabled_christmasis true ANDinput_select.outdoor_outlet_(number 1 through 10)_(left/right)_location_christmasisRoad Side.
Basically, i've tried to set them up in the easiest way possible to automate with something like a for loop written in jinja that counts from 1 to 10 and then check the criteria, but i'm struggling to see how it can be applied to make a list of entities. I'm semi-experienced with syntax of jinja/YAML but if anyone could point me in the right direction on how to make this, it'd be appreciated. Thanks!