Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Homebridge only responding on local network #2040

Closed
DanKapone opened this issue Oct 19, 2018 · 68 comments
Closed

Homebridge only responding on local network #2040

DanKapone opened this issue Oct 19, 2018 · 68 comments
Labels

Comments

@DanKapone
Copy link

Expected Behavior

Homekit accessories should be accessible via WAN when a hub is present at home.

Current Behavior

Every accessory connected to homebridge is accessible in the LAN/WLAN; local network. From outside the network the homebridge and attached accessories are "not responding". The ATV4 hub itself is accessible.

Steps to Reproduce (for bugs)

I tried the other "fixes" in similar issues but it does not address my problem.

I've turned off iCloud sync, rebooting the devices, (on AppleTV I disconnected/connected to Homekit in Settings but still can only access the homebridge devices on the original device on local network.)

Versions

iOS 12.0.1

Homebridge: homebridge --version
$ homebridge --version
0.4.45
Node: node --version
$ node --version
v8.11.1
OS:
$ uname -a
Linux homebridge 4.14.76-v7+ #1150 SMP Mon Oct 15 15:19:23 BST 2018 armv7l GNU/Linux

@jb-home
Copy link

jb-home commented Oct 19, 2018

Do you have original HomeKit devices? Like a Philips Hue Bridge?
Point is to determine whether it is related to homebridge or your network,icloud, etc.
Is your ATV4 in the same network as homebridge? Is your ATV4 connected by WLAN or LAN?

@DanKapone
Copy link
Author

No additional devices, just the Homebridge.

Setup as follows:

ATV4 - LAN
Homebridge on Raspi 3 - LAN
Max! eQ-3 Cube Plugin for Homebridge
Max eQ-3 Cube - LAN

@jb-home
Copy link

jb-home commented Oct 19, 2018

Are all LAN cables connected to the same switch?
In the past there was an issue that some switches messed up the communication.
In case they are all on the same switch: Do you have another switch to connect all of them to, so we can rule out the switch?

@Aidan711
Copy link

Make sure you have an iPad or Apple TV set up as a hub that you can leave at home. That is what provides out-of-home connections. Turn it on in the Home settings on an iPad or in the settings on an Apple TV.

@DanKapone
Copy link
Author

Switching can be ruled out. I have managed switches here at home and I know how to handle them ;-)

The ATV4 is setup as a hub and it is connected. I've already tried to log off from iCloud and reconnect it as a hub. I've also resetted the whole home in iCloud and the homebridge but that didn't solved the issue. I've also replaced the Raspi with a new v3 model and a new installation only for homebridge.

When the homebridge is in the "no response" state, I can trigger playback on the ATV4 from outside my home network. So the connection to the hub from external net's is functional.

Strange behaviour: this afternoon it worked for several hours. Now it doesn't anymore.

lte

wifi

@maragelis
Copy link

reboot apple TV

@DanKapone
Copy link
Author

DanKapone commented Oct 22, 2018

I tried the other "fixes" in similar issues but it does not address my problem.

I've turned off iCloud sync, rebooting the devices, (on AppleTV I disconnected/connected to Homekit in Settings but still can only access the homebridge devices on the original device on local network.)

@jb-home
Copy link

jb-home commented Oct 22, 2018

Especially managed switches can cause this.
In case you still did not find a solution, try a stupid unmanaged switch.

@nickkkk72
Copy link

in your case, disabling IPV6 evrywhere on my network (dhcp and Rpi in example) allowed me to definitively solve the problem. Can you try this ?

@DanKapone
Copy link
Author

I disabled IPv6 on the Pi, still the same. I have Cisco Aironet 2800 series Wifi and Catalyst Switches and I know how to use Wireshark, I'm able to sort network issues out.
BUT: I've attached another ATV4 via Wifi and let it took the master role for Homekit and now it works. I can't detect anything weird on the network side. For me now it looks like some issues on Apple's side. I can't explain why one ATV works and the other one not.

