- platform: template switches: living_room_tv: value_template: "{{ is_state('media_player.living_room_tv', 'playing') }}" turn_on: service: media_player.media_play data: entity_id: media_player.living_room_tv turn_off: service: media_player.media_pause data: entity_id: media_player.living_room_tv icon_template: >- {% if is_state('media_player.living_room_tv', 'playing') %} mdi:pause {% else %} mdi:play {% endif %} #- platform: template # switches: # living_room_tv_mute: # value_template: "{{ state_attr('media_player.living_room_tv', 'is_volume_muted') != 'false' }}" # turn_on: # service: media_player.volume_mute # data: # entity_id: media_player.living_room_tv # turn_off: # service: media_player.volume_mute # data: # entity_id: media_player.living_room_tv # icon_template: >- # {% if state_attr('media_player.living_room_tv', 'is_volume_muted') != 'false' %} # mdi:volume-high # {% else %} # mdi:volume-off # {% endif %} - platform: template switches: bedroom_tv: value_template: "{{ is_state('media_player.bedroom_tv', 'playing') }}" turn_on: service: media_player.media_play data: entity_id: media_player.bedroom_tv turn_off: service: media_player.media_pause data: entity_id: media_player.bedroom_tv icon_template: >- {% if is_state('media_player.bedroom_tv', 'playing') %} mdi:pause {% else %} mdi:play {% endif %} #- platform: template # switches: # bedroom_tv_mute: # value_template: "{{ state_attr('media_player.bedroom_tv', 'is_volume_muted') != 'false' }}" # turn_on: # service: media_player.volume_mute # data: # entity_id: media_player.bedroom_tv # turn_off: # service: media_player.volume_mute # data: # entity_id: media_player.bedroom_tv # icon_template: >- # {% if state_attr('media_player.bedroom_tv', 'is_volume_muted') != 'false' %} # mdi:volume-high # {% else %} # mdi:volume-off # {% endif %}