Okay - I should have gone to bed hours ago but…
I have tried the command:
tailored to my entities in a browser. volumio.local didn’t seem to work so I used the IP address of the player instead and it returns some JSON, an array with the playlists present.
First question - how do I send this in HA? Do I use rest_command
? How do I get and use what’s returned?
Apologies - as you can probably tell I have a lot to learn! I tend to approach things by getting things working a bit at a time. I am a bit stuck however.
I haven’t used input_select
until very recently. I have two volumio players so I made a input_select
as follows to select the player:
select_volumio_player:
name: Select Volumio Player
options:
- Lounge
- Bedroom
initial: Lounge
icon: mdi:music-circle
And also hardcoded the names of two playlists available as follows:
select_playlist:
name: Select Playlist
options:
- Select a playlist
- ADF
- Dave Gahan
initial: Select a playlist
icon: mdi:playlist-check
So now i need to send:
volumio_ip_address/api/v1/commands/?cmd=playplaylist&name=ADF
to play the “ADF” playlist. I’ve written an automation just to send to the volumio_bedroom
as follows:
- alias: Play selected playlist
trigger:
- platform: state
entity_id: input_select.select_playlist
action:
- service: media_player.play_media
data_template:
entity_id: >
{% if is_state("input_select.select_playlist", "ADF") %}
media_player.volumio_bedroom
{%-elif is_state("input_select.select_playlist", "Dave Gahan") %}
media_player.volumio_bedroom
{% else %}
none
{% endif %}
I don’t know if this works as it’s late and the kids are in bed so I’ll test tomorrow.
This isn’t exactly what I want to do but I’m starting small and working through it bit by bit.
So this is what I still need to accomplish…
-
Make the player the playlist is played on dynamic according to the option in input_select.
-
Obtain the playlists stored on each player and populate an input_select with them.
-
Then the shuffle toggle using websocket api.
I’ve still got a long way to go and it’s hurting my head!
Thank you in advance for any help or pointers.