Howto Trace Error on Logfile?


I have this Error in my Logfile and absolutely no clue how I can trace the Error…
Can someone give me a hint how to handle that kind of errors?

2024-03-06 06:00:00.373 WARNING (MainThread) [homeassistant.helpers.script] Error in 'choose[2]' evaluation: In 'or' (item 1 of 2):
In 'template' condition: AttributeError: 'list' object has no attribute 'lower'
2024-03-06 06:00:00.408 WARNING (MainThread) [homeassistant.helpers.script] Error in 'choose[2]' evaluation: In 'or' (item 1 of 2):
In 'template' condition: AttributeError: 'list' object has no attribute 'lower'

You have a script, and in that script you are using the choose function, and inside that you have a template condition, and inside that you have an or condition, and in the first of those two conditions you are trying to access a method or property from a list object that doesn’t exist.

My guess: you are trying to convert some string variable to lowercase but it is actually a list of multiple strings and therefore the lower() method fails. Either make sure the method is operating on a string, or use a filter instead.

This will fail:

{{ ['Item One', 'Item Two'].lower() }}

These will not fail:

{{ ['Item One', 'Item Two'][0].lower() }}

{{ ['Item One', 'Item Two'] | lower }}

Thank you for you reply.

Wondering if that script should be a script of my own?!

I supposed something in that direction but I’m using just 2 self-wrote scripts and none of them are using the lower function (I even didnt knew the function till now).

There’s no blueprint that uses a script too.

Is there any chance to find out what (automation oder trigger) calls the script?
That would be VERY helpfull.

There should be more information in your logs other than what you’ve posted. Go to system-> logs and see if you can find the error, then post the full detail.

Are you using the has_value function or filter anywhere in your scripts? That could also be related to the issue.


unfortuantely theres absolutely nothing beside the error information I’ve posted in the logs.

has_value isn’t used also.

The only automation who may cause the error I guess (so far) is a blueprint for my covers. (Cover Control Automation CCA)
I’ve found the list attribute in that blueprint:

  blind: !input blind
  blind_entities: '{{ expand(blind) | map(attribute=''entity_id'') | list }}'

If I check the above line in templates:

{{ expand(‘cover.eg_ez_rolladen’) | map(attribute=‘entity_id’) | list }}

the output is


This is used in the sequences of the automation:

        - repeat:
            for_each: '{{ blind_entities|list }}'
            - alias: Moving the cover to shading position
              service: cover.set_cover_position

The timestamps in the errorlog are matching with triggertimes of the automation.
But I have absolutely no clue what this list is good for.

Each cover has is own automation, so there is no list of entities?!
It’s not even possible to put more then one entity into that blueprint.