How to programmatically iterate through an entity's properties

i’m hoping to do something like this:

{% for el in states.light.step_lights %}
  {{ el }}
{% endfor %}

that will output something like this:

('entity_id', 'light.step_lights')
('state', off)
('last_changed', '2024-05-22 11:01:16.998528+00:00')

similar to how this works for attributes:

{% for el in states.light.step_lights.attributes.items() %}
  {{ el }} 
{% endfor %}

getting the specific output format doesn’t matter… can be key,val pairs… main question is how to iterate on all elements of the entity.

is this possible?

Something like this.

{% for a in expand('climate.wiser_lounge') %}
{{ a.attributes, a.last_updated, a.entity_id }}
{% endfor %}

no, I don’t think so. I’m looking to enumerate all the properties of a single entity.

i think what your code will do is expand a group entity and enumerate each attribute, last_updated and entity_id for each of the members of the group.