Integrating Plex Webhooks with KM, via KM Remote or Public Web triggers

I recently bought a subscription to Plex Pass in order to trigger some automations in Keyboard Maestro and other apps when certain media files are playing, paused, etc. Plex is supposed to send out a webhook request to a URL (local or external) that I can specify in their settings. I assumed I could trigger a KM Macro by using either its Remote or its Public Web Trigger in Plex's settings, since I've never had any problem doing the same with other services, but after trying both triggers, with and without parameters, I couldn't get it it work. Could the issue have something to do with the fact that PLEX is sending out a json payload with its request? If that's the case, and KM cannot read/turn the payload into a TriggerValue, shouldn't the request at least trigger the KM Macro with an empty parameter/TriggerValue?

Did you ever work out how to do this? I'd love to be able to run a KM macro upon a Plex media.scrobble event.

According to this page, Plex sends out a multipart POST request. The KM web triggers are, I believe, expecting a GET request.

What you may have to do is spin up your own web server that

  1. Accepts the POST request
  2. Uses a CGI script to decode the payload and extract the data you want to pass to your macro and then...
  3. Sends a GET request to the local or remote KM server, including the (encoded) JSON in the parameter
  4. Your macro can then trigger, taking the (encoded) JSON from %TriggerValue%

The Plex page does mention sending webhooks to Zapier and similar -- you may be able to avoid some of the above by having the external service extract and re-send the JSON for you.

Great info to have, thanks for taking the time!