Forge Home

simple_hue

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

7,088 downloads

85 latest version

3.1 quality score

We run a couple of automated
scans to help you access a
module's quality. Each module is
given a score based on how well
the author has formatted their
code and documentation and
modules are also checked for
malware using VirusTotal.

Please note, the information below
is for guidance only and neither of
these methods should be considered
an endorsement by Puppet.

Version information

  • 0.2.1 (latest)
  • 0.2.0
  • 0.1.1
  • 0.1.0
released Jul 29th 2024
This version is compatible with:
  • Puppet Enterprise 2017.2.x, 2017.1.x, 2016.5.x, 2016.4.x
  • Puppet >=4.0.0 <5.0.0

Start using this module

  • r10k or Code Manager
  • Bolt
  • Manual installation
  • Direct download

Add this module to your Puppetfile:

mod 'tphoney-simple_hue', '0.2.1'
Learn more about managing modules with a Puppetfile

Add this module to your Bolt project:

bolt module add tphoney-simple_hue
Learn more about using this module with an existing project

Manually install this module globally with Puppet module tool:

puppet module install tphoney-simple_hue --version 0.2.1

Direct download is not typically how you would use a Puppet module to manage your infrastructure, but you may want to download the module in order to inspect the code.

Download

Documentation

tphoney/simple_hue — version 0.2.1 Jul 29th 2024

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 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.