<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Script Editor: Adding speakers to the current music playback in Home Automation</title>
    <link>https://www.googlenestcommunity.com/t5/Home-Automation/Script-Editor-Adding-speakers-to-the-current-music-playback/m-p/437204#M18964</link>
    <description>&lt;P&gt;Hi aredos,&lt;/P&gt;
&lt;P&gt;Yes this would be possible if you have motion sensors that are supported.&lt;/P&gt;
&lt;P&gt;I don't have supported motion sensors but I do have some that currently turn lights on/of and my lights are supported so I tested this to activate when (my unsupported motion sensor) switched on my kitchen light.&lt;/P&gt;
&lt;P&gt;The code I tested and worked is shown below.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="css"&gt;metadata:
  name: Media move 
  description: Test moving media when event happens 

automations:
 
  starters:
    - type: device.state.OnOff
      state: on
      # [available operators: is, isNot]
      is: true
      device: Kitchen Light - Kitchen


  condition:
    type: device.state.Volume 
    state: currentVolume
    device: Living Room speaker - Living Room
    greaterThan: 0

  actions:
    - type: assistant.command.OkGoogle
      devices: Living Room speaker - Living Room
      okGoogle: Move the music to kitchen speaker
&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Edit:&amp;nbsp;&lt;/STRONG&gt;I was hoping to use this condition....&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="css"&gt;  condition:
    type: device.state.MediaState
    state: playbackState
    is: PLAYING
    device: &lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But I could only see my Chromecast with Google TV devices available and not any of my speakers or displays.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 19 Jun 2023 18:17:20 GMT</pubDate>
    <dc:creator>Cathal_S</dc:creator>
    <dc:date>2023-06-19T18:17:20Z</dc:date>
    <item>
      <title>Script Editor: Adding speakers to the current music playback</title>
      <link>https://www.googlenestcommunity.com/t5/Home-Automation/Script-Editor-Adding-speakers-to-the-current-music-playback/m-p/436865#M18935</link>
      <description>&lt;P&gt;Hi!&lt;/P&gt;&lt;P&gt;Thanks for adding the new automation script editor, I think this will be a great way to create more advanced automations.&lt;/P&gt;&lt;P&gt;I would like to add speakers to the current music playback based on motion detection in the respective rooms - is this currently already possible? If not, can you add this feature?&lt;/P&gt;&lt;P&gt;Thanks in advance!&lt;/P&gt;</description>
      <pubDate>Mon, 19 Jun 2023 06:37:47 GMT</pubDate>
      <guid>https://www.googlenestcommunity.com/t5/Home-Automation/Script-Editor-Adding-speakers-to-the-current-music-playback/m-p/436865#M18935</guid>
      <dc:creator>aredos</dc:creator>
      <dc:date>2023-06-19T06:37:47Z</dc:date>
    </item>
    <item>
      <title>Re: Script Editor: Adding speakers to the current music playback</title>
      <link>https://www.googlenestcommunity.com/t5/Home-Automation/Script-Editor-Adding-speakers-to-the-current-music-playback/m-p/437204#M18964</link>
      <description>&lt;P&gt;Hi aredos,&lt;/P&gt;
&lt;P&gt;Yes this would be possible if you have motion sensors that are supported.&lt;/P&gt;
&lt;P&gt;I don't have supported motion sensors but I do have some that currently turn lights on/of and my lights are supported so I tested this to activate when (my unsupported motion sensor) switched on my kitchen light.&lt;/P&gt;
&lt;P&gt;The code I tested and worked is shown below.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="css"&gt;metadata:
  name: Media move 
  description: Test moving media when event happens 

automations:
 
  starters:
    - type: device.state.OnOff
      state: on
      # [available operators: is, isNot]
      is: true
      device: Kitchen Light - Kitchen


  condition:
    type: device.state.Volume 
    state: currentVolume
    device: Living Room speaker - Living Room
    greaterThan: 0

  actions:
    - type: assistant.command.OkGoogle
      devices: Living Room speaker - Living Room
      okGoogle: Move the music to kitchen speaker
&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Edit:&amp;nbsp;&lt;/STRONG&gt;I was hoping to use this condition....&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="css"&gt;  condition:
    type: device.state.MediaState
    state: playbackState
    is: PLAYING
    device: &lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But I could only see my Chromecast with Google TV devices available and not any of my speakers or displays.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 19 Jun 2023 18:17:20 GMT</pubDate>
      <guid>https://www.googlenestcommunity.com/t5/Home-Automation/Script-Editor-Adding-speakers-to-the-current-music-playback/m-p/437204#M18964</guid>
      <dc:creator>Cathal_S</dc:creator>
      <dc:date>2023-06-19T18:17:20Z</dc:date>
    </item>
    <item>
      <title>Re: Script Editor: Adding speakers to the current music playback</title>
      <link>https://www.googlenestcommunity.com/t5/Home-Automation/Script-Editor-Adding-speakers-to-the-current-music-playback/m-p/437584#M18992</link>
      <description>&lt;P&gt;Hi Cathal,&lt;/P&gt;&lt;P&gt;the "Move the music to kitchen speaker" is not working for me. Do you know why? I also think that this would create inconsistencies where sometimes it would do the wrong action. For me it sometimes just brings up google search results about the search term and sometimes starts a completely new spotify session on the kitchen speaker.&lt;/P&gt;&lt;P&gt;There's a &lt;A href="https://www.blog.google/products/google-nest/move-your-music-stream-transfer/" target="_self"&gt;dedicated feature which allows for music transfer&lt;/A&gt;&amp;nbsp;and it would be good to have it as a dedicated action, otherwise it will work inconsistently which would be frustrating and unusable.&lt;/P&gt;</description>
      <pubDate>Tue, 20 Jun 2023 03:48:17 GMT</pubDate>
      <guid>https://www.googlenestcommunity.com/t5/Home-Automation/Script-Editor-Adding-speakers-to-the-current-music-playback/m-p/437584#M18992</guid>
      <dc:creator>aredos</dc:creator>
      <dc:date>2023-06-20T03:48:17Z</dc:date>
    </item>
    <item>
      <title>Re: Script Editor: Adding speakers to the current music playback</title>
      <link>https://www.googlenestcommunity.com/t5/Home-Automation/Script-Editor-Adding-speakers-to-the-current-music-playback/m-p/437834#M19002</link>
      <description>&lt;P&gt;Hi again,&lt;/P&gt;
&lt;P&gt;The code I showed was only meant as an example of what worked for my testing.&lt;/P&gt;
&lt;P&gt;It would need to be changed and expanded on for your devices and motion sensors.&lt;/P&gt;
&lt;P&gt;I've been trying to find out what supported actions and commands are available for Google speakers and displays but haven't found that yet?&lt;/P&gt;
&lt;P&gt;&lt;A href="https://developers.home.google.com/automations/supported-devices" target="_self"&gt;https://developers.home.google.com/automations/supported-devices&lt;/A&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'm just a normal user myself that has only had access to the script editor for a few days and still learning what can currently be done. Please share your suggestions and ideas on the forum post linked below.&lt;/P&gt;
&lt;P&gt;&lt;A href="https://www.googlenestcommunity.com/t5/Home-Automation/Script-Editor-Share-your-ideas-and-vote-on-others-ideas/td-p/435571" target="_blank" rel="noopener"&gt;https://www.googlenestcommunity.com/t5/Home-Automation/Script-Editor-Share-your-ideas-and-vote-on-others-ideas/td-p/435571&lt;/A&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 20 Jun 2023 12:35:57 GMT</pubDate>
      <guid>https://www.googlenestcommunity.com/t5/Home-Automation/Script-Editor-Adding-speakers-to-the-current-music-playback/m-p/437834#M19002</guid>
      <dc:creator>Cathal_S</dc:creator>
      <dc:date>2023-06-20T12:35:57Z</dc:date>
    </item>
    <item>
      <title>Re: Script Editor: Adding speakers to the current music playback</title>
      <link>https://www.googlenestcommunity.com/t5/Home-Automation/Script-Editor-Adding-speakers-to-the-current-music-playback/m-p/441089#M19247</link>
      <description>&lt;P&gt;Hey aredos,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I hope we were able to answer your question with the info provided by &lt;SPAN style="background: var(--ck-color-mention-background); color: var(--ck-color-mention-text);"&gt;&lt;a href="https://www.googlenestcommunity.com/t5/user/viewprofilepage/user-id/40"&gt;@Cathal_S&lt;/a&gt;&lt;/SPAN&gt;. If you have additional questions, feel free to respond to this thread and we'd be happy to further assist you.&lt;BR /&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Cheers,&lt;/P&gt;
