Trigger google speaker to play white noise until i tell google to stop

I have a Google speaker. I can say “hey google play white noise” and it does the right thing. I thought it would be cool to instead have something silent to trigger this like a NFC tag or a button. And maybe have it do some other nighttime actions.

I don’t think I can trigger Google with something like that.

And I don’t think HA can tell Google assistant what to do.

I could maybe have HA play a mp3 on the speaker but I worry how to make it go until I wake up and say stop. I prefer to tell Google to stop aloud.

Well I used to use Assistant Relay for stuff like this. I guess you technically still can but its now archived and no longer maintained as of a year ago so not sure I can really recommend it anymore.

Wish google would add more starter options for their routines like alexa so it was easier to do things like this. I’m curious to see if other folks have ideas though as I’ve had similar problems in the past.

I haven’t been able to figure out a pre-built way to do this yet either, and its the last missing part to the bedtime routine we do. And while I could play white noise sounds for an hour, my wife really wants it all night like it does when requested via voice.

I’m really hopeful, although I have no idea if it will happen, that when google updates their home devices to support matter, that we may get additional functionality through some local api’s to make calls to do things like this. But as I said I have no idea if it will be available, but I’ll keep dreaming.

I’ve been using the ytube media player add on from HACS GitHub - KoljaWindeler/ytube_music_player: YouTube music player for homeassistant for this. I have a naptime playlist and a bedtime playlist with the white noise track(s) that I want to use. I just start playback and set it to shuffle.

alias: Play naptime playlist in kids room
description: ""
trigger: []
condition: []
action:
  - service: media_player.select_source
    data:
      source: media_player.basement_office_mini
      entity_id: media_player.ytube_music_player
  - service: media_player.shuffle_set
    data:
      shuffle: false
      entity_id: media_player.ytube_music_player
  - service: media_player.volume_set
    data:
      volume_level: 0.38
    target:
      entity_id: media_player.basement_office_mini
  - service: media_player.play_media
    data:
      media_content_id: PL91KMpd8mdQ_5K2kNdgbjCzBmV0XxY_dd
      media_content_type: playlist
      enqueue: play
    target:
      entity_id: media_player.ytube_music_player
mode: single

This is a cool plugin, but I was also interested in a way to just use the built in Google sounds. Fingers crossed there is some developments around this.

I don’t know if this helps but I managed to make this work, somehow.

I have a google home mini in the bedroom and wanted to automate playing white noise when I start my sleep routine.

Here’s my recipe:

First install the Google Assistant SDK integration. It’s a bit of a setup but not too bad.

Then you can send commands using the service “Google Assistant SDK: Send text command”.

I use these commands:

  • “set volume on bedroom speaker to 25%”
  • “play white noise on bedroom speaker for one hour”

No need to set “Media Player Entity” as I don’t actually want the response, I only want the action to happen (playing of white noise).

Unfortunately there are some limitations ( GitHub - tronikos/gassist_text: A Python library for interacting with Google Assistant API via text - this is linked from the HA documenation too).

One thing I could not get to work is to have the noise actually stop after one hour. It will play indefinitely, looping every hour. Currently what I do is I use the google home app in the morning to “stop casting”. It will not respond to a command such as “stop playing on bedroom speaker”. Open to ideas.

If you have setup the Google cast integration you can stop or turn off the media player entity after an hour.