Integration of MiLight, LimitlessLED, Easybulb, etc (2 methods)

Since it was brought to my attention that the limitlessled.com site is down, here’s a backup of the different codes pulled from a snapshot of limitlessled.com/dev:

// Source: http://www.limitlessLED.com/dev
// Copyright (2013) Limitless Designs
// If the commandset codes are utilized in any way, the limitlessLED website url must remain in the code comments.
v4.0 Now contains a more advanced wifi chip that supports Wireless-N (802.11 b/g/n) and wireless b or g.
• Wifi Lights Wifi Bridge Reciever 4.0 is backwards compatible with v3.0
• Same port 8899, you can UDP broadcast to 10.1.1.255 or 255.255.255.255 if you want all wifi bridges to receive the command on the LAN.
• Now supports Wireless-N
• Now supports wireless router outages, and auto reconnects.
• We have disabled the web admin on the new wifi bridge receiver. The Web Admin is no longer available in v4.0 of bridges using http://10.10.100.254/home.html
• If you want to configure a static ip address you can set this via mac address on your wireless router.
DETAILED DEVELOPER TECHNICAL SPECIFICATIONS
Connect iPhone/iPad direct to WiFi Bridge Receiver: Yes (WiFi adhoc AP mode)
Connect WiFi Bridge Receiver to LAN: Yes (WiFi infrastructure STA mode)
Wifi Bridge Router Web Config: http://10.10.100.254/home.html Username: admin Password: admin
IP Address: 10.10.100.254 (editable)
Port: 8899 (editable)
TCP/IP Mode: UDP (udp is what online games use, it is very fast and has the lowest latency)

If the app doesn’t allow you to scan and find the SSID for your home network, you can use the Web User Interface to configure Wifi Bridge 3.0 STA settings on http://10.10.100.255/home.html with the username:admin password:admin
The IP Address is now assigned automatically using DHCP. You can find the current IP address of your wifi bridge in your routers DHCP table with the same MAC address as displayed on the Wifi Lights App 3.0 first network scan screen. Or you can broadcast UDP command packets to all wifi bridges on your local network, by changing the last digit in the IP address to 255, i.e. 10.1.1.255
Port Number: 8899

RGB+W Wifi Lights Light Bulb Commands
All UDP Commands are 3 Bytes.
First byte is from the list below, plus a fixed 2 byte suffix of 0x00 (decimal:
0) and 0x55 (decimal: 85)

i.e. to turn all RGBW COLOR Wifi Lights Smart
lights to ON then send the TCP/IP UDP packet of: 0x42 0x00 0x55

Hexidecimal (byte)         Decimal      (integer – Always 0x55)

RGBW COLOR LED ALL OFF 0x41 65

RGBW COLOR LED ALL ON 0x42 66

DISCO SPEED SLOWER 0x43 67

DISCO SPEED FASTER 0x44 68

GROUP 1 ALL ON 0x45 69 (SYNC/PAIR RGB+W Bulb within 2 seconds of Wall Switch Power being turned ON)

GROUP 1 ALL OFF 0x46 70

GROUP 2 ALL ON 0x47 71 (SYNC/PAIR RGB+W Bulb within 2 seconds of Wall Switch Power being turned ON)

GROUP 2 ALL OFF 0x48 72

GROUP 3 ALL ON 0x49 73 (SYNC/PAIR RGB+W Bulb within 2 seconds of Wall Switch Power being turned ON)

GROUP 3 ALL OFF 0x4A 74

GROUP 4 ALL ON 0x4B 75(SYNC/PAIR RGB+W Bulb within 2 seconds of Wall Switch Power being turned ON)

GROUP 4 ALL OFF 0x4C 76

DISCO MODE 0x4D 77

SET COLOR TO WHITE (GROUP ALL) 0x42 100ms followed by: 0xC2

SET COLOR TO WHITE (GROUP 1) 0x45 100ms followed by: 0xC5

SET COLOR TO WHITE (GROUP 2) 0x47 100ms followed by: 0xC7

SET COLOR TO WHITE (GROUP 3) 0x49 100ms followed by: 0xC9

SET COLOR TO WHITE (GROUP 4) 0x4B 100ms followed by: 0xCB
WIFI LIGHTS RGBW DIRECTLY SETTING THE BRIGHTNESS is by a 3BYTE COMMAND: (First send the Group ON for the group you want to set the brightness for. You send the group ON command >=100ms before sending the 4E 1B 55)
Byte1: 0x4E (decimal: 78)
Byte2: 0×02 to 0x1B (decimal range: 2 to 27) full brightness 0x1B (decimal: 27)
Byte3: Always 0×55 (decimal: 85)
WIFI LIGHTS RGBW COLOR SETTING is by a 3BYTE COMMAND: (First send the Group ON for the group you want to set the colour for. You send the group ON command >= 100ms before sending the 40)
Byte1: 0×40 (decimal: 64)
Byte2: 0×00 to 0xFF (255 colors) See Color Matrix Chart for the different values below.
Byte3: Always 0×55 (decimal: 85)

Byte2: Color Matrix Chart: (thanks Stephan Schaade, http://knx-user-forum.de http://mknx.github.io/smarthome/)

Note: there are more colours (0-255) in between, this color chart is just steps of 16.
0x00 Violet
0x10 Royal_Blue
0x20 Baby_Blue
0x30 Aqua
0x40 Mint
0x50 Seafoam_Green
0x60 Green
0x70 Lime_Green
0x80 Yellow
0x90 Yellow_Orange
0xA0 Orange
0xB0 Red
0xC0 Pink
0xD0 Fusia
0xE0 Lilac
0xF0 Lavendar

Thanks Andrew Badge, here is another copy of the colour chart, The last column (HTML colour code) is used for rendering onscreen previews.
Note: the names are modified to match the websafe names as well.

        table.Rows.Add("Violet",0x00,"#EE82EE");
        table.Rows.Add("RoyalBlue",0x10,"#4169E1");
        table.Rows.Add("LightSkyBlue", 0x20,"#87CEFA");
        table.Rows.Add("Aqua",0x30,"#00FFFF");
        table.Rows.Add("AquaMarine", 0x40,"#7FFFD4");
        table.Rows.Add("SeaGreen",0x50,"#2E8B57");
        table.Rows.Add("Green",0x60,"#008000");
        table.Rows.Add("LimeGreen",0x70,"#32CD32");
        table.Rows.Add("Yellow",0x80,"#FFFF00");
        table.Rows.Add("Goldenrod",0x90,"#DAA520");
        table.Rows.Add("Orange",0xA0,"#FFA500");
        table.Rows.Add("Red",0xB0,"#FF0000");
        table.Rows.Add("Pink",0xC0,"#FFC0CB");
        table.Rows.Add("Fuchsia", 0xD0,"#FF00FF");
        table.Rows.Add("Orchid",0xE0,"#DA70D6");
        table.Rows.Add("Lavender",0xF0,"#E6E6FA");

WARM WHITE/COOL WHITE Wifi Lights Smartbulb WIFI TCP/IP UDP COMMANDS
Hexidecimal (byte) Decimal (integer)

WHITE LED ALL OFF 0x39 57

WHITE LED ALL ON 0x35 53

BRIGHTNESS UP ` 0x3C 60

BRIGHTNESS DOWN 0x34 52

WARM WHITE INCREASE 0x3E 62

COOL WHITE INCREASE 0x3F 63

GROUP 1 ALL ON 0x38 56

GROUP 1 ALL OFF 0x3B 59

GROUP 2 ALL ON 0x3D 61

GROUP 2 ALL OFF 0x33 51

GROUP 3 ALL ON 0x37 55

GROUP 3 ALL OFF 0x3A 58

GROUP 4 ALL ON 0x32 50

GROUP 4 ALL OFF 0x36 54

NIGHT MODE ALL 0x39 100ms followed by: 0xB9

NIGHT SAVER MODE GROUP 1 0x3B 100ms followed by: 0xBB

NIGHT SAVER MODE GROUP 2 0x33 100ms followed by: 0xB3

NIGHT SAVER MODE GROUP 3 0x3A 100ms followed by: 0xBA

NIGHT SAVER MODE GROUP 4 0x36 100ms followed by: 0xB6

FULL BRIGHTNESS ALL 0x35 100ms followed by: 0xB5

FULL BRIGHTNESS GROUP 1 0x38 100ms followed by: 0xB8

FULL BRIGHTNESS GROUP 2 0x3D 100ms followed by: 0xBD

FULL BRIGHTNESS GROUP 3 0x37 100ms followed by: 0xB7

FULL BRIGHTNESS GROUP 4 0x32 100ms followed by: 0xB2
Night modes, not implemented for RGBW, but referenced here for completeness.
NIGHT MODE ALL 0x41 100ms followed by: 0xC1 (not implemented in Wifi Lights wifi bridge 3.0)
NIGHT SAVER MODE GROUP 1 0x46 100ms followed by: 0xC6 (not implemented in Wifi Lights wifi bridge 3.0)
NIGHT SAVER MODE GROUP 2 0x48 100ms followed by: 0xC8 (not implemented in Wifi Lights wifi bridge 3.0)
NIGHT SAVER MODE GROUP 3 0x4A 100ms followed by: 0xCA (not implemented in Wifi Lights wifi bridge 3.0)
NIGHT SAVER MODE GROUP 4 0x4C 100ms followed by: 0xCC (not implemented in Wifi Lights wifi bridge 3.0)

Special NOTE #1: The Wifi Lights bulb remembers its own Brightness setting memory separately for ColorRGB and separately for White. For example dimming Green, then switching to White full brightness, and when you go back to a specific color the brightness returns to what the ColorRGB was before. Same vice versa for the White. The previous brightness setting is remembered specifically for the White and specifically for the ColorRGB.
Special Note #2: for Java: To convert from a decimal number to a signed byte use the 0xFF like this: cmdBytes[0] = 85 & 0xFF;
Special Note #3: for Visual Basic: To use a hexadecimal number, you can put &H in front instead of 0x for example: 0x41 would be &H41
Special Note #4: If you don’t know the IP address of the Wifi Bridge, You can also broadcast All Groups ON to all wifi bridges on the LAN network by using the IP address with the last number as .255 or you can use the IP address of 255.255.255.255, which will do a full LAN broadcast to all wifi bridges on this Local network only.
Special Note #5: With the new Wifi Lights Wifi Bridge 3.0 it is no longer necessary to send the 3rd byte (0x55) in the UDP packet, you can just send the 1st and 2nd bytes which will be faster, this also applies to the backward compatible RGB and DUAL White LEDs when using wifi bridge 3.0. But to remain backwards compatible with wifi bridge 2.0 it is advisable to always send the 3rd byte 0x55 in the UDP packet for RGB and WHITE bulbs, but it is not necessary to send 3 bytes for the new RGBW bulbs(just two is ok for them).
Special Note #6: To Clear the PAIRED/SYNCED bulb from all of its Groups… Press-And-Hold its Group ON button within 2 seconds of turning the light socket power ON.
Wifi Lights v4.0 Wifi Bridge Control Commandset
After resetting the wifi bridge, the ip address is 10.10.100.254 and the admin UDP port is 48899
if the wifi bridge has already been connected to your lan via dhcp, you can use the direct ip if known, or just use the broadcast address 10.1.1.255 on your subnet and use the Admin UDP port number 48899.
The ADMIN commands allow you to scan and find wifi bridges and set wifi lan SSIS/PW setups direct via your app.
Send the string via UDP, and wait for the UDP response of “+ok”
AT+WSCAN\r
AT+WSSSID=mySSIDname\r
+ok
AT+WSKEY=WPA2PSK,AES,password123\r
+ok
AT+WMODE=STA\r
+ok
AT+Z\r
+ok
The first time the bridge is set-up you connect the phone directly to the bridge’s wifi, then send the WSCAN command to find either the wifi’s that the bridge can detect? If you already know the Wifi SSID, you can skip that step and just use the WSSSID command. replace mySSIDname with the SSID you want to use. replace password123 with your wifi password.
Example VB.NET Code
Dim listenPort As Integer = 48899
udpSocket = New UdpClient(txtIPAddress.Text, listenPort)
Dim b As Byte() = New Byte() {&H41, &H54, &H2B, &H57, &H41, &H4E, &H4E, &HA}
udpSocket.Send(b, b.Length)
Dim client As New UdpClient(48899)
Dim groupEP As New IPEndPoint(IPAddress.Any, _PortNumber)
Dim state As New UdpState(client, groupEP)
’ Start async receiving
udpSocket.BeginReceive(New AsyncCallback(AddressOf DataReceived), state)

Private Shared Sub DataReceived(ByVal ar As IAsyncResult)
    Dim c As UdpClient = DirectCast(DirectCast(ar.AsyncState, UdpState).c, UdpClient)
    Dim wantedIpEndPoint As IPEndPoint = DirectCast(DirectCast(ar.AsyncState, UdpState).e, IPEndPoint)
    Dim receivedIpEndPoint As New IPEndPoint(IPAddress.Any, 0)
    Dim receiveBytes As [Byte]() = c.EndReceive(ar, receivedIpEndPoint)

    ' Check sender
    'Dim isRightHost As Boolean = (wantedIpEndPoint.Address.Equals(receivedIpEndPoint.Address)) OrElse wantedIpEndPoint.Address.Equals(IPAddress.Any)
    'Dim isRightPort As Boolean = (wantedIpEndPoint.Port = receivedIpEndPoint.Port) OrElse wantedIpEndPoint.Port = 0
    'If isRightHost AndAlso isRightPort Then
    ' Convert data to ASCII and print in console
    Dim receivedText As String = System.Text.Encoding.UTF8.GetString(receiveBytes)
    Debug.Print(receivedText) 'Console.Write
    'End If

    ' Restart listening for udp data packages
    c.BeginReceive(New AsyncCallback(AddressOf DataReceived), ar.AsyncState)

End Sub

OpenSource Projects
CasualLight Voice Control of Wifi Lights Lights. by Joris studying at Waikato University, New Zealand.


Windows7/8 OpenSource Wifi Lights Application (commandline app written in Microsoft C#.Net).
https://github.com/qyiet/limitlessled by Glen Balks from New Zealand.
HTML/Javascript Wifi Lights Application (ninjablocks).
https://github.com/jzGreen/ninja-limitlessled
Youtube: NinjaBlocks/limitlessled and RFID
Youtube: limitlessled Wifi Lights and ninja blocks
cloverleaf Wifi Lights Ruby github opensource by brandon
https://github.com/brandon-dacrib/cloverleaf/blob/master/app/helpers/limitlessled-rgb.rb
Now you can control your Wifi Lights on Android using AutoVoice and Tasker/Locale.
Wifi Lights LightShow made in Perl programming language by Prof. Matt Carter from Bond University
https://github.com/hash-bang/Lightshow
provides a simple command line program to command the lighting system as well as also supports easy to program lighting macros - fake fire place lighting, time-of-day settings etc.
Matt is also working on an XBMC/BoxEE plugin for media centers so that you can control the lights from your TV. Great work Matt, look forward to this one.
Jon Benson from Australia has built this great Tasker For Android app.
Tasker stays in memory when launched once, so it displays almost instantly.
The current app (which simply allows sending UDP packets by acting as a plugin for Tasker/Locale) is free and will remain so.
Here is the Github webpage:
http://hastarin.github.io/android-udpsender/
and here is the Play Store link:
https://play.google.com/store/apps/details?id=com.hastarin.android.udpsender
To give you an idea of how it can be used, Jon has set this up so far…
• Gesture control via my launcher (Nova) to turn all lights on/off/full bright/night mode and dim/brighten lights.
• Using the Scene shown above I can turn all/individual zones on/off and control bright/dim/warm/cool.
• NOTE: A swipe up/down in the colored square controls a bright/dim ramp and left/right for warm/cool.
• An NFC tag on my bed that when tapped will turn the lights off, or keep some in night mode if I have guests.
• When my phone connects to the Wi-Fi, and it’s between sunrise and sunset, my entry hall light is turned on.

Instructions for Tasker

  • Download Full Tasker For Android ($1.99) through Play store. You will also need ‘Autovoice’ (Tasker plugin), and it is worth getting ‘UDP Sender’ to test you codes. If you would like to make turn your tasker projects into apps, also get ‘Tasker App Factory’
  1. Go into your router and find out what the IP address is for your Wifi Bridge (you should see this in your DHCP Table in the router. The IP Address is now assigned automatically using DHCP. You can find the current IP address of your wifi bridge in your routers DHCP table with the same MAC address as displayed on the Wifi Lights App 3.0 first network scan screen. Or you can broadcast UDP command packets to all wifi bridges on your local network, by changing the last digit in the IP address to 255, i.e. 10.1.1.255. If you can try to lock the IP address so that it will not change.
  2. Once you know the IP address go into Tasker and under the TASK tab add a task. Give it a name, then add an action.
  3. Either search “intent” or go into ‘Misc’ and select SEND INTENT
  4. Now under ‘Action’ type – android.intent.action.SENDTO (pay attention to capitals)
  5. In data field type – udp://192.168.1.6:8899/0x350055
    (this is the IP address for your bridge) (Port No.) (Command Code – See list below)
  6. Go to the bottom of this page and change Target field from ‘Broadcast Receiver’ to ‘Action’
  7. If you now exit you should be able to press the play button and see the result.
    If it doesn’t work try this: Check the IP address
    Check for spelling mistakes and ensure there are no spaces
    Test the code in UDP sender to make sure you have it correctly
    For BRIGHTNESS, NIGHTLIGHT MODE, and COLOUR CHOOSING, you must send a prefix code (as seen in the table below) 100ms or more before sending the code you want
    Make sure TARGET is set to ‘ACTIVITY’
    Try repeat the play button (it is always worth adding repeat codes in the actions to ensure that they get picked up by the bridge)
    Ensure the commend code has “0x” at the beginning of Command Code
    Now using the “Profiles” tab on the first page of tasker you can set voice control.
  8. select ‘Add’ and choose ‘State’ Then in ‘Plugin’ choose ‘Autovoice Regonised’.
  9. Under configuration select ‘Event Behaviour’ (tick) and enter your ‘Command Filter’. This might be “Lights On”
  10. Press back and then select the Task to assign to your new Profiles.
  11. You should now be able to use your Google Voice Search to activate that profile using your command “Lights On”. This should be done using the google search WIDGET
    This is a very basic run and the list of possibilities is endless. Watch some Tasker For Android tutorials and you will start to see the potential for this app here are some ideas of what you could do.
  • Lights turn on when your phone connect to your wifi between sunset and sunrise
  • Lights turn on at set times, but only if you are home (or use sunset times by getting info from a met website daily-this can be done automatically)
  • Remake the app using ‘scenes’
  • Export your actions as Apps
  • Much much more!..
    Summary of Codes (send all 3 hex commands via port 8899 UDP to ip address of the wifi bridge receiver)
    Wifi Lights White

35 00 55 - All On
39 00 55 - All Off
3C 00 55 - Brightness Up
34 00 55 - Brightness Down (There are ten steps between min and max)
3E 00 55 - Warmer
3F 00 55 - Cooler (There are ten steps between warmest and coolest)
38 00 55 - Zone 1 On
3B 00 55 - Zone 1 Off
3D 00 55 - Zone 2 On
33 00 55 - Zone 2 Off
37 00 55 - Zone 3 On
3A 00 55 - Zone 3 Off
32 00 55 - Zone 4 On
36 00 55 - Zone 4 Off
B5 00 55 - All On Full (Send >=100ms after All On)
B8 00 55 - Zone 1 Full (Send >=100ms after Zone 1 On)
BD 00 55 - Zone 2 Full (Send >=100ms after Zone 2 On)
B7 00 55 - Zone 3 Full (Send >=100ms after Zone 3 On)
B2 00 55 - Zone 4 Full (Send >=100ms after Zone 4 On)
B9 00 55 - All Nightlight (Send >=100ms after All Off)
BB 00 55 - Zone 1 Nightlight (Send >=100ms after Zone 1 Off)
B3 00 55 - Zone 2 Nightlight (Send >=100ms after Zone 2 Off)
BA 00 55 - Zone 3 Nightlight (Send >=100ms after Zone 3 Off)
B6 00 55 - Zone 4 Nightlight (Send >=100ms after Zone 4 Off)
Wifi Lights RGBW

41 00 55 - All Off
42 00 55 - All On
43 00 55 - Speed Down (One Step Slower Disco)
44 00 55 - Speed Up (One Step Faster Disco)
45 00 55 - Zone 1 On
46 00 55 - Zone 1 Off
47 00 55 - Zone 2 On
48 00 55 - Zone 2 Off
49 00 55 - Zone 3 On
4A 00 55 - Zone 3 Off
4B 00 55 - Zone 4 On
4C 00 55 - Zone 4 Off
4D 00 55 - One Step Disco Mode Up (20 Disco Modes)
42 00 55 wait 100ms then send C2 00 55 - All Zones Change back to Warm White.
45 00 55 wait 100ms then send C5 00 55 - Zone 1 Change back to Warm White.
47 00 55 wait 100ms then send C7 00 55 - Zone 2 Change back to Warm White.
49 00 55 wait 100ms then send C9 00 55 - Zone 3 Change back to Warm White.
4B 00 55 wait 100ms then send CB 00 55 - Zone 4 Change back to Warm White.
42 00 55 wait 100ms then send 4E XX 55 - Set All to Brightness XX (XX range is 0x02 to 0x1B) – See SETTING BRIGHTNESS
45 00 55 wait 100ms then send 4E XX 55 - Set Zone 1 to Brightness XX (XX range is 0x02 to 0x1B)
47 00 55 wait 100ms then send 4E XX 55 - Set Zone 2 to Brightness XX (XX range is 0x02 to 0x1B)
49 00 55 wait 100ms then send 4E XX 55 - Set Zone 3 to Brightness XX (XX range is 0x02 to 0x1B)
4B 00 55 wait 100ms then send 4E XX 55 - Set Zone 4 to Brightness XX (XX range is 0x02 to 0x1B)
42 00 55 wait 100ms then send 40 XX 55 - Set All to Color XX (XX range is 0x00 to 0xFF) - See SETTING COLOUR
45 00 55 wait 100ms then send 40 XX 55 - Set Zone 1 to Color XX (XX range is 0x00 to 0xFF)
47 00 55 wait 100ms then send 40 XX 55 - Set Zone 2 to Color XX (XX range is 0x00 to 0xFF)
49 00 55 wait 100ms then send 40 XX 55 - Set Zone 3 to Color XX (XX range is 0x00 to 0xFF)
4B 00 55 wait 100ms then send 40 XX 55 - Set Zone 4 to Color XX (XX range is 0x00 to 0xFF)

3 Likes