I am trying to put my sonos media players on my floorplan. Ideally I would like the players to show one icon if paused or dim and another state when playing.
So far the only way I have been able to do this is the following:
- type: conditional
conditions:
- entity: media_player.repos_sonos
state_not: paused
elements:
- type: state-icon
entity: media_player.repos_sonos
tap-action:
action: call_service
service: media_player.media_play_pause
service_data:
entity_id: media_player.repos_sonos
hold-action:
action: call_service
service: media_player.media_play_pause
service_data:
entity_id: media_player.repos_sonos
double_tap_action:
action: more-info
style:
top: 26%
left: 57.5%
- type: conditional
conditions:
- entity: media_player.repos_sonos
state: paused
elements:
- type: icon
icon: 'mdi:speaker'
hold-action:
action: call_service
service: media_player.media_play_pause
service_data:
entity_id: media_player.repos_sonos
entity: media_player.repos_sonos
style:
top: 23%
left: 59.5%
However when I click the icon the player does not play/pause but instead the detail view of the media player pops up. Any suggestions? How do you have your media player configured?