Hi everyone,
When I use this code,
{% set Person = 'parent M' %}
{% set Person1 = 'child V' %}
{% set ConType = 'band5, band2_4' %}
{% set Person = state_attr('sensor.data_' + Person.split(' ')|join('_'),'FirstName')|lower %}
{% set ConType = ConType|replace(', ', '|')|replace(',', '|')|lower %}
{% set Present = states
|selectattr('domain', '==', 'device_tracker')
|selectattr('entity_id', 'search', 'iphone')
|selectattr('entity_id', 'search', Person)
|selectattr('attributes.connectiontype','search', ConType)
|selectattr('entity_id', 'search', 'deco')
|map(attribute='entity_id')
|list %}
{% if Present == [] %}
not_home
{% else %}
{{Present[0].split('_')[-2]|uppercase}}
{% endif %}
I get the following error message
'homeassistant.util.read_only_dict.ReadOnlyDict object' has no attribute 'connection_type'
Can someone tell me why this is happening and how I can solve it?
Thanks in advance.