Giter Site home page Giter Site logo

hueandme's Introduction

Welcome to hueAndMe

The intention of this Python script is to provide an easily implemented Hue Hub emulator w/ UPnP for interfacing with the Amazon Echo (or whatever else may want to speak to a Hue Hub - the original version).

It is of possible interest to Indigo (https://www.indigodomo.com) users, as it can directly import your Indigo devices (assuming you have web services turned on) and make them available via hueAndMe and the Echo.

It is also of interest for Domoticz (https://www.domoticz.com/) users as it imports devices and makes them available to Alexa.

How to use

  1. Download a copy of the repository.
  2. Edit the hueAndMe.cfg file to include devices, and/or point to your Indigo or Domoticz server. (This should be about as self-explanatory as it gets.)
  3. Run the script:
    python hueAndMe.py
  4. Run device discovery on your Amazon Echo (or other device).
  5. Enjoy.

Some notes of interest

  1. If you add URL-based devices in the config file, the dimming URL gets a value between 0-254 passed via substitution of a parameter called {dim}. The examples in the config file show this.
  2. There is some weird limit on Hue devices allowed by the Echo. I don’t know if this is TOTAL devices, or per-hub. I have a real hub, and this simulated hub, and am showing 44 devices total. I’ve set an arbitrary limit of 25 devices pulled from Indigo. This limit is set at the top of devicehandlers/indigoconfig.py. I suspect you could create multiple virtual hubs (multiple copies of this app, bound to different IPs) to get past this limit.
  3. To help with the device limit, you can exclude devices using the exclusions setting for Indigo in the config file. This is just a comma delimited list of device names to ignore. Device names must be in quotes. To disable a device defined in the config file, just add a # before its name. The example devices are both disabled.
  4. If you JUST configure the Indigo URL, username and password, then run this app without changing anything else in the config, it will probably work. Don’t overthink it.
  5. If you want to support something complex on your Indigo server, create a virtual on/off device. Yes, I could update this to look at the groups and whatnot, but I didn’t really see a point when virtual devices work fine and we can’t do much besides on and off with the Echo anyway.
  6. No real error handling currently. Why? Because I’ve got other things to do, but this is likely useful to 1 or 2 people in its current state. It does exactly what I originally wanted it to do, so there :) If I have time, I’ll try to make it prettier.

Running as a service Example for Raspberry Pi

  1. Place the hueAndMe folder in /home/pi
  2. Make sure hueAndMe.py is executable
    sudo chmod +x /home/pi/hueAndMe/hueAndMe.py
  3. Copy the systemd service file to the systemd service folder
    sudo cp /home/pi/hueAndMe/hueAndMe.service /lib/systemd/system
  4. Enable start on boot
    sudo systemctl enable hueAndMe.service
  5. Start the service
    sudo systemctl start hueAndMe.service

Support

I created a Nest plugin years ago for Indigo. It required far too much support. I will try to fix bugs, but no promises. Contact me if you need assistance and I’ll do what I can.

Credit

This project was originally based on hue-upnp by sagen (https://github.com/sagen/hue-upnp). It bears little resemblance to that project at this point.

hueandme's People

Contributors

getsurreal avatar johnray avatar

Stargazers

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

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

hueandme's Issues

Stopping and Restarting sometimes reports port already in use

Not sure why, but after killing the python process and trying to restart it, sometimes it reports the port is already in use. Listing the processes does not show anything running. Usually waiting a few more seconds allows it to start back up. Not sure if there is some error handling that can be added to check for this or something that can ensure the ports get cleaned up faster.

Alexa Increase/Decrease Devices

I want to be able to have Alexa increase and decrease the dimming of lights. Currently it doesn't seem that a dimming change stores the new value. I'm planning on trying to implement it, but for starters I'm not sure how to identify the device ID. Do you have any pointers on the best approach to implement this? I'm also interested in it querying the current value from the controller before sending an update. This way if the device is changed without Alexa, hueAndMe could fetch the current value and know how to adjust from there.

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.