UndefinedError

Hello everyone,

I’m trying to filter, but apparently there is an entity that has no attribute “deco_device” and therefore I get the following error: “UndefinedError: ‘homeassistant.helpers.template.TemplateState object’ has no attribute 'deco_device”.
Can someone tell me how to solve this?
the code:

{{expand(integration_entities('tplink_deco'))| selectattr('deco_device', 'eq', 'Bureau') |list}}

Thanks in advance.

The routers themselves will have no deco_device attribute, so you must filter for entities that do have that attribute defined…

{{expand(integration_entities('tplink_deco'))
| selectattr('attributes.deco_device', 'defined')
| selectattr('attributes.deco_device', 'eq', 'Bureau') |list}}

Thank you very much for your response, will try it tomorrow