Update July 2020: Its been a minute since I've used this package myself. I have been using homebridge-plex-sensors, which integrates with homebridge and receives Plex webhooks directly. I have also written a new plugin: plex-to-pushcut, which integrates with Pushcut, one of my favorite apps for home automation.

Goal

I wanted to set it up so that when I play a movie or TV show, my lights dim, and when I pause, they brighten. I'd like to be able to set different scenes to activate depending on if I start watching in the bedroom vs the living room.

Alternatives

IFTTT is too dumb to support this, because there needs to be logic around what to do depending on which webhook event was fired.

Solution

I wrote a small node app for this. It receives incoming webhooks from Plex. For play/pause/start events, it forwards the webhook to homebridge-http-webhooks, which maps to a contact sensor in my HomeKit setup.

With a contact sensor whose state maps to the playing status of Plex, I can use Apple's Home app to set up automations for different HomeKit scenes based on changes to the contact sensor state.

Check out the package on my GitHub for details.

I adapted the code from an example app published by the Plex developers. I don't expect this to be universally useful, but the more tech savvy smart home user could use or adapt the code for their needs. For this reason, I figured there's no harm in open sourcing it.