Skip to main content
https://travis-ci.org/ojarva/python-ledcontroller.svg?branch=master

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 for more information.

The code is based on the documentation available at limitlessled.com/dev/

Installation

pip install ledcontroller

Usage

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.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
# By default, all groups are RGBW bulbs.
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)

Notes

  • There is automatic 100ms pause between each command. Almost every action requires sending more than one command, thus requiring several hundred milliseconds. You can change this with keyword argument “pause_between_commands”. However, decreasing the delay will cause some commands to fail.

  • As the gateway seems to be rather unreliable, all commands are sent multiple times (three by default). If you want to change this, use “LedController(ip, repeat_commands=n)” to create new lightcontroller instance. It is not possible to retrieve any status information from light bulbs.

  • If for some reason you need to change gateway port, pass port=n argument to constructor.

  • Run testsuite with “python setup.py test”. Tests only run the code without checking whether proper commands were sent.

  • RGBW/white bulb commands differ a bit. Obviously, it is not possible to change color for white bulbs. For white bulbs, there is no absolute brightness settings. Similarly, only white bulbs allow adjusting color temperature (with .cooler and .warmer). There is 10 steps for white bulb brightness and color temperature.

  • Brightness settings are stored by bulbs. Brightness is saved separately for both white and RGB modes. Furthermore, bulbs store the last color. Sending .on() restores previous brightness and color.

Stores and brands

  • I bought my bulbs, remotes and gateway from LimitlessLED. 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 and easybulb.com sell same products with two different brands. These are more expensive than LimitlessLED, but ship from UK.

  • At least some products from s’luce iLight are exactly the same with different branding.

  • Beware that at least milight.com and easybulb.com sell older version of the wifi gateway (v3, vs. v4 from LimitlessLED). v3 does not support nightmode, and seems to be less reliable than v4.

  • Try aliexpress.com with search “milight”. Beware of older versions (RGB bulbs) and non-remote-controlled bulbs sold with same brand.

Metadata

Release files for ledcontroller 1.3.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for ledcontroller 1.3.0
File Size Uploaded
ledcontroller-1.3.0.tar.gz 7.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for ledcontroller 1.3.0
File Interpreter ABI Platform
ledcontroller-1.3.0-py2.py3-none-any.whl Python 2, Python 3 none any Details

Total release size: 19.0 kB

Release files / ledcontroller-1.3.0.tar.gz

Download URL ledcontroller-1.3.0.tar.gz
Size 7.9 kB
Tags Source
SHA-256 checksum
How to use checksums
6f9d1d7622bfe87dea3a5bbf0bdab52c6cbb4b3bfda33b6ca0134eadc8eeae01
BLAKE2b-256 checksum
How to use checksums
65a79a69023c3e85fb8f483e22caf1c64cfaf5200abe09e036b996d5b9844743
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / ledcontroller-1.3.0-py2.py3-none-any.whl

Download URL ledcontroller-1.3.0-py2.py3-none-any.whl
Size 11.1 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
18aa3aa9183da255baeda163aa512846c3cd9c713aff419827682d4499f27ec8
BLAKE2b-256 checksum
How to use checksums
11dbdc430901291da837308fcf0daf180f8362c814e0e156591719496ca0b6f2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release history Release notifications | RSS feed

This release

1.3.0 This release

2 release files

1.2.0

3 release files

1.1.0

2 release files

1.0.9

2 release files

1.0.8

2 release files

1.0.7

2 release files

1.0.6

2 release files

1.0.5

2 release files

1.0.4

2 release files

1.0.3

2 release files

1.0.2

2 release files

1.0.1

2 release files

1.0.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page