hue-controller
TypeScript icon, indicating that this package has built-in type declarations

1.0.6 • Public • Published

hue-controller

downloads License: MIT

This is the new and improved version of the deprecated philips-hue-controller.

Features

  • Set Lamp Colors using RGB instead of XY / Hue
  • Async / Await
  • Easy to use and setup

Installation

Getting your Bridges IP and generating a Username

Read the Offical Meethue Developer Documentation for a complete explanation: https://developers.meethue.com/develop/get-started-2/

IP-Adress:
Go to https://discovery.meethue.com/ to see your Bridges IP-Adress

Username:
Follow the Steps under: https://developers.meethue.com/develop/get-started-2/#so-lets-get-started

Download Package

npm install hue-controller

Code examples

Inital Setup - using require

const HueController = require('hue-controller').default

const Hue = new HueController({
    "ip": "YOUR-BRIDGES-IP-ADRESS",
    "key": "YOUR-GENERATED-USERNAME"
})

Inital Setup - using import

import HueController from 'hue-controller';

const Hue = new HueController({
    "ip": "YOUR-BRIDGES-IP-ADRESS",
    "key": "YOUR-GENERATED-USERNAME"
})

Lights, Groups and Sensors

Hue.getLights()
.then((lights) => {
    console.log(lights);
})

Hue.getGroups()
.then((groups) => {
    console.log(groups);
})

Hue.getSensors()
.then((sensors) => {
    console.log(sensors);
})

Working with Lights

// Turn a lamp on or off
Hue.changeState(1, false);

// Turn a lamp to full brightness
Hue.changeBrightness(9, 255);

// Set a lamps color to red
Hue.changeColor(9, {r: 255, g: 0, b: 0});

Tutorials

If you made a Tutorial on how to use this Package please DM me on Twitter to have your Video displayed here.

Support

Having an Issue? Join the Discord and we'll help you out!

License

This Project is licensed under the MIT License

Package Sidebar

Install

npm i hue-controller

Homepage

jnsaph.com

Weekly Downloads

0

Version

1.0.6

License

MIT

Unpacked Size

42.5 kB

Total Files

15

Last publish

Collaborators

  • jnsaph