Answered

Google Script

  • 30 November 2023
  • 1 reply
  • 73 views

In Google Home I currently play different music each day via amp as part of my morning Google home routine.  Daily routines have a custom command "play chillout music on bar", which plays on Monday for exanple   It works but messy to maintain multiple routines. 

I'm currently attmpting to shift my music routines to Google script.  

I can play music to a nest speaker via script but when attempting to play on amp there are limited functions available, stop/start etc.  There doesn't appear to be away to tell sonos which music to play like you can with a nest speaker. 

Has anyone successful been able to tell sonos which music to play via script? 

 

Current Script:

metadata:

name: Play music on bar

description: Play music on bar

automations:

- starters:

- type: assistant.event.OkGoogle

eventData: query

is: Play Christmas music on the bar

actions:

- type: assistant.command.OkGoogle

devices:

#sonos amp name. Works with nest speaker, but okGoogle actuon not supported with amp

- Bar - Foody

okGoogle: Play music on the bar

Error :

  • [assistant.command.OkGoogle] is not supported by device [Bar - Foody]. The list of supported commands: [device.command.MediaStop, device.command.MediaNext, device.command.MediaPrevious, device.command.MediaPause, device.command.MediaResume, device.command.MediaShuffle, device.command.SetVolume, device.command.Mute, device.command.SetInput, device.command.NextInput, device.command.PreviousInput].

 

Appreciate any help.  Cheers yd

 

icon

Best answer by Sotiris C. 4 December 2023, 12:20

View original

This topic has been closed for further comments. You can use the search bar to find a similar topic, or create a new one by clicking Create Topic at the top of the page.

1 reply

Userlevel 7
Badge +14

Hello @ListeningOnAStorm, welcome back.

This is something that Sonos can’t really help you with. On a first glance, it appears that this feature is not supported for Google Assistant on Sonos.

I can see you’ve posted something similar to the Google Community, I hope you can get some answers there.

Please feel free to reply here with any updates in regards to this for anyone else who would want to use Google Scripts in the same way.