Hi All, I'm relatively new to Hubitat and Home Automation and have only started with a couple of simple automations with hue lights. I have an idea for a cool automation but am not quite sure how to actually pull it off. I am a big Hockey fan and sometimes have friends over to watch games. I wanted to create a rule that triggers a "Game Time" action from a button press.
I have a Samsung Smart Things Button, Google Home, Chromecast, Hue Light Bulbs, and Spotify. My idea for the rule is that when the zigbee button is pressed a few separate actions happen.
The hue light bulbs set to a Hubitat Scene of Blue and Gold
The song Let me clear my throat plays from spotify over a chromecast device
Then after I push the button again it ends the rule.
Right now I can get the button press to trigger the hubitat scene but am lost when it comes to playing the song. I assumed that I could use google assistant relay to call out the song and chromecast device but cant really find any clear instructions on how to use it.
Well, first, is the Chromecast device going to be available if you are watching the game on the TV? Is it Chromecast Audio or A google Home speaker? How do you have it set up to connect to Hubitat? The hubitat native beta app or some other community method?
If you have it set up with the Chromecast Beta app, there is a command called "Play Track". This allows you to play any music file that the hub can reach ON A WEB SERVER DIRECTLY. The file cannot be on an a Samba server or an FTP server or Google Drive. It must be on a system that delivers the file with an HTTP url. Also, the file must be accessed directly from the link. You cannot have any type of splash page (like the ones you get when you share a dropbox file) first directing you to page to decide if you want to download or save to your Dropbox. This will not work. The cheapeast way to do this is either to check if your router has this capability with an attached USB device. Its a simple free (now) method to do this that if you're only doing it for a few files won't be a problem.
Personally, I use GitHub and use the "Raw File" link to get the URL for the file.
Now simply plug that URL into the command on the edit device page, and POOF your chromecast should play the file. This command is available in Rule Machine under "Control Music Player" sub-menu.
The Chromecast I want to control is a chromecast TV that I also pull audio from to go into the whole house stereo. I currently dont have google assistant relay because I dont have an Rpi. I have the chromecast integration app installed but then i would run into the issues you described.
I was playing around in google assistant routines and am able to get the chromecast to play the song from spotify but i have to trigger the routine by speaking the command word to a google home. Is there a way to trigger a google assistant routine from hubitat?
I wish there was even functionality within google assistant for buttons because then I could trigger the routine for music within google home and then have the button also trigger a rule within hubitat.
You could rather just use google to trigger the whole darn thing by saying "Hey google Game time" and set that up as a routine which then pushes a virtual button in HE. Might solve your issue.
when i added the chromecast integration and linked my hubitat to google home I am able to see a "virtual button" on my google home dashboard for the scenes I have set up in hubitat. I'll have to try activating one of them when I get home from work.
the simple lighting scene in hubitat could be used to set the lights but maybe i could also add a rule that is triggered whenever the scene is triggered. this could open the door to many other possibilities
You can't. Buttons are not supported by the Google Integration. You can add a virtual switch that turns itself off after a pre-determined period of time.
What he said, sorry. I did mean to say switch. I use one in my Assistant good night routine that then triggers HE for night time. I actually use v-switches a lot.