Skip to content

Home automation with Nexlux LED & MagicHue lights in JAVA

Notifications You must be signed in to change notification settings

hariohmprasath/magic-hue-java

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Home automation with Nexlux LED & MagicHue lights in JAVA

This program supports various controlling aspects of this Wifi enabled LED lights.

##Supported operations

Operations Sample values
Turn On
Turn Off
Set color (RGB) 100,100,100
Set Warm 150
Set Cool 200
Get Status Output: {status=OFF, rgb=0,0,0, warm=0}

Note: IP address of the LED light is passed in as an argument for all these operations.

Hardware

Implementation

  • Java sockets are used to connect send request to the IP address assinged to these LED lights
  • Here are the HEX codes sent across for each operations:
Operations Hex values
Turn On 71:23:0f
Turn Off 71:24:0f
Set color (RGB) RGB converted to hex
Set Warm 31:00:00:00:Warm_value:0f:0f
Set Cool 31:00:00:00:00:Cold_value:0f
Get Status 81:8a:8b:96
Note: Code implementation can found inside "MagicHeuHelper.java"

Maven

<repository>
  <id>repsy</id>
  <name>repsy</name>
  <url>https://repo.repsy.io/mvn/hariohmprasath/magic-hue</url>
</repository>

<dependency>
    <groupId>org.example</groupId>
    <artifactId>magic-hue-java</artifactId>
    <version>1.0-SNAPSHOT</version>
</dependency>

Code snippets

Operations Hex values
Turn On MagicHueHelper.turnOn(IP_ADDRESS)
Turn Off MagicHueHelper.turnOff(IP_ADDRESS)
Set color (RGB) MagicHueHelper.setRgb(IP_ADDRESS, "100,100,100")
Set Warm MagicHueHelper.setWarm(IP_ADDRESS, "150")
Set Cool MagicHueHelper.setCool(IP_ADDRESS, "200")
Get Status MagicHueHelper.getStatus(IP_ADDRESS)

Credits

Thanks to excellent documentation by @kirillsimin part of his contribution in (https://github.com/kirillsimin/magichue). I was able to create a java version for this.

Releases

No releases published

Packages

No packages published

Languages