Closed David-Noble-at-work closed 7 years ago
So no comment then?
Sorry David! I instantly fixed that issue when I saw it :(
It should work now either by using the -U
or --user-storage-path
.
Thank you :)
Sent from my iPhone
On Dec 18, 2016, at 8:34 AM, Michael Riedel notifications@github.com<mailto:notifications@github.com> wrote:
Sorry David! I instantly fixed that issue when I saw it :(
It should work now either by using the -U or --user-storage-path.
- You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/gismo141/homebridge-server/issues/13#issuecomment-267831067, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AC5Zr14mQKEaLFiAB0QEycG7yE9A_swIks5rJWCagaJpZM4LQE0-.
Hi! I'm running into the same issue. Apologies, but could you provide a bit more detail to what you mean by using -U or -user-storage-path? When exactly do you refence these? I ran the install as documented in your readme. Appreciate your help, I'm new to these kind of things and trying to learn.
Yes, when you start homebridge you can specify a path to the directory containing your config.json file. Home bridge will the use that directory to fetch and then later store information about the accessories bound to it. On Linux systems--if you are running homebridge as a system service--a good place to keep this information is '/usr/local/etc/homebridge'. I can go into this more deeply, if you like.
Here is a sample command line from my Armbian service setup:
homebridge --user-storage-path /usr/local/etc/homebridge
Issue this command to get the full list of options:
homebridge --help
I hope this helps.
If you prefer, I could change the way to retrieve the path.
For example instead of requesting it as a commandline parameter with the -U
or the --user-storage-path
switch, I also could ask the user to write the path into the config.json
-file itself.
However I find the second approach a little bit cumbersome but if it is easier to understand, why not ;)
What would you prefer?
Using the command line parameter:
homebridge -U /usr/local/etc/homebridge
Or adding it to the config:
{
"platform": "Server",
"port": 8765,
"name": "Homebridge Server",
"log" : "systemd",
"config" : "/usr/local/etc/homebridge"
}
I would actually prefer that homebridge provide a stable API for you to call. It seems odd to require that an end user tell homebridge and then also tell homebridge-server by way of config.json where config.json is located.
Parsing the command line is better but not as good as a stable API. This would allow, for example, homebridge to change the mechanism for finding config.json without affecting plugins who wish to access it.
Sent from my iPhone
On Dec 18, 2016, at 10:23 PM, Michael Riedel notifications@github.com<mailto:notifications@github.com> wrote:
If you prefer, I could change the way to retrieve the path. For example instead of requesting it as a commandline parameter with the -U or the --user-storage-path switch, I also could ask the user to write the path into the config.json-file itself.
However I find the second approach a little bit cumbersome but if it is easier to understand, why not ;)
What would you prefer?
- You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/gismo141/homebridge-server/issues/13#issuecomment-267890712, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AC5Zr_M63R_lkZTP6_eLY19YHmZLTjChks5rJiLegaJpZM4LQE0-.
I totally agree with that - an API would be much better. At the moment I've implemented both solutions, hopefully it helps most people until this system gets more professional. Maybe I'll have a look at the "homebridge"-project itself and provide an API-access for the config.json.
So adding "config" : "/usr/local/etc/homebridge" will work now too? Assuming that that is the right path for me of course. I find that easier personally :)
Yes I've implemented both possibilities but I totally agree with @David-Noble-at-work that it is double-work.
Note to myself: I really have to document these things better :)
@David-Noble-at-work and @farstreet I haven't looked deep enough!
In fact Homebridge already provides a way to retrieve the config.json
.
I already updated my code so no one needs to add the path to the config itself!
Thank you :)
Keep up the good work!
If the directory containing config.json is specified with -U, life is good: homebridge starts. Otherwise, if the directory containing config.json is specified with --user-storage-path, homebridge fails to start because homebridge-server raises an exception.
Here are the relevant log entries: