Sonos - Switch Source

New to Hassio and have the google assistant “skill” component set up so I can turn my Sonos speakers on and off.

How do I go about setting up a custom “command” to change the source on the speaker… such as changing from “SpinCycle” to “The Chainsmokers”. A command that I can then tell verbally to my google assistant to change the Sonos source.

I’ve tried looking through the forum at creating scripts, automation, etc and have no clue where to start.

Any help is greatly appreciated.

1 Like

This scripts changes the source:

script:
  sonos_the_chainsmokers:
    sequence:
      - service: media_player.select_source
        data:
          entity_id: media_player.kitchen
          source: 'The Chainsmokers'
1 Like

thank you!