I’m trying to create a blueprint that will allow the user to select a device and then have the blueprint trigger off of an entity within that device. Example: user selects a power monitoring plug and the blueprint will identify (automatically) and trigger off of the power sensor and then turn off the plug.
The problem I have is that the power sensor entity is determined by a template filter and I can’t use it as an entity_id in the automation trigger.
This will not work because templates in triggers are limited templates, but variables are not rendered until after the trigger. If you want to try to create a variable for a trigger you need to do it in a trigger_variable. However I believe the match function is not available in limited templates anyway, so you will have to trigger more generally, like trigger when something happens with the device, then use variables or conditions to do the action only when your desired conditions are met.
Trigger is all limited templates, where variables and conditions and things like choose statements have the whole HA template tool set available.
Inside a BP, no matter the order they show up in the BP code, things are executed in this order: !inputs, trigger_variables, triggers, variables, conditions then actions.
Things on the left do not know things on the right exist.
Is it possible to have a device trigger for any change in the device? At this point I only have the power sensor entity id in a variable, so I can’t provide that. The docs for this are pretty sparse and seem to suggest I need an entity id.
And to confirm: can conditions use templates for entity ids?