Error rendering data template: TypeError: argument of type 'int' is not iterable

Working on some notification logic and am receiving this error: Error rendering data template: TypeError: argument of type ‘int’ is not iterable.

What am I doing wrong?

message: "{% if trigger.entity_id == 'vacuum.vac1' and now().isoweekday() in (3)  %}
                   Room Vacuum Completed
                   {% else %}
                   {{ state_attr(trigger.entity_id, 'friendly_name') }} Vacuum Completed
                   {% endif %}"

to check, if a value is part of a set / an array, you need to specify an array using square brackets. So it’s

now().isoweekday() in [3]

which is basically the same as

now().isoweekday() == 3

Or you can use a tuple, but with only one element, you need a comma:

now().isoweekday() in (3,)
1 Like