openhab / openhab-addons

Add-ons for openHAB
https://www.openhab.org/
Eclipse Public License 2.0
1.88k stars 3.58k forks source link

[Lifx] Multiple bulbs going offline and then staying that way OH4 #15689

Open xeroiv opened 1 year ago

xeroiv commented 1 year ago

Expected Behavior

Lights are expected to show online and respond to commands from OpenHAB.

Current Behavior

Multiple different types of my LIFX bulbs have been going offline and staying offline since migrating from OH3.4 to OH4. Originally these bulbs were reachable via openHAB but have slowly started to show offline but are still reachable via the LIFX app. I restored my OH3.4 instance and found that the same bulbs were showing offline. These bulbs respond to UDP packets if sent directly from my Loxone miniserver using the LAN API.

Trace Logs from Binding:

2023-10-02 09:50:00.596 [TRACE] [internal.LifxLightOnlineStateUpdater] - D0:73:D5:57:A7:D3 : Polling light state
2023-10-02 09:50:00.596 [TRACE] [internal.LifxLightOnlineStateUpdater] - D0:73:D5:57:A7:D3 : Light is not online, broadcasting request
2023-10-02 09:50:00.597 [TRACE] [.lifx.internal.util.LifxSelectorUtil] - D0:73:D5:57:A7:D3 : Sending packet type 'GetServiceRequest' from '/0.0.0.0:56715' to '/192.168.30.255:56700' for '00:00:00:00:00:00' with sequence '54' and source '3fb720f7'
2023-10-02 09:50:00.607 [TRACE] [.lifx.internal.util.LifxSelectorUtil] - D0:73:D5:57:A7:D3 : Channel is ready for reading

Example Hex Command Sent in from Loxone:

\x26\x00\x00\x14\x02\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x15\x00\x00\x00\xFF\xFF

Possible Solution

Symptoms are similar to issue #13682, but the trace logs don't produce the same output since the multicast tagging fix was implemented.

Your Environment

openHAB version : 4.0 Lifx Binding Version : 4.0 OS Version : Debian 11 WIFI : Unifi Dream Machine Pro w/ U6-LR

kimtore commented 11 months ago

I was about to chip in that I have the same bug, but then I discovered that my DHCP server had assigned new IPs to my bulbs while still keeping the same addresses. OpenHAB addresses bulbs by using both device ID (which is the MAC address of the bulb) and the IP address. If they don't match, the bulb is left in an offline state.

My fix was to set up static IP mappings for all the bulbs, and then remove the device ID from them so that OpenHAB could auto detect them again.