I use Adaptive Lighting, in which each device has multiple switch entities. When I use the visual editor to select an AL device, I can select an action like "turn sleep mode off". In the YAML generated the entity ID for the correct switch is entered. This makes me believe there is an association between a device entity and their specific function. I am looking to find out where that entity ID is being pulled from and how to do it.
My goal is to create a script that will take multiple AL devices as input and loop through each one performing the same action.
sudo code may look like this:
input: deviceList
forEach device in deviceList
toggleSleepSwitch(device.getSleepSwitchID())
applySettings(device.getMainSwitchID())