I am trying in vain to list all sensors that either start with sensor.stock_
for a calculation. Or which contain the attribute ‘typ’.
For example, I can retrieve the value for {{ states.sensor.stock_biontech.attributes.typ }}
without error. But I do not get any value for
{% set entities = states.sensor
| selectattr('entity_id', 'match', 'sensor.stock_.*')
| list %}
And I get an error when I search for ‘typ’:
selectattr('attributes.typ', 'eq', '123')
.
It reports that there is no sensor with attribute ‘typ’, which is certainly not true.