Value template help needed

value_template: "{{ is_state('media_player.tv_sonos', 'playing') }}"

Got this and it works fine but I need to add above + state_attr(‘media_player.tv_sonos’, ‘media_album_name’ not qual 'TV"

Any ideas

value_template: "{{ is_state('media_player.tv_sonos', 'playing') and state_attr('media_player.tv_sonos', 'media_album_name') != 'TV'}}"
1 Like

Alternatively:

value_template: "{{ is_state('media_player.tv_sonos', 'playing') and not is_state_attr('media_player.tv_sonos', 'media_album_name', 'TV') }}"

Both work, just wanted to share another way. :slightly_smiling_face:

1 Like

You guys are the best community!!! Thanks this is much appreciated!!!