Quantcast
Channel: Configuration - Home Assistant Community
Viewing all articles
Browse latest Browse all 103475

Using sonos favourites sensor

$
0
0

I am trying to use the new sonos sensor about favourites and created this script to play randomly favourites, but i get no success…

sonos_random:
  alias: Play Sonos Favourites
  sequence:
    - service: media_player.play_media
      data:
        media_content_id: '{{ state_attr("sensor.sonos_favorites", "items") | list | random }}'       
        media_content_type: audio/mp4
      target:        
        entity_id: media_player.sonos
  mode: single
  icon: mdi:playlist-music

Can anybody help me to trace where is the error?

1 post - 1 participant

Read full topic


Viewing all articles
Browse latest Browse all 103475

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>