Skip to content

Perl script for automatically restoring Philips Hue bulbs to their previous state after a power failure.

License

Notifications You must be signed in to change notification settings

kluzzebass/huebro

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 

Repository files navigation

Note! This script is now deprecated, as all Hue bulbs can be configured to restore their previous settings on power on.

huebro

Perl script for automatically handling/restoring Philips Hue bulbs after returning from a power failure.

Easy setup (on unix):

  1. Edit the BRIDGE constant near the top of the script, and change the IP address to point at your own bridge.
  2. Edit the MAGIC_NUMBER constant near the top of the script, specifying how many "Extended color light" bulbs need to be in the default power on state for the script to start restoring the state of all the lights. 3-4 seem like good numbers, but it depends entirely on your situation.
  3. Press the link button on your Hue Bridge, and run huebro.pl -v reg, and the script should now have access to your bridge.
  4. Run huebro.pl -v check to grab an initial snapshot of your lights. You should see some action on screen.
  5. Set up a cron job that runs huebro.pl check periodically (once every minute seems ok).
  6. Make some changes to your lights, and keep an eye on the ~/.huebro/huebro.log file to see what's happening.

If you run into problems, use the -v and -d options, and try the huebro.pl current command to see what's going on. If you still can't figure it out, it's time to start reading the code.

Dependencies

The following perl modules are needed by huebro:

  • DBI
  • DBD::SQLite
  • LWP::UserAgent
  • JSON

If you're on Debian (or Ubuntu, or Raspbian) you can install these by running the following command:

sudo apt-get install libwww-perl libjson-perl libdbi-perl libdbd-sqlite3-perl

About

Perl script for automatically restoring Philips Hue bulbs to their previous state after a power failure.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages