GithubHelp home page GithubHelp logo

plexhue's Introduction

plexHue

Program to integrate Plex with the Philips Hue.

Introduction

This program is meant to sync your Philip Hue lightbulbs with your Plex playback. It does the following:

  1. Slowly dims your lights until they are off whenever a movie starts.
  2. Brings your lights to half-brightness when a movie is paused.
  3. Slowly brightens your lights when a movie is stopped until it is at full brightness.

Video: https://www.youtube.com/watch?v=W3FJ6tHxiDg

Prerequisites

  1. Ruby installed (at least version 1.9.3) and ruby-dev.
  2. Your Philip Hue Hub up and configured.
  3. A PlexPass membership (Sorry about this, but the API to see when something is played is a PlexPass feature :( )

Installation (Debian/Ubuntu)

  1. Change to the /opt directory.

  2. Clone this repo on your server:

    git clone https://github.com/bstascavage/plexHue.git

  3. Change to the plexHue directory

  4. Install the blunder gem (http://bundler.io/)

    gem install bundler

  5. Install the gem dependecies:

    bundle install

  6. Copy the init script to your init.d directory:

    cp debian/init/plexHue /etc/init.d/plexHue

  7. Setup your config file (see below for details on parameters)

  8. Press the HOME button on your Philips Hue Hub

  9. Start the plexHue service

    service plexHue start

  10. Check the plexHue log to ensure that the program paired with your hub:

`tail -f plexHue.log`

Config file

plex

server - IP address of your Plex server. Defaults to localhost. Optional.

machineIdentifier - Unique identifier of your Plex client. You can find this by starting up a video on your device and then running bin/getMachineID.rb and finding your device in the output. Required.

api_key - Your Plex API key. This can be found by searching for your device here (it is the 'token' field): https://plex.tv/devices.xml. Required.

hue

hub_ip - IP addres of your Philips Hue Hub. You can get this by visiting http://www.meethue.com/api/nupnp while on the same network as your hub. Required.

starttransitiontime - How long it takes to dim the lights when starting a video, in multiples of 100ms. Defaults to 3 seconds. Optional.

pausedtransitiontime - How long it takes to brighten the lights when pausing a video, in multiples of 100ms. Defaults to 3 seconds. Optional.

stoptransitiontime - How long it takes to brighten the lights when stopping a video, in multiples of 100ms. Defaults to 3 seconds. Optional.

lights - Array of names of the lights you want to use, in the format: ["light1", "light2", "light3"]. Required.

Notes

  1. This software is still in alpha. There are plenty of features and options that I plan on implementing, plus more streamlined support for different OSes. Bug fixes take priority over features. If you have any issues, or anything you'd like added, please open a Github issue.
  2. This program is developed with the Hue Lux bulbs, though regular Hue bulbs should work just fine. Because of that, there is no support for color at the moment. This might change down the road, but not anytime soon.

plexhue's People

Contributors

bstascavage avatar djryan avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

plexhue's Issues

Color Bulb support

small change to your code, makes hue color bulbs go from playing (dark red) to warm white ( pause / stopped)

def transition(state)
if state == 'playing'
self.class.put("groups/#{self.getPlexGroup}/action", :body => "{"on":true, "hue":0, "sat":254, "bri":5, "transitiontime":#{$config['hue']['starttransitiontime']}}")
elsif state == 'paused'
self.class.put("groups/#{self.getPlexGroup}/action", :body => "{"on":true, "ct":500, "bri":128, "transitiontime":#{$config['hue']['pausedtransitiontime']}}")
elsif state == 'stopped'
self.class.put("groups/#{self.getPlexGroup}/action", :body => "{"on":true, "ct":500, "bri":255, "transitiontime":#{$config['hue']['stoptransitiontime']}}")
end
end
end

PlexHue failed to start

Hi,

I got an issue when I'm trying to start PlexHue,

service plexHue start
Starting PlexHue
service plexHue status
[FAIL] plexHue is not running ... failed!

Just some questions

Hello,

Very nice job ! i've just some question.

  • Is it possible to configure multiple plex clients ? because i'm using sometime the Chromecast, and sometime Plex for PS4.
  • Is it possible to set the unique ID of the Light in the config file ? Because I think the name of the light is not the right way.

Thanks

FreeBSD support

Support for FreeBSD for Plex Media Servers running on this and FreeNAS. Currently will not run due to use of rc.d rather than init.d.

Absolute path in plexHue DAEMON

When trying to start the plexHue service there is an error because the path is referring to:
DAEMON=/home/bstascav/plexHue/bin/plexHue.rb

The /home/bstascav bit should be relative

Remember state of lights

Suggested feature: Remember the state (brightness) of the lights so when turned on again they are at the same brightness level as when turned off.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.