this post was submitted on 28 Nov 2023
2 points (100.0% liked)

Self-Hosted Main

515 readers
1 users here now

A place to share alternatives to popular online services that can be self-hosted without giving up privacy or locking you into a service you don't control.

For Example

We welcome posts that include suggestions for good self-hosted alternatives to popular online services, how they are better, or how they give back control of your data. Also include hints and tips for less technical readers.

Useful Lists

founded 1 year ago
MODERATORS
 

I've been using a google home smart speaker to play music from spotify for a while now, and my family really enjoys this (especially the kids who are young enough that they don't use smartphones or computers like that they can just ask google to play their favorite songs). But I've got a lot of music in my own library that isn't on Spotify or other cloud services, that I want to get the same functionality with. Specifically, I want to be able to give voice commands to have a smart speaker play music from a selfhosted library. At the bare minimum I want to be able to give a specific voice command to start playback on a pre-set speaker of a pre-set album or song. Ideally, I'd like it to be flexible enough to be able to accept voice commands for starting playback on any speaker of any song / album in my library, along with things like pausing and skipping songs via voice command.

I currently have google home smart speakers and a plex server for my music library, and I can manually select music from my plex library on my phone or a computer with a plex client and choose to cast playback to my google speaker, but I want to add voice command functionality. So I started setting up a home assistant server with plex integration using this https://github.com/maykar/plex_assistant. But when I got partway through, I found that google assistant has recently disabled the "text ingredient" commands that made this method possible, and my searching hasn't found any work around to get that functionality back. It looks like home assistant has a subscription service called Nabu Casa that may add this functionality, but I'm not interested in paying for a subscription. If there is a way to integrate google home with a plex music library that would be great, but I'm open to different solutions as well, I just want to avoid Alexa. I found these instructions to build your own voice remote https://www.home-assistant.io/voice_control/thirteen-usd-voice-remote/ which I will probably try next if I can't find any way to integrate google assistant on my existing google speakers, but that would be a last resort.

top 5 comments
sorted by: hot top controversial new old
[–] root-node@alien.top 2 points 11 months ago (1 children)

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.

[–] LastTreestar@alien.top 1 points 11 months ago (1 children)

Where'd you get that flow?

[–] root-node@alien.top 1 points 11 months ago (1 children)

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.

[–] LastTreestar@alien.top 1 points 11 months ago (1 children)

I understand and I appreciate your work, and I'd be happy to sort through it, given your caveat. Please share via DM if you'd like!

I want a BlueSound system after doing some research on it! I've been looking for this solution for a long time... Now on to find high-humidity tolerant speakers for the bathroom...

Thank you!

[–] root-node@alien.top 1 points 11 months ago

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