Nodered flow to run custom mp3 on a google home

Hello my dear friends!

This routine will allow you to add the comfort music to your daily routine. In this case the music served as a noice generation for improving the comfort of a person that uses the private spaces. It can be used as well as a comfort music for the time when you wake up / entering the house / clicking the switch. The main routine will be the same.

Prerequsites

  • access to the homeassistant files ( recommended )
    • try visual studio code plugin: works like a charm
    • download mp3 file of your preference from public resources
    • add the mp3 files into the /media dir on your homeassistant instance
  • trigger device ( the wall switch in my case )
  • google home speaker connected though home assistant
  • nodered addon

Nodered flow overview

The flow contains 2 subflows

  • Trigger the mp3 file play on the google-home activated node ( google hub )
  • Identify the number of songs/examples/mp3 files by iterating over them 1 by 1.

File locations and naming

File considered to be located under homeassistant “media” dir. The naming of the files are considered to be

  • example1.mp3
  • example2.mp3
  • etc

Also it is considered that empty mp3 file with the name of empty.mp3 is located in the same dir to break the routine in the mid of execution with the silence if required.

Check the README node inside the flow

The README node will contain the list of changes required for the routine to start and proceed

Link to the flow

Get the flow here

Thank you and have a perfect day!

Let me know if you hit a snag: we will figure this out.