I recently bought Home Assistant Voice Preview Edition, I installed Home Assistant and configured Jellyfin and Android Tv Remote (Nvidia Shield Pro) integrations.
So I found some interesting things. Some Jellyfin players support the Browse Media functionality in Home Asisstant, a web player in Firefox for example does.
Someone wrote a script that uses rest_command to query the API and obtain the media ID based on keyword searches.
One could use this in an automation to search for the media based on voice commands, and then send the play media event to the jellyfin player using the ID that was pulled via the API search.
I will need to see if the Shield player can do this.
Here’s the script that queries the API for the media ID
I had to add a line to the restful config that gets added to configuration.yaml:
rest_command:
jellyfin_search:
url: "http://{jellyfin_IP}:8096/Items?api_key={user_API_KEY}&searchTerm={{ search_string }}&Recursive=true&IncludeMedia=true&IncludeItemTypes={{ type }}"
method: GET
You need to run the script before calling this command to obtain the media_id from Jellyfin.
The adb command will pull up Jellyfin and put the media up on the screen, but it won’t play it automatically. Sending an adb play command will start playback
Keyevent 85 is the play/pause button. I have a BLE keyboard running on an ESP32 that can send keyboard keys, but I haven’t found the key that sends the Play/Pause event. ADB key commands are slow, but for this automation it’s not too bad.
Doing this is a lot easier and faster with a web player. For example I have a Firefox player where I open Jellyfin and the below command will play the media_id right away. I haven’t figured out how to send a command to force the web player to go into full screen yet.