@nickkkk72
Copy link

Ok DanKapone. Happy you find an alternative...
I was in this case too. Solved by finilizing to secure my Apple iCloud Account (double authentication), and solved an account issue on my wife’s iPhone (i use Family Sharing and his iPhone asked her to confirm his apple password). Since that, it’s Stable since many months for me. You’ve probably right about issues on Apple’s side...

@Fiser12
Copy link

Fiser12 commented Jan 11, 2019

I have this same problem and I cannot solved with restarting Homekit server in Apple TV and I don't have more ideas. Another have this problems?

@NorthernMan54
Copy link
Contributor

NorthernMan54 commented Jan 11, 2019

I just had something similar occur on my setup as well. I have several homebridge instances that have been stable for a very long time, and they all stopped responding while remote. I do have two house's and my second house was okay. For me this started several days ago. I have not made any changes to my setup recently.

Things Tried

1 - Reboot AppleTV 4 - No change
2- Logout and login to iCloud on my Apple TV - No change
3 - Confirmed that my AppleTV was registered as the Home Hub - Yes ( On both my iPhone and Apple TV )
4 - Made sure my AppleTV and iPhone had the latest software - Yes, no change
5 - Reboot my iPhone - Success

@ngori
Copy link

ngori commented Feb 25, 2019

Just want to echo @NorthernMan54 and his experience

Just installed HomeBridge on my Pi to integrate alarm.com into Homekit this past weekend. I have an Apple TV as a hub and a Lutron Smart Bridge connected with 14+ lights. Everything seemed fine then working well over the weekend while on local wifi. Then when I go to work I lost all the connectivity to the Lutron bridge devices via Home app over LTE. I could connect directly to the Lutron hub over LTE via it's the Lutron app on my phone which lead me to start searching for a fix. I found this issues post and sure enough. Rebooting my iPhone brought back remote connectivity over LTE. The old turn it off and turn it back on solution.

@townsmcp
Copy link

Hmmmmm good to see I’m not the only one encountering this.
My setup:
ATV 4 running iOS 12.1.2 - network cable to a managed switch and cable running back to ASUS AC-68U router.
BT high speed broadband (300mb/sec)
iPhone X running iOS 12.2
9 LIFX bulbs
Hue light strip x 3
Hue floodlight
HomeBridge running 0.4.46
HomeBridge running the following plugins:
-Hubitat 1.5.6
-UI-X 3.9.6
-Nest 2.1.4

I have tried the following (trying to to connect on cellphone not connected to Wi-fi)

  • Rebooted iPhone
  • Rebooted Apple TV
  • Signed out of Apple TV iCloud and back in
  • Rebooted Switch
  • Rebooted router
    Every time, when on Wi-fi I have no problems. As soon as it’s offline on cellular network, no access to any HomeBridge device. 6 out of the 9 Lifx bulbs work on cellular. All hue lights work. I can see ATV on cellular.
    I’m at a loss of what to try next. There hasn’t been any updates anywhere to start this problem

@bohtho
Copy link

bohtho commented Mar 19, 2019

Ditto. Only it’s only intermittently so outside of WiFi. Hue direct HomeKit accessories are always there but Homebridge accessories may be unavailable.

Latest Homebridge, plugins Homebridge-Hue and Homebridge-MQTT.

@townsmcp
Copy link

townsmcp commented Mar 19, 2019

I think I might have just found the problem (for me anyway).
When I originally setup HomeBridge my ATV was connected wirelessly (to my Linksys Velop mesh network). A couple of weeks ago I plugged a network cable in (one had come free on the managed switch due to removing an old device). ATV worked perfectly as did all devices, local and remote. The issues of no devices remotely have only been in the last 3 days.
I originally plugged in the ATV thinking network cable would give better performance and less reliance on Wi-fi when I have a spare socket.
Just to confirm, there were no firmware updates to the router, switch, ATV etc.

