LW12 Protocol and Python Package

For my new flat I wanted controllable RGB LED stripes. Problem is, most of the controllable cheap ones only have IR remotes, so the receiver must be in line of sight of the remote somehow. That has several drawbacks: you cannot install it behind some furniture without the receiver sticking out, and synchronizing across several rooms is hard.

My solution was to pick some of the RGB LED WiFi controllers (LW12). These come with a neat Smartphone-App to control them.

However, I wanted to control them with my own home-automation-system, or my own smartphone-app.

Setup

First, you can follow the official How-To on how to hook each controller into your own WiFi.
Here’s a short recap:

 

    • Wire it up (at least the 12V to power it)

 

  • Then you have two options:
      • Setup via Smartphone
        • Get the official app LED Magic Color v2
        • Connect to the Access-Point that your LW12 set up (LEDNET_XXXXX, Password: 88888888
        • Search for controllers, follow the instructions

    Setup via Computer

      • Connect to LEDNet_XXXX WiFi, Password: 88888888
      • Type in your browser: 10.10.123.2
      • credentials: user: admin, password: nimda
      • switch to english
      • Setup everything according to your needs
      • Change the standard-password (88888888), otherwise anybody that knows it can get access to your network !

Protocol

The server of the controller listens on port 5577. You can send hex-codes to it:

  • On: cc2333
  • Off: cc2433
  • Set color red: 56ff0000aa
  • Request status: ef0177
  • etc.

Python package

To take the pain out of controlling these things, I created a pyhton package:
lw12 ( you can install it with: pip install lw12-0.1.tar.gz)

An example usage would then look like the following snippet:

from lw12 import lw12 

mylw = lw12("192.168.0.109") # the ip address of the LW12 in your network 
mylw.on() 
mylw.set_color([255,0,255]) 
mylw.set_color('#ff00ff') 
mylw.set_program(1,24) 
print mylw.get_color()
TobiasWeis | 19. Dezember 2015

Leave a Reply