Skip to content

tphoney/simple_hue

Repository files navigation

simple_hue

Table of Contents

  1. Module Description - This module controls the Philips hue
  2. Setup - The basics of getting started with [modulename]
  3. Usage - Configuration options and additional functionality
  4. Reference - An under-the-hood peek at what the module is doing and how
  5. Limitations - OS compatibility, etc.
  6. Development - Guide for contributing to the module
  7. Feedback - Get in touch !

Module description

The philips Hue is a hub that controls wirelessly connected lightbulbs. This module allows you to connect to the hub and control the lightbulbs. The purpose of this module is for teaching, and providing a simple framework to start development with. simple_hue will not get any new features, the smart_hue module exposes more features in the philips hue.

Setup

### What the simple hue affects

-Changes the state of light bulbs connected to the philips hue.

Setup requirements

  • a philips hue hub
  • a philips hue light bulb or compatible
  • a puppet agent

Beginning with simple_hue

These two attributes are needed for puppet to control the philips hue hub: DEVELOPER_KEY: Grab a developer key from your hue hub, follow the steps here: http://www.developers.meethue.com/documentation/getting-started DEVELOPER_ID: Find the IP / hostname of your hue hub. Use a uPNP scanner, Nmap, your router / DHCP logs.

We use environment variables to store this. On a Ubuntu box we would set them like export HUE_KEY=pUAUbcowosjBKgE5VQTrD6kkfkfoQK1ZtN14pHl8; export HUE_IP=10.64.12.162

Usage

Your puppet manifest file that turns the first light on would look something like: hue_light { '1': on => 'true', hue => '0', }

To apply the manifest run the following (you will need to have set some environment variables mentioned above)

puppet apply manifest.pp

Query the hue hub

Run the following: (you will need to have set some environment variables mentioned above) puppet resource hue_light

Reference

Limitations

There are no known limitations. Currently only tested on Ubuntu, developed on the mac.

Development

This is a simple module designed for teaching, this is not the place for new features. Fixes or improvements to hat is already here, are welcome.

Running the acceptance tests

  • Get virtual box installed
  • Get vagrant installed
  • clone the repo 'git@github.com:tphoney/simple_hue.git'
  • grab the necessary gems 'bundle install --path .bundle/gems/'
  • run 'bundle exec rake acceptance' and set the necessary environment variables
  • profit !!!

Stopping the VM from dissapearing when the tests run

  • alternately run 'BEAKER_provision=yes BEAKER_destroy=no bundle exec rspec spec/acceptance' NB make sure the environment variables are set

Feedback

Feel free to leave issues or PR's on the github page.

About

A puppet module that controls the philips hue. It is designed for teaching purposes.

Resources

License

Stars

Watchers

Forks

Packages

No packages published