npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

hubot-philipshue

v1.0.5

Published

Control your Philips Hue Lights from HUBOT! BAM, easy candy for the kids

Downloads

75

Readme

hubot-philipshue

This is a Hubot script package that will control your Philips Hue lights.

npm version Node CI

Dependencies

Uses the node-hue-api NPM package to communicate with the hue bridge.

Installation

Run the following command to make sure the module is installed to your local Hubot instance.

$ npm install hubot-philipshue --save

To enable the script, add the hubot-philipshue entry to the external-scripts.json file (you may need to create this file).

["hubot-philipshue"]

Configuration

Environment variables

| Variable | Description | | ------------------ | ------------------------------------------ | | PHILIPS_HUE_HASH | The generated secret hash described below. | | PHILIPS_HUE_IP | The IP address of your Hue Hub. |

export PHILIPS_HUE_HASH="YourSecretHash"
export PHILIPS_HUE_IP="xxx.xxx.xxx.xxx"

Getting your Hue Hash

There is a two-step process to generating the credentials above.

First, press the button on your Hue Hub. This puts the device in a mode to accept new connections.

Second, make an HTTP POST request of the JSON payload below to http://YourHueHub/api. You can use the Clip API Debugger on your base station as well.

$ curl -v -H "Content-Type: application/json" -X POST 'http://YourHueHub/api' -d '{"devicetype": "YourAppName"}'

The Hub will respond with:

{"success":{"username":"YourSecretHash"}}

The username property will contain the hash key to use in the PHIPLIPS_HUE_HASH environment variable.

Troubleshooting

If you have not pressed the button on the Hue Hub you will receive an error like this:

{"error":{"type":101,"address":"/","description":"link button not pressed"}}

Press the link button on the hub and try again.

Commands:

  • hubot hue lights - list all lights
  • hubot hue light {light number} - shows light status
  • hubot hue hsb light {light number} {hue} {saturation} {brightness}
    • hue range: 0-6553
    • saturation range: 0-254
    • brightness range: 0-254
  • hubot hue xy light {light number} {x} {y}
  • hubot hue ct light {light number} {color temp}
    • color temperature values use Mired color temperature
    • color temperature range: 153-500 (153 appears 6500K, 500 appears 2000K)
  • hubot hue turn light {light number} {on|off} - flips the switch
  • hubot hue groups - lists the groups of lights
  • hubot hue config - reads bridge config
  • hubot hue {alert|alerts} light {light number} - blink once or blink for 10 seconds specific light
  • hubot hue {colors|colorloop|loop} {on|off} light {light number} - enable or disable the colorloop effect
  • hubot hue group {group name}=[{comma separated list of light indexes}]
  • hubot hue rm group {group name} - remove grouping of lights named
  • hubot hue @ <on|off> - turn all lights in on or off
  • hubot hue @{group name} hsb=({hue},{sat},{bri}) - set hsb value for all lights in group
  • hubot hue @{group name} xy=({x},{y}) - set x, y value for all lights in group
  • hubot hue @{group name} ct={color temp} - set color temp for all lights in group

Notes:

Author:

kingbin

Contributors:

stephenyeargin

bschlief