home-assistant / core

:house_with_garden: Open source home automation that puts local control and privacy first.
https://www.home-assistant.io
Apache License 2.0
74.18k stars 31.14k forks source link

LIFX not showing in HomeKit after 0.81 Upgrade #17941

Closed miniwalks closed 6 years ago

miniwalks commented 6 years ago

Updated to HA 0.81 Updated configuration to suit from lights platform: lifx to lifx: lights:

Since doing that i've noticed that my LIFX globes do not always show up in HomeKit via HomeAssistant.

No notable errors in the logs

Happy to test/trial anything as needed

timothybrown commented 6 years ago

They showed up fine for me in 0.81, however I completely removed lights: lifx: from my configuration.yaml and instead added them via the Configuration -> Integrations panel in the web interface, as the updated docs suggest.

You may also need to disable autostart for the HomeKit component and use an automation to have it start on a 60 second delay. That’s what I do, to make sure HA has time to discover all my devices first. (I have MQTT lights, MQTT sensors, a DirecTV receiver, AppleTV, LiFX lights and Wemo outlets all on discovery, so it can take upwards of 30 seconds before it all gets sorted out.)

miniwalks commented 6 years ago

@timothybrown would you mind sharing your config snippets for that?

timothybrown commented 6 years ago

@miniwalks Sure thing!

homeassistant@majordomo ~> cat .homeassistant/automations.yaml 
- id: homekit_delay
  alias: Start HomeKit
  trigger:
  - platform: homeassistant
    event: start
  action:
  - delay: 00:01
  - service: homekit.start

You can change - delay: from 00:01 to 00:00:30 for a 30 second delay instead of 1 minute if you don’t have a lot of components using discovery or you’re using something faster than a Raspberry Pi 3.

Now the only time components fail to show up in HomeKit for me is after the entire house loses power. My router can take a minute to boot and then another minute for the WiFi APs to sync up and the various devices to connect, then there’s the DirecTV box that takes 10+ minutes to start and lastly there’s my RadioTherm thermostat that doesn’t want to automatically reconnect to WiFi after a power failure without a reset. But power failures are pretty rare here, so it’s not a big deal.

miniwalks commented 6 years ago

@timothybrown thanks heaps my man! ive got it set to 2min at the moment as its running in a docker (on a giant xeon server) and performance is difficult to measure at times, tho the system is hardly stressed haha

Now to continue beating my head against mDNS and Xiaomi Gateways with Enterprise Cisco WLANs.

Sometimes having an enterprise network makes it a lot harder in a home lab

thanks again

timothybrown commented 6 years ago

I hear that. About 15 years ago I did Linux server administration for a living and had a whole enterprise setup on my home LAN, including a Cisco 2400 series router and two massive rack mount dual-PII Xeon servers (complete with four 10kRPM SCSI drives each). The setup was so loud I had to sound proof the closet they were stored in! One day I realized that I spent more time tinkering with my network than I did actually using it. This was at a time when virtualization hadn’t quite taken off yet, so you really needed physical hardware to simulate various server and network setups when working on client problems. These days, with a laptop running VMWare, Docker, a managed switch and a few $20 single board computers you can pretty much simulate any network setup you want; though there’s still something to be said for a closet full of real, physical silicon.

Back on topic, if you need any help with your mDNS issues let me know. Over the years I’ve written several small programs to make tracking down mDNS issues easier and I’d be glad to put the source up on GitHub. (Being able to manually send mDNS advertisements and watch the flow of traffic in real time is incredibly useful for debugging.) Another good tool for viewing the entire hierarchy of service advertisements on your network is Bonjour Browser, however it’s for macOS and rather old (though it still runs fine).

Anyway, glad the HomeKit delay helped!

amelchio commented 6 years ago

To be clear, did that automation fix your issue?

miniwalks commented 6 years ago

@amelchio Yeah it has for now, I need to do some more testing on it today

@timothybrown that would be awesome I’ll have a look through your git and reach out there too, I’ve done some wire shark from the AP and seen the traffic with the update but it’s not passing through evidently, I’ll need to do some deeper wiresharking to test

cdce8p commented 6 years ago

@timothybrown If you have experience with mDNS, would you like to help us with HAP-python? We have some hard to debug issues there and I'm absolutely not an expert regarding networking. If you're interested: Summary of some issues. If you want to, text me on discord.

miniwalks commented 6 years ago

@cdce8p I’ve had experience with mDNS on Cisco WLC and getting HomeKit to work reliably cross subnets along with home assistant etc

timothybrown commented 6 years ago

@cdce8p I’ll read over the issues and be in touch on Discord. A few years back I had to write a full Bonjour stack for the TI CC3000 WiFi Module and then coordinate the roll out of several hundred units on a network consisting of dozens of WiFi repeaters. So I learned about all the little gotchas of mDNS/Bonjour/Zeroconf during the process. I’d be glad to put that knowledge to work. :)

cdce8p commented 6 years ago

@miniwalks I assume this is fixed. Will go ahead and close this issue