I want to create alert with problematic entities list.
Everything works fine when needed entities status are same, but I don’t know how to make it work with different states.
Here is what I have, but I need to include items, i.e. binary_sensor.garage_nvr_disk_error, which have state ON when problem.
Thank in advance.
message: >-
{%- if is_state("binary_sensor.video_problem", "off") %}
Video ok.
{% else %}
Video problem:
{%- set entities = [states.binary_sensor.garage_nvr_connection, states.binary_sensor.home_nvr_connection, states.binary_sensor.garage_cam_outdoor_connection, states.binary_sensor.garage_cam_indoor_connection, states.binary_sensor.home_cam_entrance_connection, states.binary_sensor.home_cam_outdoor_connection] -%}
{%- for entity in entities -%}
{%- if entity.state == 'off' %}
- {{ entity.name }}
{%- endif %}
{%- endfor -%}
{%- endif %}