Lifx not working with HA

Hi,

I have a LIFX light bulb, HA doesn’t find it and give some errors in the error log
Anyone knows how can i solve it ?

It works fine with amazon echo lifx skill and from the official lifx app.

This my config:

light:
platform: lifx
server: 10.0.0.35
broadcast: 10.0.0.255

And this is HA the error log:

17-01-21 19:03:22 homeassistant.components.light: Error while setting up platform lifx
Traceback (most recent call last):
File “/srv/homeassistant/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/lib/python3.4/site-packages/homeassistant/components/light/lifx.py”, line 50, in setup_platform
lifx_library = LIFX(add_devices, server_addr, broadcast_addr)
File “/srv/homeassistant/lib/python3.4/site-packages/homeassistant/components/light/lifx.py”, line 72, in init
broadcast_addr)
File “/home/homeassistant/.homeassistant/deps/liffylights.py”, line 100, in init
self._sock.bind((listener_addr, UDP_PORT))
OSError: [Errno 98] Address already in use
17-01-21 19:03:24 yahooweather: Fetch no weather data Yahoo!
17-01-21 19:03:24 homeassistant.components.sensor.yweather: Can’t retrieve weather data from yahoo!

I have mine set with just:

light:
platform: lifx

Thanks, But it doesn’t work as well

Having the same problem here, but HA can only discover 2-3 bulbs out of 4 total.

Same issue here.
I have 8 Lifx bulbs on my wifi network, but none of them show up in HA, while the component gives no errors.
This makes me wonder, as Lifx bulbs individually connect to the net, what is the server mentioned in the component config?

# Example configuration.yaml entry
light:
  - platform: lifx
    server: 192.168.1.10

Should be your HASS IP Address

At some point I gave up and wrote my own script to run as a command line switch using this library:

After a month and 2 or 3 home assistant upgrades the Lifx bulbs suddenly appeared in the HASS interface.

and I have only this in my config:

light:
  - platform: lifx

A little more information is needed to diagnose your issue. Which server OS are you using (macOS, Windows, Linux)? Do you have a special network setup?

The server value is only relevant If your HA server has more than one IP address.

I have 4 LIFX lights on my network, all have worked perfectly since the first time I set up HASS. This is my config in lights.yaml

  - platform: lifx
    broadcast: 192.168.1.255

My router IP is 192.168.1.1, so the broadcast address is your router IP, with 255 at the last digit set. All bulbs needs to be set up and working in the LIFX app first obviously.

I’m running on OSx 10.11 connected to the network via ethernet. Bulbs are obviously on wifi, but on same router.

Thanks. Gave the broadcast parameter a shot adjusted to my network, but to no avail. The bulbs are otherwise happily controllable from the app and from the node-lifx npm module.

Are you running node-lifx at the same time as Home Assistant? I don’t think it works to have two programs using the same LIFX UDP port.

1 Like

That was it! Thanks! :smile: