spacek33z / dim-my-lights-for-plex Goto Github PK
View Code? Open in Web Editor NEWAutomatically dim you Philips Hue lights when your Plex media player starts playing
Automatically dim you Philips Hue lights when your Plex media player starts playing
Would like to be able to have not only the lights to go on/off, but for sensors to be disabled/enabled when starting/stopping playback.
Currently doing this via Tautulli and a script that is doing a POST to the hub... but would like to migrate purely to webhooks to control sensors and lights in one hit (at the moment using HelloHue plugin, but this will go when Plex removes the ability to use Plugins in the future).
At the moment you can select a scene to which the lights go back when you pause the movie.
However, I would prefer to have it go back to how the lights were before I started the movie.
For the next variables use https://account.meethue.com/bridge to get the internal IP of the bridge, or go to https://discovery.meethue.com/ or find the internal IP of the bridge from your router. From a computer on the same network as your bridge go to: https://<bridge.ip.address>/debug/clip.html
We will use the API Debugger to get the variables.
HUE_TOKEN:
URL: /api
Body: {"devicetype":"dim_my_lights#plex"}
POST
The response description will say "Link button not pressed". Press the button on your bridge,
and click the POST button again. The new response will say username: <token>. This is the
value you want to use as the HUE_TOKEN. We will also use this value to get the next few
variables.
HUE_SCENE_THEATER:
URL: /api/<token>/scenes
BODY:
GET
In the list find the name of the scene you want to use when plex is playing, right above that is
an the ID of the scene.
Scene ID---> "XTbiuYcEva3weNT": {
"name": "Savanna sunset", <--- Scene Name
"type": "GroupScene",
"group": "1",
"lights": [
"1"
],
HUE_SCENE_DIMMED:
Same thing as above, in the list of scenes find the name of the scene you want when plex is
paused/stopped.
HUE_GROUP_ID:
URL: /api/<token>/groups
BODY:
GET
In the list of groups, find the name of the group you want to use, right above that is the
group ID.
Group ID ----> "1": {
"name": "Theater", <-----Group Name
"lights": [
"1"
],
Also, you are able to hit the API of the hue bridge directly by going to
https://bridge.ip/api//
There are a lot of things to do in there. I'm not a node expert, but I might try to see what I could do.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.