Skip to content
This repository has been archived by the owner on Mar 27, 2021. It is now read-only.
/ diyHueLightApi Public archive

A simple library to program lights for the diyHue platform in Java

Notifications You must be signed in to change notification settings

TecCheck/diyHueLightApi

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 

Repository files navigation

diyHueApi

A simple library to program lights for the diyHue platform in Java

This Library requires

To make a light add a new Class

public class YourLight extends DiyHueLight {

	public YourLight(String name, int lightID, boolean doDebug) {
		//name, lightId, doDebug, port
		super(name, lightID, doDebug, 25566);
	}

	@Override
	public void onUpdate(int lightID, int r, int g, int b, boolean lightState) {
		//lightState shows if the light ison or off
		System.out.println("Light " + lightID + ": R:" + r + ", G:" + g + ", B:" + b);
	}

}

Then create an instance of it and add that to the HttpServer

YourLight light = new YourLight();
HttpServer.add(light);

If the diyHue bridge can't find your lights you can add them manually The two important things to change are the ip adress and the light number (it shold match the light id) You can specify the port together with the ip adress (like 192.168.178.20:8080) ip:port

"lights": {
        "1": {
            "config": {
                "archetype": "sultanbulb",
                "direction": "omnidirectional",
                "function": "mixed",
                "startup": {
                    "configured": false,
                    "mode": "safety"
                }
            },
            "manufacturername": "Philips",
            "modelid": "LCT015",
            "name": "LIGHT NAME HERE",
            "state": {
                "alert": "select",
                "bri": 254,
                "colormode": "hs",
                "ct": 0,
                "effect": "none",
                "hue": 0,
                "on": false,
                "reachable": false,
                "sat": 0,
                "transitiontime": 9,
                "xy": [
                    0,
                    0
                ]
            },
            "swversion": "1.46.13_r26312",
            "type": "Extended color light",
            "uniqueid": "00:17:88:01:00:7d:78:f4-0b"
        }
    },
    "lights_address": {
        "1": {
            "ip": "IP OF THE LIGHT HERE",
            "light_nr": 1,
            "mac": "74:D4:35:2F:88:9A",
            "protocol": "native"
        } 
    },

About

A simple library to program lights for the diyHue platform in Java

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Languages