Using template to make an entity_id conditional

I know this is old, and not sure if it’s related… But I was having issues with a condition/sequence expecting an entity_id instead getting populated with a target (device_id) value.

This may shine some light on the issue: