Hi,
how can filter two word in the domain-entity name ?
I mean f.i all domain-entities with the string “battery” OR “power” in the name (excluding the entitities in rejectattr filter…).
This code works good, but I can not add “power” in the filtering list.
{% set ns = namespace(namelist=[]) %}
{% set sensor_list = states
|selectattr("entity_id", "search", "battery") **OR "power"**
|rejectattr("entity_id", "search", "group*")
|rejectattr("entity_id", "search", ".*amassimo")
|list %}
{% for sensor in sensor_list %}
{% if sensor.state | int < 90 | int %}
{% set ns.namelist = [sensor.name+'('+sensor.state+')'] + ns.namelist %}
{% endif %}
{%endfor%}
{{ns.namelist | join('\n') }}
Thanks all