Replace tag_id with sensor value in trigger event type: tag_scanned

Hello everyone,

Is there a way to replace the tag_id with a sensor value in the trigger: event → scanned_tag?

I have a template sensor with the value of the NFC tag id.

I would now like to use this sensor to identify the NFC tag in automations. If the tag is now lost, I only want to change the sensor value so that the automations work with the new tag.

My attempt was:

But the trigger doesn’t fire.

Do you have any suggestions?

Thanks a lot.

M-R