Well, you create the playlists in iTunes like you normally would. To access those playlists from HomeAssistant, I have configured mine with some buttons that you can press to choose the playlist you want in the lovelace UI.
You can read about it here:
I recommend you do it the way I showed my second post from that link rather than the first.
I think there also might way to do it by embedding an input select into the mini-media-player card but I haven’t gotten around to trying that method yet…
Getting proper on/off status is much harder… It’s on my list of things to do but is never high enough priority to get to. You are welcome to try. With pushbuttons like I use in my example, it’s much less noticeable, because when you press the button, the playlist starts and that’s it.
Hi, I was able to get a playlist played/stop. I also configured the shuffle.
Now I would like to understand how to get the status update? If I activate the shuffle function from itunes, I would like it to also activate in HA.
My configuration is:
That’s why this thread was started… There’s no easy way that I can tell to make shuffle work properly with status,etc. They need to fix it in the component… You can go vote for the feature request:
Hey, let me ask you, do you have it starting automatically on boot with forever? I got a new machine running on 10.14, but I still get the same permission errors when running script/install as I got on my old machine and it won’t start on boot. Does this work for you?
sudo / usr / local / bin / npm installa -g per sempre
Dopo aver inserito
cd Documents / itunes-api-master
Così sarà:
cd Documents / itunes-api-master
sudo / usr / local / bin / npm installs -g per sempre
./script/bootstrap.
cd Documents / itunes-api-master
./script/install
Alright, so I finally got around to making a shuffle that properly reports the state of the shuffle on the media player and turns it on/off when toggled. If you change the state from outside hass, it takes 5-10 seconds to sync, that’s just how long it takes itunes-api to do it. A better way to do this might be with a RESTful switch, but I got tired of banging my head against that wall and did it this way.
Add the following to configuration.yaml:
the commands that turn shuffle off and on:
rest_command:
shuffle_on:
url: "http://[YOUR_ITUNES-API_SERVER_IP]:8181/shuffle"
method: put
content_type: "application/x-www-form-urlencoded"
payload: "mode=songs"
shuffle_off:
url: "http://[YOUR_ITUNES-API_SERVER_IP]:8181/shuffle"
method: put
content_type: "application/x-www-form-urlencoded"
payload: "mode=off"
the input boolean you will use as a switch in your ui:
Hello my dearest friend, it is very kind of you to share this news. I’m really grateful to you. I’m not at home right now and can’t try your code. When I return in October, I will finally be able to enjoy this function. Thanks again!!!