#How to get area of an exposed entity in jinja

1 messages · Page 1 of 1 (latest)

rose plaza
#

I am trying to configure OpenAI agent prompt to include area of devices.

My prompt with jinja:

Available Devices:

entity_id,name,state,aliases,area
{%- for entity in exposed_entities %}
{{ entity.entity_id }},
{{ entity.name }},
{{ entity.state }},
{{ entity.aliases | join('/') }},
{{ area_name(entity.entity_id) }}
{%- endfor %}

The area field always comes out empty for all devices. What am I doing wrong? ChatGPT did not help lol