Antwort auf: HA => Sonos gruppieren …

Forum Forum Schnelle Frage HA => Sonos gruppieren … Antwort auf: HA => Sonos gruppieren …

#1287
DirkHH
Teilnehmer

Moin

da ich auch grad darüber gestolpert bin, habe ich folgendes gefunden.

in die config kommt

<code class="language-markup-templating">group:
  sonos:
    entities:
      - media_player.guest_bathroom
      - media_player.kitchen
      - media_player.living_room
      - media_player.master_bathroom
      - media_player.master_bedroom
      - media_player.office

Dann ein Script erstellen

<code class="language-markup-templating">script:
  # Script to group all Sonos speakers
  sonos_group_all:
    sequence:
      # First, set the volume of the Living Room to 15%. Since this is the TV, it
      # frequently gets turned up much higher and music at this volume is too loud.
      - service: media_player.volume_set
        data:
          entity_id: media_player.living_room
          volume_level: 0.15

      # Now join all of the speakers to the Master Bedroom speaker. (This one is
      # the newest model so it probably has the best CPU if that matters at all.)
      - service: sonos.join
        data:
          master: media_player.master_bedroom
        entity_id:
          - group.sonos

Und zum Schluss

<code class="language-markup-templating"># Play the Chill playlist
sonos_chill:
  sequence:
    # First, group everything
    - service: script.turn_on
      entity_id: script.sonos_group_all

    # Start playing the Chill playlist
    - service: media_player.select_source
      entity_id: group.sonos
      data:
        source: Chill

    # Turn on shuffle
    - service: media_player.shuffle_set
      entity_id: group.sonos
      data:
        shuffle: true

Ich habe es selber noch nicht ausprobiert aber werde es morgen evtl. Mal testen.