Hi all,
I currently use the code below to count how many media players are currently in use.
{% set media_players = [
states.media_player.1,
states.media_player.2,
states.media_player.3,
states.media_player.pc,
] %}
{% set playing_number = (media_players | selectattr('state','eq','playing') | list | count)%}
{% if playing_number!= 0 %}
xyz
{% elif playing_number== 0 %}
abc
{% endif %}This text will be hidden
However, one of my media players which is just old tv reports only two types of state - ON or OFF.
How can i modify my code to count different states - ‘playing’ and ‘on’ ?
Looking forward to your replies.
Cheers