Update Limitlessled/Milight Component V6 Bridge (iBox)

If this helps anyone, I am using the Hassbian build and couldn’t get the limitessled fork working until I forced the python3 install into the /home/homeassistant/.homeassistant/deps folder.

Otherwise, I copied the updated limitlessled.py by folks above and got it working!

Hey guys,
I’m the developer of the v6 fork and just came across this thread :smiley:
@stefan85 @ashwin There was a bug when using white bulbs with a v6 bridge, which I haven’t noticed yet, because I don’t own any white bulbs. I just pushed a commit, which should fix that. Give it a try and let me know, if it works :wink:

1 Like

Hi, I will try this tonight. I finally got something working. In the milight app I binded the white lamps as white lamps (white virtual remote). This didn’t work. Then I changed it to the default rgb virtual remote and used rgbww in hass. This worked. I don’t know why, but at least it was something.

Now I still have to test your new update. But I think your changes will work. Thank you for your work. I will post an updated as soon as possible.

Are your bulb manufacture by limitlessled? Or it’s possible that the manufacturer simply used the RGB standard…

Good question, mine are Milight lamps. What I still find confusing is that I can’t monitor transmissions with wireshark. I don’t see anything. But it works, so I can’t complain :slight_smile: .

Hi guys !

I get an error when I made change over /usr/local/lib/python3.5/dist-packages/homeassistant/components/light/limitlessled.py :

17-02-10 09:41:11 ERROR (MainThread) [homeassistant.components.light] Error while setting up platform limitlessled
Traceback (most recent call last):
File “/usr/local/lib/python3.5/dist-packages/homeassistant/helpers/entity_component.py”, line 151, in _async_setup_platform
entity_platform.add_entities, discovery_info
File “/usr/lib/python3.5/asyncio/futures.py”, line 361, in iter
yield self # This tells Task to wait for completion.
File “/usr/lib/python3.5/asyncio/tasks.py”, line 296, in _wakeup
future.result()
File “/usr/lib/python3.5/asyncio/futures.py”, line 274, in result
raise self._exception
File “/usr/lib/python3.5/concurrent/futures/thread.py”, line 55, in run
result = self.fn(*self.args, **self.kwargs)
File “/usr/local/lib/python3.5/dist-packages/homeassistant/components/light/limitlessled.py”, line 114, in setup_platform
lights.append(LimitlessLEDGroup.factory(group))
File “/usr/local/lib/python3.5/dist-packages/homeassistant/components/light/limitlessled.py”, line 172, in factory
return LimitlessLEDRGBWGroup(group)
File “/usr/local/lib/python3.5/dist-packages/homeassistant/components/light/limitlessled.py”, line 248, in init
self.group.on = True
File “/usr/local/lib/python3.5/dist-packages/limitlessled/group/init.py”, line 83, in on
cmd = self.command_set.off()
File “/usr/local/lib/python3.5/dist-packages/limitlessled/group/commands/v6.py”, line 140, in off
return self._build_command(0x03, 0x04)
File “/usr/local/lib/python3.5/dist-packages/limitlessled/group/commands/v6.py”, line 111, in _build_command
self._group_number)
File “/usr/local/lib/python3.5/dist-packages/limitlessled/group/commands/init.py”, line 43, in init
self._bytes = bytearray(bytes)
TypeError: an integer is required

Any idea ?

Hi, I tried you new commit but I have no luck with it. It works when I select rgbww, but not white.

Traceback (most recent call last):
File “/srv/homeassistant/homeassistant_venv/lib/python3.4/site-packages/homeassistant/helpers/entity_component.py”, line 151, in _async_setup_platform
entity_platform.add_entities, discovery_info
File “/usr/lib/python3.4/asyncio/futures.py”, line 388, in iter
yield self # This tells Task to wait for completion.
File “/usr/lib/python3.4/asyncio/tasks.py”, line 286, in _wakeup
value = future.result()
File “/usr/lib/python3.4/asyncio/futures.py”, line 277, in result
raise self._exception
File “/usr/lib/python3.4/concurrent/futures/thread.py”, line 54, in run
result = self.fn(*self.args, **self.kwargs)
File “/srv/homeassistant/homeassistant_venv/lib/python3.4/site-packages/homeassistant/components/light/limitlessled.py”, line 114, in setup_platform
lights.append(LimitlessLEDGroup.factory(group))
File “/srv/homeassistant/homeassistant_venv/lib/python3.4/site-packages/homeassistant/components/light/limitlessled.py”, line 168, in factory
return LimitlessLEDWhiteGroup(group)
File “/srv/homeassistant/homeassistant_venv/lib/python3.4/site-packages/homeassistant/components/light/limitlessled.py”, line 209, in init
self.group.temperature = 1.0
File “/home/homeassistant/.homeassistant/deps/limitlessled/group/white.py”, line 66, in temperature
cmd = self.command_set.temperature(temperature)
File “/home/homeassistant/.homeassistant/deps/limitlessled/group/commands/v6.py”, line 215, in temperature
return self._build_command(0x05, temperature)
File “/home/homeassistant/.homeassistant/deps/limitlessled/group/commands/v6.py”, line 108, in _build_command
checksum = sum(cmd + zone_selector) & 0xFF
TypeError: unsupported operand type(s) for &: ‘float’ and ‘int’

I also tried the developers version of Home Assistant with the update. And I do have this error with my version 5 bridge:

Traceback (most recent call last):
  File "/usr/local/lib/python3.4/dist-packages/homeassistant/helpers/entity_component.py", line 151, in _async_setup_platform
entity_platform.add_entities, discovery_info
  File "/usr/lib/python3.4/asyncio/futures.py", line 388, in __iter__
yield self  # This tells Task to wait for completion.
  File "/usr/lib/python3.4/asyncio/tasks.py", line 286, in _wakeup
value = future.result()
  File "/usr/lib/python3.4/asyncio/futures.py", line 277, in result
raise self._exception
  File "/usr/lib/python3.4/concurrent/futures/thread.py", line 54, in run
result = self.fn(*self.args, **self.kwargs)
  File "/usr/local/lib/python3.4/dist-packages/homeassistant/components/light/limitlessled.py", line 110, in setup_platform
version=bridge_conf.get(CONF_VERSION, DEFAULT_VERSION))
  File "/var/opt/homeassistant/deps/limitlessled/bridge.py", line 99, in __init__
self._init_connection()
  File "/var/opt/homeassistant/deps/limitlessled/bridge.py", line 206, in _init_connection
self._socket.recv_into(response)
ConnectionRefusedError: [Errno 111] Connection refused

If I only set the V6 Bridge in the configuration file, I have no problem. The v6 bridge is working well.

Has someone an idea what is going wrong?

@stefan85 Its a bug, which I just fixed on my fork. Sorry about this.

@Maxim The default port has changed to 5987. For v5 you have to set it explicitly to 8899.

Sounds like you have the same setup as me @drrayl. Can you let me know or what you mean by install python3 into the reps folder?

Then where do I find the limitlessled.py file in hassbian?

I used the updated setup.py in soldag’s build and made sure to install using python setup.py install --prefix (home assistant deps folder).

Just took a look at HASS on git and it seems the updated fork was merged. If you wait until the next build, an update should make it work without having to alter anything.

1 Like

Hi folks,

Both bugs are fixed in this PR: https://github.com/home-assistant/home-assistant/pull/6006 (v6 white temperature, v5 bridge not working)

Thnx @happyleaves, I’ll try this fix this evening. I did already set the port and version number of my v5 bridge,so I hope this will solve the issue.

Thanks for all the work guys, v6 bridge works perfect.

Thanks for the heads up, I’ll save myself a little head scratching and wait for the build in that case. Good work guys!

Hi Soldag, I’ve migrated to the new version and it’s working great. However, I seem unable to find the bridge (I had it as a separate light type before and was working fine).
I had the line bridge_led: True but cannot see it list in States.
Under which EntityID should the bridge led appear?

It should be light.bridge. Its hard for me, to find the cause of the error, since I don’t have a wifi bridge with led here :confused: Is there anything in the hass log?

Not that I can see, however I have a non-responsive light with the MAC address of the bridge as entity_id showing up once in a while. (v6 bridge with bridge_led: True in config, and 4 groups of RGBWW bulbs):

It also shows in the frontend, but when I try to turn it on it doesn’t work.

Edit: I said once in a while, but that’s mostly because I don’t think it shows up immediately. But when it’s there it doesn’t go away (at least for now).

I also had once in a while a light, which i did not configured, in my entity list, but I never thought about this has something to do with the limitlessled bridge.
It seems that the flux_led component discovers the bridge as light:

INFO (MainThread) [homeassistant.core] Bus:Handling <Event platform_discovered[L]: platform=flux_led, service=load_platform.light, discovered=('IP_OF_BRIDGE', 'MAC_OF_BRIDGE')>

I was looking at the entity_id and just got a MAC address-like feel from it. So checked my router and it is indeed the iBox bridge. Funny that it’s unrelated to the code that tries to get the bridge_led to work, if theres anything I can do to help you debug this further just ask!

I’ll check that in detail tomorrow. Before it worked for me with a separate entry for the bridge, group 1, type bridge_led and a modified version of limitlessled.py