I wonder if I had set up HomeBridge on networked lan if I wouldn’t be having this problems now when I switch from
Wi-fi to lan connection on ATV? I don’t want to go uninstalling and setting up HomeBridge again to find this out.

@bohtho, I’m curious why your using a hue HomeBridge plugin instead of hue native HomeKit?

@bohtho
Copy link

bohtho commented Mar 23, 2019

@townsmcp I use the hb-Hue plugin to bring in all my zigbee lights, sensors and switches automatically into Homebridge (via Deconz and my ConBee USB stick), where I have more control over them (E.g. via Node-Red) than native HomeKit/brand hubs. Other Homebridge accessories I create and control via MQTT from Node-Red. The latter is a rock solid bridge without any problems ever.

@ronzelver
Copy link

ronzelver commented Apr 2, 2019

I'm experiencing the same behavior, I'm frequently losing Homebridge devices (not responding) when I'm not home (depending on my Apple TV 4K as hub) but 'native' homekit devices (e.g. Eve Energy/Weather/Thermo, Ikea Tradfri) all work?!? I'm running the latest iOS/tvOS/Homebridge versions and I've tried already a lot of things:

  • Disabled Ipv6 on the RPi
  • Removed the complete Homekit configuration, including all cached Homebridge stuff
  • Renamed (name, username, port, pin) Homebridge

The ATV is connected to an unmanaged switch (3COM) which is already a replacement of another unmanaged switch.
I do notice something when Homebridge is not responding when I lookup the 'netstat' on port 51826, I see all my other Apple devices (iPad, MacBook) with an 'ESTABLISHED' connection to the Homebridge listener, but my Apple TV is not listed?! For some reason the Apple TV regularly disconnects (it does this all the time) from Homebridge, causing this undesired behavior.

@wondergit113
Copy link

I had a similar problem. Updated all my TVs to 12.2 and restarted them.

@ronzelver
Copy link

I had a similar problem. Updated all my TVs to 12.2 and restarted them.

Both my ATVs are already on 12.2 and I have restarted them many times. As a test I've also enabled my iPad (iOS 12.2) as Homekit hub, see if that makes a difference.

@wondergit113
Copy link

Might also be worth shutting them all down so there is no active HomeKit Hub. I tried that as well and it helped. Sorry for your troubles.

@SantaFox
Copy link

I can confirm that the problem still exists. When I am ouside the house (iPad connected to power source works as a Hub):

  • Bluetooth-connected devices (like Eve Room) are visible
  • WiFi-connected devices (like Koogeek Switch) are visible
  • Homebridge (RPi 4B) and its accessories are "Not Responding"

I think it's a problem of connectivity between HomeBridge and Hub. When you are at home, iPhone connects to the HomeBridge directly (not via Hub) and everything works. When you connect via cloud, only Hub is accessible via Internet, so if HomeBridge fails to communicate to Hub, it looks inaccessible.

@EarthRise626
Copy link

I’ve had this issue in the past. Running an iCloud backup of my iPhone (which includes HomeKit configuration) has solved it for me on multiple occasions.

@SantaFox
Copy link

Well, there is no immediately changes after backup, but I will keep an eye on backups schedule of my iPhone and the iPad that acts as a Homekit Hub.
However I don't see any direct connection between connectivity problems and configuration backups. I think there are different behavior of the connections from certified Bridges to Hub and from Homebridge, because Homebridge lives in operation system environment (Raspbian for example), which may block some connections, close them by timeout etc.

@ronzelver
Copy link

I noticed something strange, I was away from home for 3 weeks and remote HomeKit access worked like a charm for three weeks, meaning both my Apple TV's kept on working all the time. As soon as I came back home with daily alternating access (LAN and remote), my Apple TV's started dropping off from my Homebridge. Running 'netstat' on port 51826, I see all my other Apple devices (iPhones, iPad, MacBook) with an 'ESTABLISHED' connection to the Homebridge listener, but my Apple TV's are not listed?! For some reason the Apple T's regularly disconnects (it does this all the time) from Homebridge, causing this undesired behavior.

@SantaFox
Copy link

@ronzelver it looks interesting. Unfortunately I am not a Linux guy to make a deep inspection, however I want to understand who exactly dropped the connection, Homebridge or ATV?

@ronzelver
Copy link

@SantaFox, I don’t know yet who's dropping the connection, but I also noticed that sometimes my iPhone (running iOS 13 beta) drops the connection while LAN-connected. One of my Apple TV’s is also running tvOS beta. So, maybe it’s an iOs / tvOS issue?!

@TransRapid
Copy link

TransRapid commented Sep 6, 2019

Okay. So I might have figured it out, or at least isolated it more.

I had the same issue, got it working with a different method I decided to try.

I have an AppleTV 4K and both my iPad and iPhone are running 13. I am running the current stable version of TV os, not the beta.

I removed HomeBridge (HooBs in my case) from my iPhone as a hub. Then added it to my iPad as my iPad continued to show it was already added. I set my iPad as the HomeHub, then I turned that off, and on my AppleTV:
Settings>Accounts>iCloud>HomeKit.
Disconnect/Connect

Powered off my iPad, then put my iPhone on WAN (No WiFi), and it remained connected. There’s something with the auto discovery of the HB that the AppleTV doesn’t play nice with when setting it up initially if it’s the HomeHub. Maybe because it needs to be manually added and not the same way native HomeKit devices are broadcasted?

@TransRapid
Copy link

TransRapid commented Oct 24, 2019

So I was looking at out of box HomeKit accessories.

Native HomeKit Accessories & Bridges:

"HomeKit Accessory Protocol".
Random Ports
DNS-SD Name:' _hap'

AppleTV 4K on 13.0:

"HomeKit Accessory Service".
Seemingly Random Port
DNS-SD Name of : '_homekit'
Additional AirPlay & Media Services

My Mac running HomeBridge runs the accessory protocol, and has a separate service and port for each device/accessory.

I am still thinking running 2 ATVs for Hubs is problematic when the traffic is split between the two and neither one gets the complete set of data.

IMG_3A3B9447CAD4-1

@kwass59
Copy link

kwass59 commented Oct 31, 2019

Since the update of iOS13 I have no response from my HomeKit items from remote, neither iPhone (6s plus) nor iPad pro. Hub is an ATV4 and the status in the HomeKit is connected.
Access in the local network is working.
Tried all resets, disconnects from iCloud etc. No success.
Now something new:

Using the Home App on my MACbook Pro (Catalina) I have remote access to all my items when I am connected to the network at work.

@SantaFox
Copy link

SantaFox commented Oct 31, 2019 via email

@coalfield
Copy link

coalfield commented Nov 1, 2019

I just had something similar occur on my setup as well. I have several homebridge instances that have been stable for a very long time, and they all stopped responding while remote. I do have two house's and my second house was okay. For me this started several days ago. I have not made any changes to my setup recently.

Things Tried

1 - Reboot AppleTV 4 - No change
2- Logout and login to iCloud on my Apple TV - No change
3 - Confirmed that my AppleTV was registered as the Home Hub - Yes ( On both my iPhone and Apple TV )
4 - Made sure my AppleTV and iPhone had the latest software - Yes, no change
5 - Reboot my iPhone - Success

