Plex Binding Enhancement request

This request was in a very old thread, and seemed to get ignored because of numerous OH4 Update issues with the binding…

But First, I’m using the following rule to notify me what’s being watched (and where… different rules for each “location”).

rule "Send telegram with title for LivingRoom"
when
    Item PlexTVTitle02 changed
then
	if(!PlexTVTitle02.state.toString().isEmpty()){
		val telegramActionPlexBot = getActions("telegram","telegram:telegramBot:PlexPrivBot")
		telegramActionPlexBot.sendTelegram("Living Room TV is watching %s", PlexTVTitle02.state.toString)
	}
end

The question is, can I somehow add the user to that? that way I know which account is watching as well.

My ultimate goal is to make sure that my kids (who often use the living room TV), are using they’re profile, which has a limited library, instead of my profile which has the keys to the kingdom as it were… making sure that my 12-year old didn’t put on something R rated on for him and my 5 year old to watch… in other words, I want to make sure that my 5 year old doesn’t end up watching Aliens, or Chucky, or Friday the 13th…

What I’d like the rule to look like is something like

rule "Send telegram with title for LivingRoom"
when
    Item PlexTVTitle02 changed
then
	if(!PlexTVTitle02.state.toString().isEmpty()){
		val telegramActionPlexBot = getActions("telegram","telegram:telegramBot:PlexPrivBot")
		telegramActionPlexBot.sendTelegram("%t is watching %s on the Living Room TV", PlexTVTitle02.state.toString, PlexTVUser02.state.toString)
	}
end

Does anyone have thoughts on this?

The Plex binding has a user channel, which I see isn’t documented. Can you try linking to it and seeing whether it shows the current profile/user?

After looking at it (and testing it) what user returns is the userid of the profile watching it…

I was able to modify the rule by adding the newly created user item:

telegramActionPlexBot.sendTelegram(PlexTVUser07.state.toString + " - PlayStation is watching %s", PlexTVTitle07.state.toString)

which now works! I’ll beautify it to return a “Pretty Name” later… But I’m happy now I can see what the kids are watching

@aarondvail is this sufficient, or does it need further explanation? I don’t know what else to write

Yes, this is perfect! Thank you!