ledge74 / HelloHue

Sync your Philips Hue lights with Plex!
21 stars 6 forks source link

HelloHue

Sync Philips Hue lights with Plex!

Requirements

Warning

This app is the standalone equivalent of the HelloHue.bundle Plex Plugin. This is not a Plex Plugin, as Plugins will be deprecated soon.

Behavior

This application detects when a media is playing, paused or stopped on your Plex Clients. Then it checks the client name, and the user who owns the stream. If it matches your criteria, it triggers your lights with the actions you have set up.

Installation with Node

  1. git clone https://github.com/ledge74/HelloHue.git
  2. cd HelloHue
  3. npm i
  4. npm start

Configure Plex Webhook

Plex needs to send webhooks to HelloHue in order for the channel to work. For example, if HelloHue uses the default port and is on the same machine as your Plex Media Server, the webhook url will be : http://127.0.0.1:4568/

Read this support article in order to learn how to create a Plex webhook

Configure HelloHue

HelloHue api

Three endpoints are available. You may use them to integrate with homebridge or home-assistant for example :

Example docker-compose file

HelloHue is also available as a Docker image

version: "3"

services:
  hellohue:
    container_name: hellohue
    volumes:
      - ./hellohue:/app/db
    ports:
      - "4568:4568"
    environment:
      - TZ=Europe/Paris
    network_mode: host
    restart: unless-stopped

Example homebridge-http integration

Integrate with homebridge and homebridge-http

{
        "accessory": "Http",
        "name": "HelloHue",
        "switchHandling": "yes",
        "http_method": "GET",
        "on_url":      "http://127.0.0.1:4568/api/start",
        "off_url":     "http://127.0.0.1:4568/api/stop",
        "status_url":  "http://127.0.0.1:4568/api/status",
        "service": "Switch",
        "brightnessHandling": "no",
        "brightness_url":     "http://localhost/controller/1707/%b",
        "brightnesslvl_url":  "http://localhost/status/100054",
        "sendimmediately": "",
        "username" : "",
        "password" : ""                     
},

Example Home-Assistant integration

- platform: command_line
  switches:
    hellohue:
      command_on: "/usr/bin/curl -X GET http://127.0.0.1:4568/api/start"
      command_off: "/usr/bin/curl -X GET http://127.0.0.1:4568/api/stop"
      command_state: "/usr/bin/curl -X GET http://127.0.0.1:4568/api/status"
      value_template: '{{ value == "1" }}'
      friendly_name: HelloHue

Support the project

I've developed HelloHue on my free time, so if you like it please think about buying me a beer!