iloveicedgreentea / GoWatchIt

Focus on watching your content, not babysitting it. Automate your entire theater: Plex, Home Assistant, ezBEQ, light control, etc
https://www.avsforum.com/threads/gowatchit-beq-ezbeq-plex-webhook-automation-tool-official-thread.3264800/#replies
Other
12 stars 0 forks source link

Allow UUID filter to be an array #34

Closed chippoman closed 10 months ago

chippoman commented 1 year ago

Is your feature request related to a problem? Please describe. I have two separate Plex players connected to my AVR and BEQ setup. A Shield and a Zidoo Z9X Pro. I would like to load ezbeq profiles only when one of these two players is playing something.

Describe the solution you'd like Allow the UUID field in config.json to be an array. Example:

"plex": { "ownerNameFilter": "myOwnerName", "deviceUUIDFilter": ["2879a23a97e0bcbe-com-plexapp-android", "a2a2ef8a7cacff5a-com-plexapp-android"], "url": "http://myurl", "port": "32400", "token": "PLACEHOLDER for future use" },

I also tried the following format (using || operators like for authors):

"plex": { "ownerNameFilter": "myOwnerName", "deviceUUIDFilter": "2879a23a97e0bcbe-com-plexapp-android" || "a2a2ef8a7cacff5a-com-plexapp-android", "url": "http://myurl", "port": "32400", "token": "PLACEHOLDER for future use" },

As of 2.1.1, neither format to specify multiple UUIDs seem to work. It doesn't seem to recognize my second UUID as a valid client so that it can send a payload to ezbeq:

time="09-30-2023 20:27:08" level=info msg="Got a request from UUID: a2a2ef8a7cacff5a-com-plexapp-android" time="09-30-2023 20:27:08" level=debug msg="ProcessWebhook: Media type is: movie" time="09-30-2023 20:27:08" level=debug msg="ProcessWebhook: Media title is: The Last Voyage of the Demeter" time="09-30-2023 20:27:08" level=debug msg="Current length of plexChan: 0" time="09-30-2023 20:27:08" level=debug msg="Added length of plexChan: 0" time="09-30-2023 20:27:08" level=debug msg="Current length of plexChan in PlexWorker: 0" time="09-30-2023 20:27:08" level=debug msg="Sending new payload to eventRouter" [GIN] 2023/09/30 - 20:27:08 | 200 | 891.476µs | 192.168.0.99 | POST "/plexwebhook" time="09-30-2023 20:27:08" level=debug msg="Client UUID does not match enabled filter" time="09-30-2023 20:27:08" level=debug msg="eventRouter done processing payload"

Describe alternatives you've considered Leaving the UUID field blank, which would allow all players to send a payload to ezbeq, but this doesn't work for my household as I have Plex players in other rooms of the house that are not connected to my minidsp/ezbeq.

Additional context Add any other context or screenshots about the feature request here.

iloveicedgreentea commented 1 year ago

NP I can implement that

iloveicedgreentea commented 1 year ago

Please try out 2.1.9

chippoman commented 1 year ago

Thanks, the new UUID filtering seems to work. My two devices are being whitelisted, and anything else is being rejected, so that's great!

time="10-11-2023 16:49:01" level=debug msg="Sending new payload to eventRouter" time="10-11-2023 16:49:01" level=debug msg="filter '[2879a23a97e0bcbe-com-plexapp-android a2a2ef8a7cacff5a-com-plexapp-android]' does not match uuid '53a3nrd0dipvcmtd7sgqbjsd'" time="10-11-2023 16:49:01" level=info msg="Got a webhook but Client UUID '53a3nrd0dipvcmtd7sgqbjsd' does not match enabled filter" time="10-11-2023 16:49:01" level=debug msg="eventRouter done processing payload"

But something else seems to have broken. I borked my docker setup in unraid while pulling 2.1.9 so had to start over. I used the new web UI to create my new config.json.

From the logs I can see that it gets the Plex metadata, but I don't think it's sending any payloads to ezbeq to search and load filters:

time="10-11-2023 15:44:41" level=debug msg="decoding payload" time="10-11-2023 15:44:41" level=debug msg="decodeWebhook: Received event: media.play" time="10-11-2023 15:44:41" level=info msg="Got a request from UUID: 2879a23a97e0bcbe-com-plexapp-android" time="10-11-2023 15:44:41" level=debug msg="ProcessWebhook: Media type is: movie" time="10-11-2023 15:44:41" level=debug msg="ProcessWebhook: Media title is: Midsommar" time="10-11-2023 15:44:41" level=debug msg="Current length of plexChan: 0" [GIN] 2023/10/11 - 15:44:41 | 200 | 2.102692ms | 192.168.0.99 | POST "/plexwebhook" time="10-11-2023 15:44:41" level=debug msg="Current length of plexChan in PlexWorker: 0" time="10-11-2023 15:44:41" level=debug msg="Sending new payload to eventRouter" time="10-11-2023 15:44:41" level=info msg="Processing media type: movie" time="10-11-2023 15:44:41" level=debug msg="Added length of plexChan: 0" time="10-11-2023 15:44:41" level=debug msg="Event Router: Found edition: " time="10-11-2023 15:44:41" level=debug msg="Event Router: Got media type of: movie " time="10-11-2023 15:44:41" level=debug msg="Event Router: Using search model: &models.SearchRequest{TMDB:\"\", Year:2019, Codec:\"\", PreferredAuthor:\"\", Edition:\"\", SkipSearch:true, EntryID:\"\", MVAdjust:0, DryrunMode:false, MediaType:\"movie\", Devices:[]string{\"master\"}, Slots:[]int{1}}" time="10-11-2023 15:44:41" level=debug msg="Event Router: media.play received" time="10-11-2023 15:44:41" level=error msg="error connecting to topic - network Error : dial tcp: missing address" time="10-11-2023 15:44:41" level=debug msg="Unloading ezBEQ profiles" time="10-11-2023 15:44:41" level=debug msg="using endpoint /api/1/devices/master/filter/1" time="10-11-2023 15:44:41" level=debug msg="Using method DELETE" time="10-11-2023 15:44:41" level=debug msg="Header is set to false" time="10-11-2023 15:44:41" level=debug msg="Using url http://192.168.0.210:8080/api/1/devices/master/filter/1" time="10-11-2023 15:44:41" level=debug msg="Headers from req map[]" time="10-11-2023 15:44:43" level=error msg="Error unloading beq on startup!! : error connecting to topic - network Error : dial tcp: missing address" time="10-11-2023 15:44:43" level=debug msg="eventRouter done processing payload"

I'm also seeing errors about topics. I don't have MQTT set up, so all the MQTT settings in config.json are blank.

It's using the correct ezbeq ip and port (http://192.168.0.210:8080). I also confirmed that it is able to ping that IP.

iloveicedgreentea commented 1 year ago

hmm okay thats weird can you post your config with secrets redacted. You might be missing a port or http:// somewhere also make sure the config is in lowercase for all keys if you are migrating from an older version

iloveicedgreentea commented 10 months ago

Closing as implemented