&lt;P&gt;Muddi&lt;/P&gt;</description>
      <pubDate>Mon, 26 Jun 2023 13:34:38 GMT</pubDate>
      <guid>https://www.googlenestcommunity.com/t5/Home-Automation/Script-Editor-Adding-speakers-to-the-current-music-playback/m-p/441089#M19247</guid>
      <dc:creator>Muddi</dc:creator>
      <dc:date>2023-06-26T13:34:38Z</dc:date>
    </item>
    <item>
      <title>Re: Script Editor: Adding speakers to the current music playback</title>
      <link>https://www.googlenestcommunity.com/t5/Home-Automation/Script-Editor-Adding-speakers-to-the-current-music-playback/m-p/441126#M19253</link>
      <description>&lt;P&gt;Hi Muddi,&lt;/P&gt;&lt;P&gt;this automation does not work for me, sorry. It would still be an open feature request.&lt;/P&gt;&lt;P&gt;I added it as an idea to the ideas thread:&lt;/P&gt;&lt;P&gt;&lt;A href="https://www.googlenestcommunity.com/t5/Home-Automation/Script-Editor-Share-your-ideas-and-vote-on-others-ideas/td-p/435571" target="_blank" rel="noopener"&gt;https://www.googlenestcommunity.com/t5/Home-Automation/Script-Editor-Share-your-ideas-and-vote-on-others-ideas/td-p/435571&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt;Best,&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt;Peter&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 26 Jun 2023 15:35:19 GMT</pubDate>
      <guid>https://www.googlenestcommunity.com/t5/Home-Automation/Script-Editor-Adding-speakers-to-the-current-music-playback/m-p/441126#M19253</guid>
      <dc:creator>aredos</dc:creator>
      <dc:date>2023-06-26T15:35:19Z</dc:date>
    </item>
    <item>
      <title>Re: Script Editor: Adding speakers to the current music playback</title>
      <link>https://www.googlenestcommunity.com/t5/Home-Automation/Script-Editor-Adding-speakers-to-the-current-music-playback/m-p/448342#M19717</link>
      <description>&lt;P&gt;Hi there,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Sorry for the delays. We appreciate sharing your ideas and requested features. You can always send feedback on your devices by following the steps on our &lt;A href="https://goo.gle/3WTYTSS" target="_blank"&gt;help center&lt;/A&gt;.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Let us know if you have further questions or concerns; otherwise, I'll lock the thread after 24 hours.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Cheers,&lt;/P&gt;
&lt;P&gt;Muddi&lt;/P&gt;</description>
      <pubDate>Sun, 09 Jul 2023 19:45:36 GMT</pubDate>
      <guid>https://www.googlenestcommunity.com/t5/Home-Automation/Script-Editor-Adding-speakers-to-the-current-music-playback/m-p/448342#M19717</guid>
      <dc:creator>Muddi</dc:creator>
      <dc:date>2023-07-09T19:45:36Z</dc:date>
    </item>
  </channel>
</rss>

