Code Monkey home page Code Monkey logo

homebridge-magichome-sync's Introduction

Homebridge and Magic Home logos

Homebridge Magic Home Sync

Sync your Magic Home device to your display and control it all via Homebridge

This Homebridge plugin provides a simple switch that enables and disables a Python script on a host display. The script finds the most dominant colour on the display ands sends it to a Magic Home light.

The result is a much more immersive viewing experience.

Display sync demonstration

Installation

Homebridge

Given that you already have Homebridge installed and set up, you can install this plugin with the following command:

$ sudo npm install -g homebridge-magichome-sync

Host Display

A Python version >= 3 must be used to run the host application.

First you must clone the repository on the host machine using the following command:

$ git clone https://github.com/mjsamuel/Homebridge-MagicHome-Sync.git

After that, to create a virtual environment for all the projects dependencies to be installed into, use the following commands:

# Navigate to the host folder
$ cd Homebridge-MagicHome-Sync/host

# Create a Python virtual environment
$ python -m venv venv

# Activate the virtual environment
$ source ./venv/bin/activate

# Download the requirements
$ pip install -r requirements.txt

Once all the dependencies have been installed, to run the Python script use the following command:

$ python run.py

The Python application can also be configured to run on startup using tools such as forever or launchctl.

Configuration

Settings

  • name is the name for the accessory, default is "Magic Home Sync"
  • host_ip is the IP address of the host device that is running the sync program
  • host_port is the host display port, default is "6006"
  • light_ip is the IP address of the light to be synced with the host
  • light_type is the Magic Home device type, being either "RGB", "RGBW" or" RGBWW", default is "RGBW"
  • polling interval is the interval in seconds that the lights are updated in, default is 1

Example Configuration

"accessories": [
    {
        "accessory": "MagicHomeSync",
        "name": "MH Sync",
        "host_ip": "192.168.2.128",
        "host_port": 6006,
        "light_ip": "192.168.2.129",
        "light_type": "RGBWW",
        "polling_interval": 0.5
    }
]

Acknowledgements

Many thanks to:

  • Danielhiversen for his flux_led project which was stripped down and used to interface with Magic Home devices

homebridge-magichome-sync's People

Contributors

mjsamuel avatar

Stargazers

 avatar  avatar

Watchers

 avatar

homebridge-magichome-sync's Issues

Works?

Greetings.
Ive been looking for something like this, to get my LED strips somewhat more integrated with my pc and its lights.
Since i didnt found anything to make it work with Razer, this is still fine.
But some issues i got.
Ive got a few led strips, my default RGB ones ( 4 wires ) do work , even tho it looks like mostly it puts white,
Is there a way to add Brightness to the values sent ?
Aswell as maybe the selection of the screen thats beeing grabbed .

My second led strips ( Adressable RGB's , one from within a pack with a "Magic home wifi controler" and one strip from BTFLighting ) do not work, I put in the right IP, but the led strip doesnt react at all.
Even if i change it to RGBW / WW

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.