jekalmin / extended_openai_conversation

Home Assistant custom component of conversation agent. It uses OpenAI to control your devices.
912 stars 128 forks source link

Plex play on Apple TV #131

Open markyskus opened 7 months ago

markyskus commented 7 months ago

Can you help a little bit? If I ask for playing a movie on my apple tv, the AI answer is the movie is started, but on the screen, only poped up a black screen with the apple's loading circle and after about 3-5 seconds the apple tv dropped back to the last screen (if plex app is opened then plex last opened page) what is the problem? I copy-paste your example and in the script I change the entity to my apple tv (if I don't change, the AI says there are no entity_id)

other question, request about the plex searching, if I ask for search forexample Despicable me, the searcing result is only the original Despicable me movie, and I have got a 2 and 3 movie too.

jekalmin commented 7 months ago

Thanks for reporting an issue!

Can you help a little bit?

Of course. I'm glad to help you.

If I ask for playing a movie on my apple tv, the AI answer is the movie is started, but on the screen, only poped up a black screen with the apple's loading circle and after about 3-5 seconds the apple tv dropped back to the last screen (if plex app is opened then plex last opened page) what is the problem? I copy-paste your example and in the script I change the entity to my apple tv (if I don't change, the AI says there are no entity_id)

Have you tried calling function from developer tools?

service: media_player.play_media
data_template:
    media_content_type: movie
    media_content_id: "plex://YOUR_SERVER_ID/YOUR_MOVIE_KEY"
target:
    entity_id: "YOUR_ENTITY_ID"

(You should replace YOUR_SERVER_ID, YOUR_MOVIE_KEY, YOUR_ENTITY_ID with yours)

Make sure your script is working first when debugging. Also, see if there's an error log.

other question, request about the plex searching, if I ask for search forexample Despicable me, the searcing result is only the original Despicable me movie, and I have got a 2 and 3 movie too.

Similar to the first issue. Could you call https://YOUR.PLEX.SERVER.TLD/search?query={{query}}&X-Plex-Token=YOURPLEXTOKEN API from the browser and see what the result is? (you should replace YOUR.PLEX.SERVER.TLD and YOURPLEXTOKEN with yours) The result should contain three Despicable me movies, so see if API result is expected.