Got excited that would fix me having the same issue, i tied everything else. Alas, no luck :(

I have however now tried the ATV 4K connected via wireless not LAN, and hey presto working. Very odd!

@extric99
Copy link

extric99 commented Nov 4, 2019

Are you sure that you have a single homehub registered. Seems homebridge has issues when multiple homehub have been setup. Switching to just the AppleTV instead of AppleTV and iPad solved everything for me.

@dgold105
Copy link

dgold105 commented Nov 4, 2019

The fix for me was to only use one Apple TV as a home hub and turn off all the others (I have 5 but only have one with the home hub enabled). I also turned my iPad off acting as a home hub. I also have a HomePod and that still also acts as a hub. Since I turned off the other Apple TV’s I always have external access.

@coalfield
Copy link

Only 1 home hub for me and only works for ATV on wireless mode. @dgold105 @extric99 are your ATVs wired or wireless?

@extric99
Copy link

extric99 commented Nov 4, 2019

I am connected wireless.
After i disabled the other homehubs I needed to remove and re-add the homebridge instance to the homehub. I was able to verify this as i have multiple homebridge instances and forgot that step on one. I was unable to access that one externally until I completed that step. Did you try this?

@coalfield
Copy link

I am connected wireless.
After i disabled the other homehubs I needed to remove and re-add the homebridge instance to the homehub. I was able to verify this as i have multiple homebridge instances and forgot that step on one. I was unable to access that one externally until I completed that step. Did you try this?

I did try reinstalling homebridge from scratch which included removing and re adding. However I will try again with this. I do however suspect this is an issue with wired connections to ATVs though but no idea if that is specific to me or wider issue.

@dgold105
Copy link

dgold105 commented Nov 5, 2019

Mine are connected with a wired connection.

@coalfield
Copy link

Mine are connected with a wired connection.

Thanks I guess it’s something within my network then. Thanks for the feedback I appreciate it

@mybays
Copy link

mybays commented Jan 11, 2020

I installed homebridge on my openwrt router,but I can't find the service.
when I capture the multicast protocol,I found the homebridge send it's protocol using wan address,so you can't find it's service on lan.

so I installed openwrt/homebridge on a device at the same subnetwork,I can find the service.

I think the problem is homebridge service use it's wan addr to broadcast it's service

@ebaauw
Copy link
Contributor

ebaauw commented Jan 11, 2020

You can set the interface on which homebridge sends the Bonjour announcements in config.json. I don’t know the exact setting by heart, but I’m sure Google does.

@stale
Copy link

stale bot commented Mar 11, 2020

This issue has been automatically marked as stale because it has not had recent activity, and will be closed if no further activity occurs. If this issue was overlooked, forgotten, or should remain open for any other reason, please reply here to call attention to it and remove the stale status. Thank you for your contributions.

@stale stale bot added the stale label Mar 11, 2020
@stale stale bot closed this as completed Mar 18, 2020
@jonasophie
Copy link

Hello, I've tried all previous solution without success, have you please any advice for me ?

Thanks in advance for you help
Homebridge: Version 0.4.53
iPhone: Version 13.3.1
iPad: Version 13.3.1

IMG_1735
IMG_1734

@extric99
Copy link

@jonasophie Has the remote access ever worked for you?
Is homekit enabled to use icloud?

Not sure what would be the issue if you just use an ipad as homehub. Never had an issue in that config. The above instructions help to resolve the issue when multiple homehubs have been activated and you want a stable setup with a single homehub.

@jonasophie
Copy link

@extric99 Thanks for your answer. Yes it worked yesterday ... (I have 3 plugins installed: Hue, FFmpeg & Config UI X).

I have both iPad & ATV ? but iPad is still "Standby" and ATV is "connected" in HomeApp.

I'm updating ATV firmware to the last version, will remove hub from Home app and try again.

Thanks

@extric99
Copy link

Please read my above responses in the thread because the issue you describe is exactly what I had. In your initial post you dont mention you have an appleTV. When you have two devices as homehub the issue occurs. Disable homehub on the ipad and only keep homehub on the appleTV. There is no need to have the ipad setup when you have an appleTV. Remove the homebridges, reboot and readd them. The issue will be fixed

@jonasophie
Copy link

After ATV updated (and reading your previous post)
Remove homebridge from Homeapp
All devices reboot
Add homebirdge

Everything is now working correctly
Thanks for your support

@extric99
Copy link

extric99 commented Mar 26, 2020

Great. Make sure you only have one homehub active at all times and you should be ok. I only needed to reboot my appletv once in several months

@BeBubbled
Copy link

BeBubbled commented Feb 21, 2021

I figured the answer.
The key problem to solve this is to have a home hub(apple tv, homepod or ipad) or you need to install additional homebridge add-on "https://gitlab.fancy.org.uk/hap-server/remote-access".
Home hub in someways provide a service that port your local device to public in encryption way bond to your apple id. Similarity problem, you can't reach your home router's 192.168.1.1 or 192.168.0.1 through your phone's LTE network.
So you need to have a home hub in the same local network(subnetwork is not accepted) with the homebridge device.

@dgold105
Copy link

I have the issue where some devices work outside the home network and some don't. Usually turning off and on the home hub function on the Apple TV fixes it for a day or two until the same issue happens again. Would this fix it for me or is this more for people who can't access anything at all remotely? Also how do I reverse this if it doesn't fix it? I presume I can uninstall somehow?

@BeBubbled
Copy link

I have the issue where some devices work outside the home network and some don't. Usually turning off and on the home hub function on the Apple TV fixes it for a day or two until the same issue happens again. Would this fix it for me or is this more for people who can't access anything at all remotely? Also how do I reverse this if it doesn't fix it? I presume I can uninstall somehow?

You need to ensure that only one home hub(multi-home hubs would lead to few devices not responding) and homebridge devices are in the same network. And if you have too many smart devices connect to the local network, you need to ensure that your wireless router supports such a burden.
You can also try to reset your homebridge.

@dgold105
Copy link

I have the issue where some devices work outside the home network and some don't. Usually turning off and on the home hub function on the Apple TV fixes it for a day or two until the same issue happens again. Would this fix it for me or is this more for people who can't access anything at all remotely? Also how do I reverse this if it doesn't fix it? I presume I can uninstall somehow?

You need to ensure that only one home hub(multi-home hubs would lead to few devices not responding) and homebridge devices are in the same network. And if you have too many smart devices connect to the local network, you need to ensure that your wireless router supports such a burden.
You can also try to reset your homebridge.

How does this work if you have multiple HomePods? I know with the an Apple TV you can turn off the Home Hub functionality but I don't know of a way to do it with a HomePod?

@gNeeUs
Copy link

gNeeUs commented Aug 21, 2022

Some of these comments indicate that Homebridge and hub (Apple TV) must be on the 'same network' whereas I believe it is commonly accepted that the Homebridge can be located elsewhere, e.g. cloud based, whether that's an installation on a dedicated computer, NAS, raspberry or anything else. I would like to clearly understand however, how the hub connects to a public IP address. Scenario below:

SITE 1: Homebridge running in Docker container on QNAP Container Station, router configured with port forwarding from its public IP with port 8581 to the private IP of the QNAP, the web interface of Homebridge is perfectly accessible via internet (http://publicip:8581), Homebridge has been advertised with Bonjour HAP, Ciao, Avahi doesn't seem to make a difference

SITE 2: Apple TV on private LAN, variety of domotica devices work fine with Apple Homekit from iPhone (e.g. IKEA Tradfri gateway with bulbs) also remotely accessible, several plugins worked fine when Homebridge was previously installed on a PC on the LAN.

There is no VPN between the two sites nor DMZ at any site.

My basic questions is: how can Homekit find the remote Homebridge via internet after scanning the QR code (does this connection code contain the public IP?) - Homekit only responds that it cannot Connect - or must the Homebridge be on the same LAN because in essence, Homebridge is just another Accessory (a gateway) to Apple Homekit?

@NorthernMan54
Copy link
Contributor

Simple answer is that it can not. The Apple TV and homebridge need to on the local network

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests