# Control lights with webhook and router websocket?

**URL:** https://forums.plex.tv/t/control-lights-with-webhook-and-router-websocket/548383
**Category:** Dev/API Corner
**Tags:** server-linux
**Created:** [February 27, 2020, 6:17pm UTC](https://forums.plex.tv/t/control-lights-with-webhook-and-router-websocket/548383 "2020-02-27T18:17:11Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![ElricX](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/elricx/32/110868_2.png) [@ElricX](https://forums.plex.tv/u/ElricX)
#### Post date: [February 27, 2020, 6:17pm UTC](https://forums.plex.tv/t/control-lights-with-webhook-and-router-websocket/548383/1 "2020-02-27T18:17:12Z")

</div>

Hello, I would like to make sure that when I listen to a film on plex that my lights turn off automatically and that when I pause / stop that they turn on. From my readings I understand that all of this must be done by the webhook function. My Almond + router also supports websocket and with a chrome plugin I am able to connect to it to retrieve my smart devices. So I assume that I have to create a script for plex and that it must communicate with my router according to what is going on in Plex? At the script level, I don’t know where to start … Can you help me?

Thank you

---

<div class="post-metadata">

### Author: ![psycik](https://avatars.discourse-cdn.com/v4/letter/p/b77776/32.png) [@psycik](https://forums.plex.tv/u/psycik)
#### Post date: [February 27, 2020, 8:34pm UTC](https://forums.plex.tv/t/control-lights-with-webhook-and-router-websocket/548383/2 "2020-02-27T20:34:02Z")

</div>

Proably better to look at some of the home automations systems that can talk to your lights and plex and do it that way (or at a bare minimum you might find that IFTTT can support it). At least you wont be completely paving your own way.

---

<div class="post-metadata">

### Author: ![system](https://global.discourse-cdn.com/plex/original/3X/2/a/2acb9765406f63293d357b4ec509ec39aa28f2ad.png) [@system](https://forums.plex.tv/u/system)
#### Post date: [May 27, 2020, 8:34pm UTC](https://forums.plex.tv/t/control-lights-with-webhook-and-router-websocket/548383/3 "2020-05-27T20:34:08Z")

</div>

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.
