Controller for milight bulbs. Same bulbs are available under multiple different brands, including LimitlessLed, Easybulb, applight, dekolight and iLight.
Before using this code, you need to configure your gateway to connect to wifi - there's multiple iOS and Android apps available for that. After that, configure light groups to the gateway. Configuring remote has nothing to do with configuring the gateway.
See github repository <https://github.com/ojarva/python-ledcontroller>
_ for more information.
The code is based on the documentation available at limitlessled.com/dev/ <http://www.limitlessled.com/dev/>
_
::
pip install ledcontroller
::
import ledcontroller led = ledcontroller.LedController("192.168.1.6") led.off() # Switches all groups off led.set_color("red", 1) # Switches group 1 on and changes color to red. led.set_color(ledcontroller.RGB(255,0,0), 1) # Switches group 1 on and changes color to red. led.white(2) # Group 2 on and color to white. led.set_brightness(50, 2) # Group 2 on and brightness to 50%. led.set_color(150, 2) # set color without using presets. Number must be 0-255 led.disco(3) # Group 3 on and enable disco mode. led.disco_faster(3) # Group 3 on and adjust disco mode speed. led.on(4) # Switch group 4 on. Bulb automatically restores previous color and brightness.
Using both white and RGBW bulbs:
::
import ledcontroller
led = ledcontroller.LedController("192.168.1.6", group_1="white", group_4="white") led.set_group_type(1, "white") # This is same as using constructor keyword group_1. led.on() led.white(2) # Switches RGBW group on and changes color to white. led.white(1) # Turns white group on. led.warmer() # Adjusts all white groups to warmer color. Switches all groups on. led.cooler(1) # Adjusts group 1 white bulbs to cooler color. led.brightness_up() # Adjusts white group brightness up. Does not affect RGBW lights. led.brightness_up(2) # Does nothing to RGBW bulbs. led.brightness_up(4) # Adjusts group 4 brightness. led.set_brightness(50) # Adjusts all RGBW bulbs to 50%. Does not affect white lights.
Controller pools:
When using multiple controllers, it is important to keep same 100ms pause between each command. Use LedControllerPool class to automate this.
::
import ledcontroller ledpool = ledcontroller.LedControllerPool(["192.168.1.6", "192.168.1.7"]) ledpool.execute(0, "on") ledpool.execute(1, "disco", 3) ledpool.execute(0, "set_color", "red", 1)
LimitlessLED <http://www.limitlessled.com/>
_. Unfortunately, they have really expensive shipping ($50 to Finland). Furthermore, when ordering to Finland, taxes and customs were about 30% in top of original price.milight.com <http://www.milight.com/>
and easybulb.com <http://easybulb.com/en/>
sell same products with two different brands. These are more expensive than LimitlessLED, but ship from UK.aliexpress.com <http://aliexpress.com/>
_ with search "milight". Beware of older versions (RGB bulbs) and non-remote-controlled bulbs sold with same brand.