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
Two homebridge instances as TWO SERVICES #1246
Comments
You mean you can't add both in the Home app? I think you'd need to give each a different name in the config file to do that. |
Hey, thanks for he reply :) No, that works fine. |
I think the services should have different IP addresses, different names and different "usernames" (the hex string) so HomeKit knows that there are actually two different HomeKit bridges. |
For a second instance I wrote this up for someone else
1) Create the .homebridge directory, but with a different name. In my case I used .homehue as I wanted a separate instance for the hue plugin.
mkdir ~/.homehue
2) Create the config.json in the .homehue directory, and only include in the config the plugins you want enabled. You must change the port number, name and username in the config.json or else homebridge will not start.
3) Start homebridge with the -U option and specify where to locate this instances .homebridge directory, which is this case is .homehue
homebridge -U ~/.homehue
Tada, you now have a second instance running. You will need to add the new homebridge instance in the Home app, but that’s it
…Sent from my iPad
On Apr 20, 2017, at 4:24 AM, Darko Krizic ***@***.***> wrote:
I think the services should have different IP addresses, different names and different "usernames" (the hex string) so HomeKit knows that there are actually two different HomeKit bridges.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or mute the thread.
|
What is the advantage of having more than one instance off home bridge |
If you have a large number of devices and plugins, splitting them increases reliability and performance. By limiting exposure to homebridge crashes to only the devices attached to the crashed instance, and performance is increased when launching as the requests are spread across multiple homebridge.
…Sent from my iPad
On Apr 20, 2017, at 6:11 AM, kapps7 ***@***.***> wrote:
What is the advantage of having more than one instance off home bridge
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub, or mute the thread.
|
Thanks, thats a good tip. Only yesterday I was thinking a search function in the Home app would be useful ;) |
I have 3 instances running, and the first has over 20 devices on a single plugin, second has about 5 plugins with one or two devices each and a third for Hue.
I settled on this as the first one runs most of my devices and is the most stable. The second has all the plugins I have been working on for the last few months. And the third has Hue which I needed to separate as part of supporting Alexa.
I had everything running in one but kept having to reset all my devices on a regular basis, so I moved all the ones I was playing with to a different instance. It wasn't number based. But other people have commented that having a large number of devices would cause a slow startup.
… On Apr 20, 2017, at 7:11 AM, kapps7 ***@***.***> wrote:
Thanks, thats a good tip. Only yesterday I was thinking a search function in the Home app would be useful ;)
By your standards what do you consider a large number of accessories for a stable home bridge.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub, or mute the thread.
|
I have roughly 20 accessories running on the single instance and keep an eye out on stability. On a side note, if I run homebridge on a remote computer and want to add it to my HomeKit as a second instance , will I need to be on the local network of that computer ? |
Just to confirm: the number of bridge instances is not related to/will not affect the maximum number of devices (=100) right? |
Nope, each bridge can host 99 accessories. (Although HomeKit does have a maximum 1000 accessories limit). |
@kapps7 I believe they need to be on the same network and share the same HomeKit hub. From your phone you would need access to them all at the same time. Without digging into complex network topology, it likely wouldn't work.
In my case I have several on the same machine. I also have a second machine on the same network.
Also, I forgot about the fourth instance I'm running. My daughter wanted control of the lights etc, but didn't want to be a HomeKit guest with me, so I spun up an instance just for her, but she doesn't have remote access as I don't have a HomeKit hub for her.
…Sent from my iPad
On Apr 21, 2017, at 1:01 AM, kapps7 ***@***.***> wrote:
I have roughly 20 accessories running on the single instance and keep an eye out on stability.
On a side note, if I run homebridge on a remote computer and want to add it to my HomeKit as a second instance , will I need to be on the local network of that computer ?
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub, or mute the thread.
|
I see or perhaps if you had a hub at the remote location signed into the same iCloud id as yours ? |
I'm running a single homebridge instance on my Mac mini server with homebridge-hue exposing 79 accessories (from a v2 Hue bridge) and homebridge-zp exposing 4 accessories.
You'll hit the CKRecord limit way before that. |
I have just setup my second homebridge instance as am now over 100 devices. Wondered how you get the command "homebridge -U ~/.homebridge2" (which is mine) to run as a service? Cheers |
Hey @PatiB87 , Were you able to figure out a solution to your problem? @NorthernMan54's response helped me set up a second instance of homebridge which I can run manually but I haven't been able to add this second instance to init.d/. Which I think was your original issue but then this thread conversation got derailed. My first homebridge instance gets run on reboot successfully but the second one doesn't. Also, when I do "sudo /etc/init.d/homesean start" the terminal outputs "starting", but if I follow up with "sudo /etc/init.d/homesean status" I get "Not running" #================================================ #================================================ Strangely, when I do this manually homebridge will run successfully: .. which I don't think makes sense since that is the same cmd in the init.d file. |
Hi @viictor924,
Here you are using ~ as a short way to point to your directory but be aware that a service is no started with your username (if not explicitly set) so try it again with a fully qualified path e.g.
Hope this helps |
Thanks @ramsnerm, I changed the path and then did "sudo update-rc.d homesean defaults" and it seems to be working now! |
Actually, I spoke too soon! homesean runs on startup now but homebridge stopped running on startup. I can still run both simultaneously by doing "/etc/init.d/homesean start" and "/etc/init.d/homebridge start". However, when I reboot the pi only homesean starts running #================================================ #================================================ However, after the pi reboots only homesean is running. |
I followed the @NorthernMan54 instructions and got the second instance setup, however, I'm unable to run the second homebrige without including the plugin from the first instance in the config file. Otherwords, the plugin won't allow the second homebridge to run if it's not in the config. Has anyone looked into a homebridge container using Docker? I've seen a couple on docker hub but the problem I'm facing is I'm unable to install the application in the container due to capabilities issues and also lack of experience setting it up. The needs `pi@raspberrypi:~ $ homebridge -U ~/.homecam TypeError: Cannot read property 'server' of null |
Before goong Docker, you could try and specify a different plugin directory for the second instance (I think this is done through the |
@ebaauw Sorry - How to use the -p command line, below is how I have my directory setup The problem seems to be on the domoticz plugin. Other plugins no problem. Homebridge 1 Homebridge 2 |
See https://github.com/nfarina/homebridge#plugin-development. I guess you could start Homebridge 2 as:
If not, move the camera plugin to a different directory and specify that for |
@jeylites
Looking at the log you shared, I don’t think that the edomoticz plugin should have an error that causes homebridge to exit if it can’t find a valid config entry. Raise an issue against edomoticz and ask them to trap your error, and log a warning instead. It should be a 10 minute fix for the developer.
… On Oct 26, 2017, at 9:28 AM, Erik Baauw ***@***.***> wrote:
Before goong Docker, you could try and specify a different plugin directory for the second instance (I think this is done through the -P command line parameter).
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub <#1246 (comment)>, or mute the thread <https://github.com/notifications/unsubscribe-auth/AS5CmORumAl8QZbKshBeGISf3PT80DVOks5swIkPgaJpZM4M2GG_>.
|
@ebaauw - "-p" Will give it a go to see what comes out of it. The other thing is I've been experimenting with homebridge Docker compiled by @oznu, very cool stuff. If anyone wants to give it a go, check his GitHub link. Also, there are other Homebridge Docker image out there running on Synology, RPI that I have yet to try. With his help, I was able to set up several instances in containers. The only bummer for me is since I need ffmpeg-omx to run my cameras, omx is not Alpine Linux compatible from what I was told. However, there's a ffmpeg image available on Alpine hub. The other thing is, I have no idea how to set up a container running Peter Scargill scrip and/or a container running Rasbian to install whatever stuff in it.... similar to a VM. |
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. |
Hi, about running 2 hombridges istances, my question is: if I install a new plugin in this environment, this plugin will be available for both istances, also if I can configure the plugin only in one config.json file. Is this right? |
Depending on the plugin, you could actually configure it in both instances. On startup, homebridge first loads all plugins from the
Then it initialises the plugins that are listed under
To prevent plugins from being loaded (and dynamic platform plugins from being initialised), use the For example, on my production Pi, I run two homebridge services, one for homebridge-hue, on for my other plugins. The corresponding
|
Hi! Is there any way of running 2 instances on a mac as a service? / how to? Greez paul |
Yes.
See the Wiki, https://github.com/nfarina/homebridge/wiki/Install-Homebridge-on-macOS#starting-homebridge-automatically-with-launchd. You would have to create two |
I created the file, not sure about the -H Will test it on the weekend... |
I said it before, will say it again Incase it got forgotten. There’s a well documented docker based homebridge that runs on Raspberry pi, Synology and/ or may be Mac available at OZNU github page. Some of the good features that I like
config directories, instances performance check, individual instances reboot, terminal, installation & un-installation of libraries, etc. Just google OZNU Homebridge it should show up. |
Hello, |
There are so many videos on youtube , shows step by step. |
Currently I’m running 6 instances on my RPI, instance 1-5 does all my daily automation stuff, instance 6 - I use it to run test, r&d stuff. It has been 2 years can’t complain about using this method. Here’s some information for you |
Hello again, |
Synology, I’m pretty sure someone worked on something similar. Or at least the setup should be far off compared to RPI. I would raise the question for the sake of discussion. |
Sorry, my bad. Updated my comment to reflect |
@jeylites Indeed in docker for synology there is an option to duplicate in one click... |
Working now after some trial and error :) thx for your help |
Hey,
I can already successfully run two Homebridge, one is currently set up as service (init.d on Raspberry Pi on Jessie) and the other one is started manually via the command line.
I therefore copied the /home/pi/.homebridge folder to /home/pi/.homebridge-k to have a second config.json file.
Now I can successfully run the second instance with "sudo homebridge -U /home/pi/.homebridge-k" but I don't know how to set up a second service.
I tried just to create a "homebridge-k" service in a similar fashion as I created the original "homebridge" service (according to these instruction: https://github.com/nfarina/homebridge/wiki/Running-HomeBridge-on-a-Raspberry-Pi#running-homebridge-on-bootup-initd) but it ain't working. :(
Thanks a lot for helping. :)
The text was updated successfully, but these errors were encountered: