HASS cannot find my LIFX Z strip

Hello,
I am running HASS 0.45 on RaPi 3 B connected via LAN to my WiFi router.
My HASS has IP 192.168.100.220 and strip has 192.168.100.212
Only thing I added to my config file is:
light:
platform: lifx

I tried added:
server: 192.168.100.220
broadcast: 192.168.100.255
but it didn’t help and there is no error in log.
I know Strip is connected because I can see it in my router config page and I can control it via Android App and using voice via Google Assistant.

What can be an issue here?

Thank you.

Is this question so stupid, nobody care to point me to right direction or this issue is too complex and nobody knows why it’s happening?

Thank you.

This is likely a network problem.

It’s possible that your Android App is using cloud access to get to the LIFX but HASS can only do direct LAN access. If the strip does not see broadcast messages from the server, things will not work.

So if you have guest mode, network isolation or something like that enabled, try turning it off.

Are you able to ping the strip, i.e. ping 192.168.100.212 from the server?

You do not need the server and broadcast options.

Hello,
I can ping it without any issue and it still doesn’t show up :cry:

Okay, so some connectivity is present. When you say it does not show up, what exactly do you mean? Did you check the State view (the one with a <> icon) in HASS Developer Tools?

Another thought: do you have a firewall enabled on the RaPi?

Hello,
yes, I checked State view but Lifx is not there.
I added this to my iptables.firewall.rules file:

filter
# Allow ALL loopback traffic and drop all traffic to 127/8 that doesn't use lo0
-A INPUT -i lo -j ACCEPT
-A INPUT -d 127.0.0.0/8 -j REJECT
# Accept all established inbound connections
-A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
# Allow all outbound traffic - you can modify this to only allow certain traffic
-A OUTPUT -j ACCEPT

# Allow all outbound establised traffic
-A OUTPUT -m conntrack --ctstate ESTABLISHED -j ACCEPT

# Allow HTTP and HTTPS connections from your local subnet (leaving 80,443,8080 enabled however for home assistant only 8123 is needed here until we add SSL)
-A INPUT -s 192.168.100.0/24 -p tcp --dport 80 -j ACCEPT
-A INPUT -s 192.168.100.0/24 -p tcp --dport 443 -j ACCEPT
-A INPUT -s 192.168.100.0/24 -p tcp --dport 8080 -j ACCEPT
-A INPUT -s 192.168.100.0/24 -p tcp --dport 8123 -j ACCEPT

#Allow uPnP requests - this is for the net disco service built into Home Assistant and is a fail safe  
-A INPUT -s 192.168.100.0/24 -p tcp --dport 2869 -j ACCEPT
-A INPUT -s 192.168.100.0/24 -p udp --dport 1900 -j ACCEPT

#Allow SSH connections
# The -dport number should be the same port number you set in sshd_config
-A INPUT -p tcp -m state --state NEW --dport 22 -j ACCEPT

# Allow ping
-A INPUT -p icmp -j ACCEPT

# Log iptables denied calls (this is especially needed if you are going to use fail2ban on DMZ connected home automation servers)
-A INPUT -m limit --limit 5/min -j LOG --log-prefix "iptables denied: " --log-level 7

# Drop all other inbound - default deny unless explicitly allowed policy
-A INPUT -j DROP
-A FORWARD -j DROP

COMMIT

But I just copied it and changed IPs so I am not sure what exactly everything does.

Thank you.

Ah, now we’re getting somewhere :slight_smile:

Add this after the uPnP block and reload the firewall:

# Allow LIFX
-A INPUT -s 192.168.100.0/24 -p udp --dport 56700 -j ACCEPT
1 Like

It’s workiiiiing!! :joy: :champagne: You are awesome!
Thank you very much, sir! :beers:

I’m happy to hear that :blush:

I’m having a similar issue. Running Hassbinan on a RPi, HA 4.9.0. Just got LIFX Z installed (first LIFX device). HASS IP is 192.168.1.20, strip is 192.168.1.38. I have tried lifx and lifx_legacy components. I can ping the strip from HASS. I don’t have iptables.firewall.rules on my RPi.

I did get this in the logs at one point:

2017-07-22 17:08:28 ERROR (MainThread) [homeassistant.core] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
File “/usr/lib/python3.4/asyncio/tasks.py”, line 235, in _step
result = coro.send(value)
File “/srv/homeassistant/lib/python3.4/site-packages/homeassistant/components/light/lifx.py”, line 334, in async_register
if lifxwhite(device):
File “/srv/homeassistant/lib/python3.4/site-packages/homeassistant/components/light/lifx.py”, line 162, in lifxwhite
return not aiolifx().products.features_map[device.product][“color”]
KeyError: None

Any ideas?

EDIT: Using sniffer.py from GitHub - mclarkk/lifxlan: Python library for accessing LIFX devices locally using the official LIFX LAN protocol. I am seeing the following: https://hastebin.com/uvegigixoz.go

EDIT2: Discovery is also working with lifxlan:

Discovery will go much faster if you provide the number of lights on your LAN:
python hello_world.py
Discovering lights…
Found 1 light(s):
Front Porch Soffit
MAC Address: d0:73:d5:14:d7:eb
IP Address: 192.168.1.38
Port: 56700
Service: UDP
Power: Off
Location: My Home
Group: Front Yard
Color (HSBK): (45328, 0, 65535, 3500)
Host Firmware Build Timestamp: 1485471208000000000 (2017-01-26 22:53:28 UTC)
Host Firmware Build Version: 1.21
Wifi Firmware Build Timestamp: 1456093684000000000 (2016-02-21 22:28:04 UTC)
Wifi Firmware Build Version: 101.62
Vendor: 1
Product: 31 (LIFX Z)
Version: 0
Features: {‘multizone’: True, ‘color’: True, ‘infrared’: False}
Current Time: 1500856674280237000 (2017-07-24 00:37:54.280236 UTC)
Uptime (ns): 18598266000000 (5.17 hours)
Last Downtime Duration +/-5s (ns): 0 (0.0 hours)
Wifi Signal Strength (mW): 9.999999974752427e-07
Wifi TX (bytes): 4053600
Wifi RX (bytes): 89845274

Okay, so after spending the last two days sniffing traffic, disabling firewalls, testing different APIs, and lots of reboots of the lights and HASS I finally got it working. All I did was disable all other light components (hue and osramlightify), after a reboot the LIFX light appeared in HASS, and after re-enabling the other light components it’s still there. Very strange…