I’m trying to average a collection of sensors filtered by their state.
however it turns out the data I want to average isn’t an attribute of the state entity, but a related entity.
This I thought was going to give me a list of all valve openings of all my TRV’s that are enabled (in heat mode).
"{{ states.climate| selectattr('state', 'eq', 'heat')
| map(attribute='valve_control')
| list }}"
it turns out though that my device entity is made up of related entities.
does anyone know how I can traverse the parent entity to a related entity?