Custom radio stream integration with google home-mini and ifttt

Since few days in Poland we have a new radio station called “new world”. Unfortunately it is still not available on tuneIn so you can’t simply call it like hey google play radio new world. We can do it with help of ifttt service integration and short script.
What we need:
raspberry pi with home assistant :wink:
google home-mini speaker
Steps:
1 - your home-assistant has to accessible from “outside” - that means that you have to be able to log in to home assistant from internet - best and easiest way is to install duckdns plugin - how to do it you can read here: https://www.home-assistant.io/integrations/duckdns/
2 - install integration with ifttt. To do this read this article:
https://www.home-assistant.io/integrations/ifttt/
3 - create a access security token for ifttt aplication - to do that go to your profile in home assistant and click “create token”


4. create short script - go to configuration tab in your home-assistant, click scripts and add new script by pressing orange “plus” sign. Script should include these lines:

'1594544574113':
  alias: new_world
  sequence:
  - data:
      media_content_id: https://stream.rcs.revma.com/ypqt40u0x1zuv
      media_content_type: audio/mp4
    entity_id: media_player.home_mini
    service: media_player.play_media

or

from GUI -
call a service,
service ->media_player.play_media->media_player.home_mini->
data:
media_content_id: ‘https://stream.rcs.revma.com/ypqt40u0x1zuv
media_content_type: audio/mp4

In media_content_id: you should put stream address of your favorite radio station

  1. go to the web page: ifttt.com after logging in press create
    ifttt
    than click on black “if”, find service google assistant, choose “Say a simple phrase” and fill in form, click create trigger.
    After that click black sign “that” and search for “webhooks”. Fill in a form with:
    URL: https://adress_of_ your_home_assistant:8123/api/webhook/security_token_that_you_generated
    Body:
{ "action": "call_service", "service": "script.turn_on", "entity_id": "name.of.the.script.that you've created" }

Method: POST
Content Type (optional): application/json

6 - that’s it now when you say phrase that filed in will run the script and play your favorite radio!!

2 Likes