Saturday, March 06, 2021

How to play R'Méribel, la radiostation on an Amazon Alexa (or Echo) by tapping a single iPhone button

This sounds simple but it takes quite a few steps. This is the result, a single "R'Méribel" button on the iPhone Today View screen that you click to play R'Méribel on your Alexa (the screen you see when you swipe right from the left edge of the Home Screen or Lock Screen). I'm using iOS 14.4 in these instructions, hopefully it'll continue to work in newer versions too.


First a little context. Although UK based we have a house in Méribel (a ski resort in France) which we cannot easily visit at the moment thanks to COVID. It's nice to listen to R'Méribel to remind ourselves of the good times skiing, and, for a French station, they play some surprisingly decent music in the evenings without any DJ's or too many adverts.

Step 1) First you need to install the "myTuner Radio Player App" as an Alexa skill. From the Alexa iPhone app tap the "More" button and select "Skills & Games". Tap the "Search" button and search for "myTuner Radio Player App" tap on it in the results list and then click "Enable to use".

In theory this is enough to allow you to say "Alexa, ask mytuner radio to play R'Méribel". In practice I find the apostrophe and é (accent aigu) confuse the voice recognition at least on my Alexa which is set to UK English.

The problem is the station name "R'Méribel" is a play on words, it should really be something like "Radio de Méribel" but it's been shortened to make it look and sound cooler. However, this abbreviation totally confuses the Alexa voice recognition as anything but an exact database match fails to find the station in the mytuner database of stations. I should really pop down and speak to the Alexa software developers as they are just down the road from me in Cambridge. 

Anyway, to work around this problem we'll add an Alexa "Routine" to bypass the voice recognition so the action can be triggered with a simpler phrase which is hopefully a little easier for Alexa to understand.

Step 2) Adding an Alexa Routine: From the Alexa iPhone app tap the "More" button and select "Routines". Tap the "+" button (top right). You should see this screen :
Tap on "Enter routine name" and call it anything you like, I called mine Say 'Alexa, Meribel' to remind me what the trigger phrase is.

Tap on "When this happens" and tap on "Voice". This allows you to enter a phrase to start the routine. I called mine simply "Meribel" but you can choose any phrase you prefer.

