hello,
is there away to do that - at least execute simple play/stop commands via voice?
thanks
hello,
is there away to do that - at least execute simple play/stop commands via voice?
thanks
At least with Google Home or Nest Audio devices, the voice commands pause, resume, louder, quieter, and stop work. You still have to initiate play through a Roon Remote, though.
I imagine you can run a HA script via a voice command. So you could probably play a playlist.
But itâs not âPlay John Coltrane in the kitchenâ
ah okay ;/ then its useless⌠and i assume there is no plan for a voice support in roon at all?
There is. I use my Echo Dot for basic (play/pause, prev/next track) control of Roon but Iâm using my Harmony hub based remote with the Roon Deep Harmony extension to do it.
You might be able to do something similar with just the Roon integration in HA.
What I did is create momentary switches in HA (using an add-on; couldnât figure out how to do this without it) and shared them with Alexa. For example, I created a momentary switch for play/pause with an automation triggered by this switch to send play/pause to my Roon Core device in Harmony. I then used a voice triggered routine with multiple aliases in Alexa so the speaking is natural (say âplayâ instead of âplay onâ).
I use momentary switches like this for a whole lot more than controlling devices added to Harmony. For example, I use them to operate Zigbee door locks and garage doors without having to enter a PIN.
As mentioned above, you canât get Roon to play a particular album or track via a voice command using the Roon HA Integration. But you can get it to play a named playlist, radio station or genre based on the path to that resource in Roon if you hardcode it upfront in a HA script.
For example, these are some of the entries I have in my HA scripts.yaml file.
media_player.livingroompi
is my media player, media_content_id
is effectively the path to a resource in Roon.
# Roon playlist
mellow_mix:
alias: "Mellow Playlist"
sequence:
- service: media_player.play_media
entity_id: media_player.livingroompi
data:
media_content_id: "Playlists/Mellow"
media_content_type: "playlist"
# Roon radio
world_service:
alias: "World Service"
sequence:
- service: media_player.play_media
entity_id: media_player.livingroompi
data:
media_content_id: "My Live Radio/BBCWorldService"
media_content_type: "radio"
# Roon genres
jazz:
alias: "Jazz"
sequence:
- service: media_player.play_media
entity_id: media_player.livingroompi
data:
media_content_id: "Genres/Genre/Jazz"
media_content_type: "genre"
In terms of triggering those, along with start/stop, next/prev and volume control, via Alexa in HA you have several options:
Iâve only attempted the last of these options. It works well, but certainly isnât a 1-click setup. Itâs probably an evening work for someone already fairly familiar with Home Assistant.
btw. Alexa struggles with Roon vs Room, so better to name your HiFi / Stereo as something more recognisable.
# Alexa
# https://www.home-assistant.io/integrations/alexa.smart_home/#configure-filter
Alexa:
smart_home:
locale: en-GB
endpoint: https://api.eu.amazonalexa.com/v3/events
client_id: amzn1.application-oa2-client.####
client_secret: ###
include_domains:
- script
include_entities:
- media_player.livingroompi
entity_config:
media_player.livingroompi:
name: "Living Room HiFi"
description: "HiFi (Living Room)"
display_categories: MUSIC_SYSTEM
Thatâs very cool!
Strictly speaking you can do artists - something like (I havenât tested the code below)
play_miles_davis:
alias: "Play Miles Davis"
sequence:
- service: media_player.play_media
entity_id: media_player.livingroompi
data:
media_content_id: "Library/Artists/Miles Davis"
media_content_type: "music"
You can use templates to get variable parameters - and scripts can even have parameters - but I donât know if there is a way to get the artist parameter from the voice recognition that would make this useful.
So an example (again I havenât tested this)
play_artist:
alias: "Play Artist"
fields:
artist:
name: Artist
description: "The artist you'd like to play"
required: TRUE
sequence:
- service: media_player.play_media
entity_id: media_player.livingroompi
data:
media_content_id: "Library/Artists/{{artist}}"
media_content_type: "media"
Yes, that would be perfect, although I seem to remember (itâs been a while since I looked into it) that you couldnât (at least easily) get Amazon to parse out say the artist name parameter and pass that back to Home Assistant.
Looking at BlueOS they seem to be limited by the same restriction ie. you can get Alexa to trigger an existing command (which has been pre-registered with Alexa like a genre or preset) but you canât extract a parameter from the spoken text and pass it to a command.
Sonos manages to achieve tighter level of integration that allows playback of artists / tracks by name. But like so many of Sonosâ exclusive integrations they probably have the market share to persuade Amazon to make an exception to the rule.
Love to hear if someone does figure out how the (artist/track) parameter could be extracted and passed back to Home Assistant as that would be the final piece of the puzzle.
The best (workaround) I can think of for now would be for Home Assistant to query Roon for a list of Genre, Playlists and Radio stations (and possibly even artists, although I think Alexa has a limit on commands) and expose them all as entities to Alexa via a HA script.
Try it by Siri