Skip Navigation
Jump
Solution for smart speaker integration of selfhosted music library
  • I have three speakers, two are set up in a group. [Study] and [Lounge|Kitchen]

    You will need:

    • Node-RED setup and running. When you import the below flows into Node-RED you may get a warning about duplicate nodes, it's just the way it exports sub-flows. You will need the Home Assistant and Node-RED Dashboard nodes added.

    • Home Assistant setup and running. (change "homeassistant.ip.address" in the Node-RED code to its IP or hostname).

    • The bluesound speakers setup in Home Assistant so that it can see them.

    • Edit the JSON before importing, and change 1.1.1.1 to the IP or hostname of your Home Assistant server/device. Change 2.2.2.2 to the IP/hostname of your MQTT server.

    Flows:

    1st: Music configuration (does all the work) https://pastebin.com/ZZ1cLuHz

    2nd: Music UI (allows a wed front end for controlling the players) https://pastebin.com/N2wpQDKY

    3rd: MQTT input from Rhasspy Voice Assistant - You'll need to change this if you don't use Rhasspy https://pastebin.com/8z7mxZgV

    1
  • Jump
    Solution for smart speaker integration of selfhosted music library
  • The one I currently use, I wrote it myself - took weeks of work. Looking at it now, it also relies on Home Assistant to monitor the speakers.

    I am happy to share it, but there are a lot of moving parts and it's written specifically for BlueSound speakers.

    1
  • Jump
    Solution for smart speaker integration of selfhosted music library
  • I do something like this, but it's not easy.

    I have all my music on a NAS and two BlueSound speakers that are indexing the NAS.

    For the voice command part I have a raspberry Pi with a microphone hat and running Rhasspy Voice Assistant (bonus: it's purely offline).

    That interacts over MQTT and is processed by a rather complicated Node-RED flow that handles all the play/pause actions. Voice commands include "Volume Up|Down, Play next track, Skip Album, Skip Artist."

    All this assumes that you have a playlist loaded and ready to go. It doesn't look up a track and play it. You can't say "Play Never Gonna Give You Up By Rick Ashley", it will just ignore you.

    You could do it with a massive amount of work. You would need to index your music library (track names, artists, albums) and import it into Rhasspy as data for it to learn. It would take a huge amount of processing for that, and it would need to be done every time new tracks are added or removed - which is why I never bothered.

    If there is a way to replicate the google/alexa experience by using locally stored music, I would love to know.

    2
  • Jump
    NPM: How to keep and maintain a dynamic IP (like your public IP) in an access list.
  • While your IPv4 regex is basic enough to pass, it's not valid for actual IP addresses. Using your method, 999.999.999.999 is valid.

    This would be a better option, while keeping it short: ^((25[0-5]|(2[0-4]|1\d|[1-9]|)\d)\.?\b){4}$

    1
  • Jump
    How do you backup your docker containers when so much is owned by root?
  • ...running each container from their own user...

    Ideally this is the perfect option from a security standpoint, this as well as each container having it's own network too.

    In a homelab it's not really required unless you are exposing your network to the internet or are better at creating/managing containers.

    If you are just starting out, just keep everything simple.

    1
  • Jump
    How do you backup your docker containers when so much is owned by root?
  • For backups I use Nautical Backup.

    For the "owned by root" problem, I ensure all my docker compose files have [P]UID and [P]GID set to 1000 (the user my docker runs under). All my 20 containers have no issue running like this.

    How are you launching your containers? Docker compose is the way, I have set the following in all mine:

    environment:
      - PUID=1000
      - PGID=1000
    
    user:
      1000:1000
    
    1