iharosi / homebridge-plex-webhooks

Plex Webhooks Server plugin for Homebridge
GNU Affero General Public License v3.0
48 stars 5 forks source link

Is there a way to disambiguate between multiple Apple TVs? #29

Closed lzilioli closed 1 year ago

lzilioli commented 1 year ago

As of iOS/iPad OS/tvOS 16, my Apple TV players are all named "Apple TV" when playing/pausing through this webhook. This makes it impossible for me to differentiate between my bedroom apple tv, and my living room apple tv. Does anyone know of a workaround for this?

Rycochet commented 1 year ago

Each of the players has a separate name within their setup, but it doesn't seem to be forwarded to the verbose plugin logs at all, not sure if it's coming through the XML - from looking at https://support.plex.tv/articles/115002267687-webhooks/ it doesn't come through at all. The two that I have a a gen4, and a gen4 HD - so I don't think that it's possible to differentiate (it even uses my public IP in there, so can't go via the internal LAN IP) ... Hopefully someone in here has a better idea?

Skjall commented 1 year ago

You can simply filter on Player.uuid You can see the UUID of the player with enabled verbose logging.

Rycochet commented 1 year ago

@Skjall

I'm getting the same uuid for both players, despite them being vastly different hardware :-/

Skjall commented 1 year ago

@Rycochet Are you sure you are checking the right UUID in the “Player“ section and not in the Server or Account sections? I just tested it here and it works fine.

lzilioli commented 1 year ago

iOS 16 changed the name that it reports to code from the user-set device name to a generic name. https://developer.apple.com/documentation/bundleresources/entitlements/com_apple_developer_device-information_user-assigned-device-name

I would be very surprised if they made this change but maintained access to the correct device uuid.

Skjall commented 1 year ago

@lzilioli I run 2 Apple TV 4K (2nd Generation) on iOS 16.4 Beta. On both, Plex sends a unique Player.uuid. I assume this UUID is generated by the Player on install, service start or initial login, not by the Device.

Maybe @Rycochet can provide the verbose log / JSON of starting/stopping some media for both of his devices. Than we would know for sure.

Here my (shortend) objects.

Room 1:

{
    "event": "media.stop",
    "user": true,
    "owner": true,
    "Account": {
        "id": 123456,
        "thumb": "https://plex.tv/users/xxxxx/avatar?c=xxxxx",
        "title": "xxx"
    },
    "Server": {
        "title": "SRV-xxx-xxx",
        "uuid": "xxxxx"
    },
    "Player": {
        "local": true,
        "publicAddress": "xx.xx.xx.xx",
        "title": "Apple TV",
        "uuid": "ED70DAEB-22A0-XXXX-XXXX-CA9146172FF0"
    }
}

Room 2:

{
    "event": "media.pause",
    "user": true,
    "owner": true,
    "Account": {
        "id": 123456,
        "thumb": "https://plex.tv/users/xxxxx/avatar?c=xxxxx",
        "title": "xxx"
    },
    "Server": {
        "title": "SRV-xxx-xxx",
        "uuid": "xxxxx"
    },
    "Player": {
        "local": true,
        "publicAddress": "xx.xx.xx.xx",
        "title": "Apple TV",
        "uuid": "2C067FED-9CA2-XXXX-XXXX-5518B6DEC7E6"
    }
}
Rycochet commented 1 year ago

Oooh - I have a feeling that I had out of date devices - I'll check asap, but it looks like this is good!

iharosi commented 1 year ago

@lzilioli I'm closing this ticket as it has been stale. Feel free to re-open if you couldn't solve the issue.