I am working on a automation/blueprint that will dim the lights when a specific apps are playing on the AppleTV. As only the app really changes on the conditions lines of the trigger, I would like to simplify the automation so that I only have one block of conditions which is looped for every app name thats set and performs the actions one the condition is met.
First question is, if this is even possible or is this something better suited of a script? I couldn’t really find the answer online.
Secondly, if so could this be done in the current automation that I have set up? The only thing that changes in the trigger conditions would be state, of the attribute app_name.
Thanks for the reply, I wasn’t aware of templates, but i still have some issue getting it to work. HA keeps giving me errors when the blueprint is loaded on restart.
Failed to load blueprint: while parsing a flow mapping in "/config/blueprints/automation/RWA/appletv_light_dimmer.yaml", line 81, column 8 expected ',' or '}', but got '<scalar>' in "/config/blueprints/automation/RWA/appletv_light_dimmer.yaml", line 81, column 57
I try to follow the documentation: Conditions - Home Assistant
The line with > in front is the line that is giving me the error message.
single line templates need to be wrapped in quotes. As a beginner, you should look at the script documentation and the available conditions and avoid the shorthand templates until you understand yaml & templates.