Is there a way to filter out entities that don’t have an area? I.e. aread_id('entity_id') == None
I’m trying to get a list of temperature sensors and I’m only interested in those that have an area associated with them. I would have thought something like this would work select('area_id', 'ne', 'None')
, but unfortunately it doesn’t. I also can’t find anything relevant in the new(ish) area
filters.
This is the template which I currently have. It currently returns a mix of entities with and without area_ids
.
{{
states.sensor
| expand
| selectattr('attributes.device_class', 'defined')
| selectattr('attributes.device_class', 'eq', 'tempature')
| map(attribute='entity_id')
| list
}}