Create a Condition Template Using a Trigger ID

I have 3 motion sensors in kitchen den and foyer. Similarly I have 3 Helpers brightness_den, brightness_kitchen and brightness_foyer.

I want to do the following:
If Den Motion Senses motion and the relevant brightness helper >0 then Do something.

So I created trigger based on the 3 motion sensors and use the trigger ID den, kitchen and foyer for the relevant trigger.

Then I want to create a Choose Template Condition:

{{ (states(“input_number.brightness_{{trigger.id}}”) | int) > 0 }}

Problem is “input_number.brightness_{{trigger.id}}” not resolving to "input_number.brightness_den if den motion sensor is triggered.

Any help is appreciated.

Post the automation.

Without seeing the automation’s code, it’s challenging to determine how many errors it might contain. However, one obvious error is this template:

{{ (states("input_number.brightness_{{trigger.id}}") | int) > 0 }}

You cannot nest templates.

Change it to this:

{{ states("input_number.brightness_" ~ trigger.id) | int(0) > 0 }}