This project describes one solution to how to connect volumio and google home and then control your playback, volume, skip track, replay.
I have two volumios (RPi2). One is in the kitchen because I like to listen to good music at a high volume when cooking. When working in the kitchen I usually get messy. I have an older cellphone more or less as my dedicated user interface for the Volumio. As you can imagine the screen get messy if I wish to stop playback, skip song etc. Furthermore and to add things up my family and friends often comes into the kitchen and talk to me. High volume and talk do not go together. Messy hands and display-oriented user interfaces do not go together. Therefore it is handy(!) with a voice controlled musicplayer. I just say “OK Google Stereo off” and playback stops and we can talk and when my guest is leaving I continue my messy work and say “Ok google Stereo ON” and can dance and sing my way with messy hands in the kitchen. I am sure you get the picture.
Things you need.
A working Volumio (no kidding!!)
A Google Home
An Android mobile phone - I use a dedicated phone which is always in the kitchen which makes it possible for others to use voice control even when I am not at home. Also, I suggest an older mobile which is not using the latest Android software as they kill some background tasks.
Apps from google
MpDroid (free) https://play.google.com/store/apps/details?id=com.namelessdev.mpdroid
Tasker (cost - worth every penny)) https://play.google.com/store/apps/details?id=net.dinglisch.android.taskerm
Join (free trial - cost little) https://play.google.com/store/apps/details?id=com.joaomgcd.join
Let us get on to work
Preparations on phone
- Download apps as mentioned above
- Test MpDroid. In settings, you should write in your IP-address for your Volumio. Test it to make sure
- Open Join on your phone and follow instructions to connect you.
- Leave Tasker for now.
Preparations in your browser
- Open tabs with IFTTT and Join. Login/sign up.
JOIN - GO TO THe BROWSERTAB
This is done in order for sending commands to TASKER - in this case a variable.
- You should see you Phones name in upper left corner - click on it so it is marked.
- Click on the button “join API”
- Click on the button “show”
- Scroll down to the row “Text - Tasker commands and notification”. Write “status=:=value”
- Mark and COPY the full URL-string starting “https://joinjoaomgcd.appspot.com/_ah/api/messaging/v1/sendPush?text=Status%3D%3A%3Dvalue&deviceId=xxxxxxxxxxxxxxxxxxxx etc.” - THIS IS A UNIQUE URL FOR YOU PHONE.
This is for connecting Google Home with JOIN. Make sure you have COPIED the URL as in 5 above.
We will have to do several IFTTT-applets in order to make some voice commands.
NOTE for reference:
If you wish to make use of my tasker-profile (that is a small program for tasker; see link below) you must assign the right number, or rather, replace “value” with specific numbers in the URL-used on each IFTTT-applet - I will describe below when. This my list:
Toggle Playback=1 (I use voice command; “Stereo on”, “Stereo off”
Volume Low = 2 (I use voice command “Volume Low”)
Volume High =3 (I use voice command “Volume High”
Skip track = 4 (I use voice command “Skip track”)
Previous = 5 ( I use voice command “Again”)
Applet for Toggle
Note: I will here just use the easiest IFTTT command. You can do this smarter. But this is the simple way.
You will make five different applets with different commands an and different values as above in note.
In IFTTT - Tab My Applets:
Press “New Applet”
Press “+ this”
Search “Google assistant” (first time you will be asked to connect to Google Home)
Press “Say a simple phrase”
Write your prefered phrase (and variations if you wish) - for the toggle Write “Stereo on” in first and “Stereo Off” as a vaiation if you follow my example)
Write the response you wish Google Home to say like “Sure, will do”
Press create trigger.
Press “+ that”
Search “Webhooks” (click)
Press “Make a webrequest”
PASTE THE URL FROM JOIN in the first field.
IMPORTANT: Replace the word “value” with 1 (and 2 for the second applet, 3 for the third applet…I hope you get it) in the URL in the IFTTT-field. Important that you do not change anything else. Your URL in IFTTT should look something like this (XXXX is unique to you): "https://joinjoaomgcd.appspot.com/_ah/api/messaging/v1/sendPush?text=Status%3D%3A%3D1&deviceId=xxxxxxxxxxxxxxxxxxxx etc.
Press create trigger.
Before you do the next applets (or revise this) you can test it - move to next step - go to your mobile:
- Download taskerprofile https://drive.google.com/open?id=1Tz_9IjjFOC-5z0pRqNq-9QmurJgfV31e (or do your own if you wish - see below)
- Open TASKER
- Import Tasker-profile (press Home-button - choose “import” the taskerprofile should be in folder downloaded)
- Enable Tasker (upper right corner)
Say “OK GOOGLE Stereo ON” or OK GOOGLE Stereo Off".
If all works then make applets for the other commands - Do not forget to change value to correct number.
To make own tasker profile (for this you need knowledge of tasker):
5a. Text: “status=;=”
5b. Variable nemes: status
- Back out
- New task
7a. If command (if status = 1);
7b. Plugin MpDroid
7e. set variable status = 0 (unsure if this is needed but for sure)
7f. End if
(repeat 7a-f if you would like to do more commands; variable 1, 2, 3, 4, 5 - see my Note above)
Hope this works fine - if anyone is interested. If problems I will try to help.