Tap on "Add action" and scroll down to "Customised". Enter the specific text "Alexa, ask mytuner radio to play R'Méribel". I've found it's critical to enter the single vertical apostrophe between the R and M (press and hold on the ' key in the iPhone keyboard to get different options) and the e as é (press and hold the e on the iPhone keyboard to get various accents). If you don't enter this precisely as shown it doesn't match to the station name and offers three almost random selections. It took me ages to work this out. Please enter it exactly as shown.

This step is important as it essentially sends the raw command "Alexa, ask mytuner radio to play R'Méribel" directly to myTuner avoiding the utterly unreliable and inconsistent voice recognition part of Alexa (which rarely works well with my grumpy voice even on a good day).

Finally tap "Choose Device" to select which device it will play on.

With these steps complete you should see this screen.

You can tap on the blue play button to trigger any of your routines. Alternatively you can say "Alexa, Meribel" to trigger the routine with a simple voice command.

I have found that occasionally nothing will play. I think this is due to a problem sending the audio feed from R'Méribel because the myTuner web page also fails to play anything at the same time. I've found there is nothing you can do other than waiting for it to start working again.

If, like me, you struggle to get Alexa to understand what you are saying it's a bit of a pain having to go into the Alexa app, press "More" then "Routines" just to tap the play button. Wouldn't it be much nicer to have a single button on the iPhone main screen?

TL;DR (too long; didn't read)
To make it really easy to setup the Alexa Routine above simply click here or point your camera at this QR Code (or tap it) and it'll do everything described above automatically.

If you're happy with this method so far you can stop at this point. If you want to trigger the Alexa action with a single tap of an iPhone button please continue.

Steps to add a button on an iPhone to trigger an Alexa routine

We need to install another Alexa skill but before we can do this you need an active https://www.patreon.com/ account. Patreon is a payment system for making small regular payments and mainly used for paying musicians or podcast creators. Don't worry, this process is FREE for a single button (you can support the developers by paying a small monthly amount if you want multiple buttons to trigger multiple Alexa actions - this can be helpful for various home automation projects). However, register a Patreon account using your email address and create a new password (don't even think of using the same password everywhere!!!). Once you've completed the registration page don't forget to click on the button at the top of the Patreon web page to send yourself a verification email. Once your Patreon account is fully verified you can continue.

Next, we need to add the "Virtual Buttons" skill to Alexa. From the Alexa iPhone app tap the "More" button and select "Skills & Games". Tap the "Search" button and search for "Virtual Buttons" tap on it in the results list and then tap "Enable to use". Right after you enable the Virtual Buttons skill you must link it to your Patreon account by entering your email address and Patreon password. At his point Virtual Buttons will send you an email with a long URL in it (from info@virtualbuttons.com - make sure it's not sent to your spam folder). You can use this URL to trigger your Alexa routine from anywhere. Keep it secret as anyone with the URL will be able to trigger the routine. The email will look something like this. We'll need the bit in yellow later.

We now need to create another Alexa routine to "Alexa, ask mytuner radio to play R'Méribel" but this time when the "Virtual Button 01" is pressed.

TL;DR
You can follow along below with the manual instructions, click here or simply point your iPhone camera at this QR code (or tap it) to automatically setup the "Virtual Buttons" routine described below.

Launch the Alexa app on your mobile device. Tap the more icon (usually lower right part of screen) and select "Routines". Tap the "+" icon in the top right corner. Tap "Enter routine name" and choose a name, I called mine "Virtual Button 01 is pressed". Tap "When This Happens", then tap "Smart Home" and choose the "Virtual Button 01" device and tap "Save". Select "Add action", then select "Customised" and enter "Alexa, ask mytuner radio to play R'Méribel". Tap "Next" in the top right corner. Tap "Choose Device", and then select the Alexa device you want to play on. Tap "Save" in the top right corner.


You can now click on the blue "Play" button next to "Virtual Button 01 is pressed" to test the new routine. It should start playing R'Méribel again.

Adding an Apple Shortcut

Finally, we are going to use the Apple Shortcuts app to create a button using the "unique access code" URL that was emailed to us from info@VirtualButtons.com (the bit in yellow in the email). The URL can be used from any device so you could for example start the R'Méribel routine by clicking on the link in the email or adding it as a favourite button in your web browser.

However, we are going to use the Apple Shortcuts app to create an iPhone button. Start the "Shortcuts" app on your iPhone and click on "All Shortcuts". We are going to add a "R'Méribel" shortcut like this (top left).


Tap on the "+" (top right) and tap "Add Action" then tap "Apps". You should have a screen something like this (the icons will depend on which apps you have on your phone) :
Scroll down and tap "Safari" and then tap "Open URLs".

You need to copy the long URL sent in the Virtual Button email and paste it where it says URL in blue. It'll look something like this when you've pasted the URL in.
Remember this URL is "secret", anyone who has it can trigger the routine on your Alexa.

Tap "Next" and enter a name for the shortcut. I called mine R'Méribel and finally tap "Done". You should have a button in the Shortcuts app that you can click on. 
When you click on the button you should see the following in the browser which confirms the action has been triggered.
The Virtual Button website does it's magic and triggers the "Virtual Button 01 is pressed" Alexa routine. This routine in turn sends "Alexa, ask mytuner radio to play R'Méribel" to the mytuner skill which should start the station playing.

One final step. Tap and hold on the "R'Méribel" shortcut button in the Shortcuts app and select "Details" from the menu at the bottom (I've found you need to tap and hold directly on top of the shortcut icon, not the three dots, to get the menu to appear). You can now tap "Add to Home Screen" to change the name and possibly the icon (as I did here - I grabbed an image from https://laradiostation.fr/r-meribel/), finally press "Add" to add the icon as a normal iPhone app button.

You can now tap on the button and all the magic happens in the background.

To get the button on the "Today View" page you need to add the "Shortcuts Widget". Scroll to the bottom of the "Today View" and tap "Edit" then the "+" top right. Search for "Shortcuts" and then "Add Widget", you can swipe to select a single, four or eight shortcut buttons. This will add a widget to the Today View which can then be customised to include multiple shortcuts.

That's it. Easy when you know how. Swipe right and tap on one button for R'Méribel!

You can use this Virtual Button technique to trigger any number of Alexa Routines. Because the shortcut is added to your iPhone you can even get Siri to trigger the routine with a voice command on your phone. I'll leave it to you to figure that one out.

You can now enjoy the view whilst listening to R'Méribel.












No comments: