@masterkenobi - great job getting this working!
Seems like you have answered some of your own questions.
There is some significant work left to make this a full-fledged feature. Part of that would be to use the media_content_type field to drive the interpretation of the json body.
Most of your questions are not necessarily HA questions but are more PlexAPI questions.
The github for PlexAPI is here: https://github.com/mjs7231/python-plexapi
On the question about TV Shows with Seasons. The PlexAPI Video class has methods for seasons() - as a list, or season(title) as a way to look up a season.
The PlexClient class (represented by 'self.device
’ in this code) supports methods for setShuffle
and setRepeat
. Take a look at the PlexAPI code for other fun things to do to your Plex system.
On the question about why there are different entity_id’s - I’m going to look into how the entity_id for the Plex client is generated. It looks like it is derived from the media player entity_id. These entities should be different. Last night when I was messing around with this I notice that /api/states showed a generated entity_id that appended a ‘2’ to one of my devices. I’ll get back to you if I find out or change anything here.