Turn off Google Home Speaker (Chromecast) at a specific time?

Hi all,

I'm JUST starting out with Hubitat and automation, so my understanding of the system is still very basic.

I have a Google Home speaker that plays music for the kids to go to bed. I'd like to have it stop playing that music at a specific time.

I have installed Chromecast Integration.
I can see the speaker in the Devices list.
I have tried setting up a rule (no idea if this is even the right way to do it) that would turn it off. The only Action that is intuitive is "Control Music Player, Volume, Sounds", but the options under that are "set volume", "mute", and "unmute". Ideally I'd want a "pause" option?

Am I going about this completely wrong, or just missing something?

Thanks!

I did a quick check and from what I can see, the Google devices do not come up in the list of music devices. I have Echo devices and those showed up:

@gopher.ny, is the ChromeCast integration not able to control play/stop/etc…?

Maybe try a custom action?

EDIT - Looks like this may not work... At least not consistently...

I think the only way your going to be able to stop the music at a particular time is to send a blank speak command to it. Just use a few spaces. The music will stop when HE takes control of the speaker. The downside is your going to get that tone that plays before the Google speaks. If this doesn't make sense I'll throw together a quick example.

1 Like

@Sebastien The Chromecast integration doesn't have that "stop" feature you are highlighting. Just Set volume, mute, unmute.

@oldcomputerwiz I like that idea, but that tone playing is a no-go since it would be happening in the sleeping kid's room. :slight_smile:

Does the "set volume" option control the volume of the one also? Meaning could the volume be dropped to 0, then issue the blank speak command?

I haven't installed the Google Home integration so I have no idea - is there a way to have it stop playing through GH? Have Hubitat trigger something in GH that stops the music (silently)?

Do you not see these commands in the device edit page for your speaker? You can call the Stop command (bottom left of my screenshot) as a Custom Command in an RM Rule which should stop the playing of the music. That said, I had some mixed results earlier this morning, but that could have been to do with high CPU load on my hub...

Set Volume should also work if you want to use that.

1 Like

I am down to try that. I've not done a "Custom Command in an RM Rule", but can probably figure it out - where do I start that?

The thing that most people are not aware of when I they start to use these is to select the Actuator capability. It's not a requirement, if the device includes other capabilities, it's just a way to restrict the list of devices.

If you want to set volume, you will need to include a parameter as well.

It's been my experience that HE won't be able to control anything with the Google device until it "takes control" of it. This means that the mediasource = Hubitat. The only way I found to take control is ask it to say something, thus the tone prefix.

If you find another way I would be interested too.

I've been playing around with mine this morning and have been able to mix control between my phone and Hubitat. I cast from the YouTube Music app on my phone, then was able to control the volume via a dashboard tile via Hubitat, as well as calling the stop command to stop the cast. Like I mentioned in my earlier post, I did experience some issues with this (I suspect) when the HE hub was under load.

I'll have to try again. The last time I tried changing the volume I wasn't able to do that without first sending some type of speech command. I know others have had the same problem. Makes me wonder if it's a hardware difference. I think the devices I last tried with were all gen 1 devices.

Could also be a loss of comm's between HE and the speaker... If you still have issues adjusting the volume, try running the Initialize command from the device edit page. This would not be a solution, just a way to try and determine whether it is a comm's issue.

I wish it were something that simple. Comms issues usually appear in my logs. It's been awhile since I worked on this. Probably better than a year. It works the way I need it to right now but I've added it to my list of things to do to see if I can change the volume now. Thanks for letting me know that you got it to work.

1 Like

Just for fun I went to the driver page of one of my gen one devices. Played music using Pandora. Can't control volume, stop etc. It's not a comm issue. I tried initialize. Nothing. I then sent a speak command, mediasource=Hubitat, and volume, stop, etc work fine. I'll have to try it on some of my newer stuff when I get time.

Hmm, weird. I've got both Gen 1 and 2, I'll have a play with it as well...

1 Like

As with all things Chromecast on HE, YMMV.