Identify a device with a string concatenation with a status value

Hello!!
I’ve this input_boolean:
input_boolean.garbagemon
input_boolean.garbagetue
[…]
input_boolean.garbagesun

and the sensor:

{{states[‘sensor.oggi_e_adesso’].attributes.giorno_3_lettere| lower}}
which gives me the day of the week in abbreviated form. (today= thu)

My goal is:
is_state(‘input.boolean_garbagethu’,‘on’)
is_state(‘input.boolean_garbage’{{states[‘sensor.oggi_e_adesso’].attributes.giorno_3_lettere| lower}},‘on’)

What is the right syntax

{{ is_state('input_boolean.garbage'~state_attr('sensor.oggi_e_adesso','giorno_3_lettere')|lower, 'on') }}

Uses the string concatenation operator ~ (ref) and the state_attr function (ref, equivalent to what you had but shorter).

Thanks working fine!