Advertisement
chemelli74

HA unavailable devices

May 7th, 2024 (edited)
735
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.78 KB | None | 0 0
  1. type: markdown
  2. content: >-
  3.   {%- set list_exclude = ['media_player.bravia_kdl_46hx855',
  4.   'media_player.tv_samsung_tv_q85_series_55'] -%}
  5.  
  6.   {%- set devices = namespace(id=[]) -%}
  7.  
  8.   {%- for item in states -%}
  9.     {%- if item.entity_id not in list_exclude and
  10.            item.state == 'unavailable' and
  11.            not ( item.entity_id.startswith('switch.') and item.entity_id.endswith('_shuffle_switch')) and
  12.            not ( item.entity_id.startswith('switch.') and item.entity_id.endswith('_repeat_switch'))
  13.      -%}      
  14.         {%- set devices.id = devices.id + [device_id(item.entity_id)] -%}
  15.     {%- endif -%}
  16.   {%- endfor -%}
  17.  
  18.   {%- for device in devices.id | unique -%}
  19.     - {{ device_attr(device, 'name' ) + "\n"}}
  20.   {%- endfor -%}
  21. title: Device non disponibili
  22.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement