HomeKit Can I run Homebridge off a Mac?

gpspad

macrumors 6502a
Original poster
Feb 4, 2014
587
19
I have a Nest Thermometer I'd like to control with my HomePods. I have seen some posts about setting up a Raspberry PI to run it, but I have a Mac mini I run as a server on my network that also runs Plex.

Are there any tutorials on how to install Home bridge on Mac OSX?
 

gwhizkids

macrumors 603
Jun 21, 2013
5,404
5,060
I have a Nest Thermometer I'd like to control with my HomePods. I have seen some posts about setting up a Raspberry PI to run it, but I have a Mac mini I run as a server on my network that also runs Plex.

Are there any tutorials on how to install Home bridge on Mac OSX?
I set it up on my iMac to run Nest, my garage doors and, initially, my WeMo plug (which gained HomeKit functionality in August).

Here’s a good how to guide from iMore: How to connect incompatible accessories to HomeKit using Homebridge http://www.imore.com/how-connect-non-homekit-devices-homekit-using-homebridge
 
  • Like
Reactions: T'hain Esh Kelch

gwhizkids

macrumors 603
Jun 21, 2013
5,404
5,060
One thing to remember is that the Mac has to be running for this to work (it’s a server). Sounds like that’s what you are planning but just wanted to throw that out there. That’s why Raspberry Pi’s are so popular for this.
 

gpspad

macrumors 6502a
Original poster
Feb 4, 2014
587
19
Thanks for the replies the mini acts as my Plex server, a backup server, and a printer server.

I followed the above steps and did well until I got to the Nest Developers page. I found a Nest Homebridge plugin, followed the steps but ran into an issue when the Nest developer page has you select permissions.

It seems like the plugin instructions just have your select it, the actuall page seems to want you to write a function. I have bee looking all day and can't seem to find what I am supposed to put in the fields to get my Nest PIN.

Anyone know the best plugin to use?
 

gwhizkids

macrumors 603
Jun 21, 2013
5,404
5,060
Thanks for the replies the mini acts as my Plex server, a backup server, and a printer server.

I followed the above steps and did well until I got to the Nest Developers page. I found a Nest Homebridge plugin, followed the steps but ran into an issue when the Nest developer page has you select permissions.

It seems like the plugin instructions just have your select it, the actuall page seems to want you to write a function. I have bee looking all day and can't seem to find what I am supposed to put in the fields to get my Nest PIN.

Anyone know the best plugin to use?
Did you see/reference this page: https://www.npmjs.com/package/homebridge-nest

I did not have to write a function. As I recall, the setup was just as it’s laid out on the page I linked to above. A bit clunky but it works perfectly.
 

gpspad

macrumors 6502a
Original poster
Feb 4, 2014
587
19
Yea, the problem is I get to this screen....

Nest_developer_Screen.jpg


The home page mentions something about a new way to set permissions. Unless I am missing something you can't just select the permissions, you have to type something in the fields.
 

gwhizkids

macrumors 603
Jun 21, 2013
5,404
5,060
Yea, the problem is I get to this screen....

View attachment 804211

The home page mentions something about a new way to set permissions. Unless I am missing something you can't just select the permissions, you have to type something in the fields.
Ah! These are the camera settings. I just have the thermostat.
 

gpspad

macrumors 6502a
Original poster
Feb 4, 2014
587
19
I just happened to select that item, but even selecting the Thermometer requires you to fill in a field like that.

Guess this is new and if doesnt seem like its been addressed in any of the homebridge nest plugins.
 

gwhizkids

macrumors 603
Jun 21, 2013
5,404
5,060
I just happened to select that item, but even selecting the Thermometer requires you to fill in a field like that.

Guess this is new and if doesnt seem like its been addressed in any of the homebridge nest plugins.
My first step in that case is to go to this URL (the support URL for the plug-in). The author of the plug-in is sure to know if this is new or not. https://github.com/chrisjshull/homebridge-nest
 

gpspad

macrumors 6502a
Original poster
Feb 4, 2014
587
19
Thanks I solved it, you put in a dummy phrase and the page generates the PIN.

Next road block is now, how do I get the hexadecimal version of my username for the configuration file?

I have been looking for that for two hors now, just converting my name from plain text to hexadecimal isn't working. Homebridge wants a mac address as the username.
 

gwhizkids

macrumors 603
Jun 21, 2013
5,404
5,060
Thanks I solved it, you put in a dummy phrase and the page generates the PIN.

Next road block is now, how do I get the hexadecimal version of my username for the configuration file?

I have been looking for that for two hors now, just converting my name from plain text to hexadecimal isn't working. Homebridge wants a mac address as the username.
I’m not home but don’t the Nests have a MAC address? I think you can find them on device.

EDIT: here’s the info on locating that: https://nest.com/support/article/Technical-Info-Tour
 

gpspad

macrumors 6502a
Original poster
Feb 4, 2014
587
19
I figured it out, it's another dummy address put into the homebridge configuration file.

I finally got it going, a lot of small things not in the online tutorials.

There is a delay, Im going to play with it before I make homebridge startup with the server.

I wish nest would just work HomeKit, but its neat to have siri control the thermostat.
 

gwhizkids

macrumors 603
Jun 21, 2013
5,404
5,060
I figured it out, it's another dummy address put into the homebridge configuration file.

I finally got it going, a lot of small things not in the online tutorials.

There is a delay, Im going to play with it before I make homebridge startup with the server.

I wish nest would just work HomeKit, but its neat to have siri control the thermostat.
Glad you got it working. I’m running mine on the family Mac, not a dedicated server. So it’s prone to be disconnected if someone turns the machine off. And then I really miss it. Have my MyQ garage door opener set up this way too.
 

pacmania1982

macrumors 6502a
Nov 19, 2006
989
186
Birmingham, UK
I followed this guide but I can't get the launch on boot.

I just get a console full of this:

Nov 23 20:36:51 Homebridge com.apple.xpc.launchd[1] (com.homebridge.server[429]): Service exited with abnormal code: 78
Nov 23 20:36:51 Homebridge com.apple.xpc.launchd[1] (com.homebridge.server): Service only ran for 0 seconds. Pushing respawn out by 10 seconds.

Whats weird is I can run homebridge and connect if I manually run it from the terminal.

The only thing I have to go on is this error log: /bin/sh: npm: command not found

My plist is:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>homebridge</string>
<key>ProgramArguments</key>
<array>
<!-- Modify these two lines to reflect your node location and homebridge install location -->
<string>/usr/local/bin/node</string>
<string>/usr/local/bin/homebridge</string>
</array>
<key>StandardErrorPath</key>
<string>/Users/homebridge/Library/Logs/Homebridge/homebridge.err.log</string>
<key>StandardOutPath</key>
<string>/Users/homebridge/Library/Logs/Homebridge/homebridge.out.log</string>
<key>RunAtLoad</key>
<true/>
<key>KeepAlive</key>
<true/>
</dict>
</plist>

Does anyone have any ideas where I'm going wrong?
[doublepost=1543012140][/doublepost]
I’m not home but don’t the Nests have a MAC address? I think you can find them on device.

EDIT: here’s the info on locating that: https://nest.com/support/article/Technical-Info-Tour
I don't actually think you need the real MAC address of your Nest - I don't remember having to put mine in when I originally set it up on my Ubuntu VM.
 

chown33

Moderator
Staff member
Aug 9, 2009
8,356
4,334
Gourd City
...
Whats weird is I can run homebridge and connect if I manually run it from the terminal.

The only thing I have to go on is this error log: /bin/sh: npm: command not found
...
I'll take a shot at answering this.

Relevant fact #1:
The command runs from a Terminal window.

Relevant fact #2:
The command does NOT run from a launchd job.

Relevant fact #3:
This error message in the launchd job's error log:
/bin/sh: npm: command not found


My guess is that the 'npm' command is not located in a directory that's in the default PATH. As a result, when 'npm' is given as a command in the launchd job's shell script, the command isn't found and the script fails.

The reason it works in a Terminal window is almost certainly that there's a modified profile file (read the man page for bash, and find the word "profile") which alters PATH to include a dir or dirs where npm resides.

To find out where npm resides, paste this into a Terminal window:
Code:
which npm
If npm is available as a command, i.e. it resides in a dir in the PATH variable, then the output will be the absolute pathname of the 'npm' that was found.


If an absolute path for 'npm' was output, then you basically have two options:
1. Change the unadorned 'npm' commands in your shell script to use the absolute pathname of the npm command that was listed in the Terminal window. In short, specify exactly which 'npm' command to run, rather than relying on PATH dir's being searched.

2. Change the PATH variable to include the dir where 'npm' resides. You can do this at the front of the shell script, before any commands are run but after any initial shebang line. You could also do it by adding an environment variable to your launchd job's plist (google search terms: launchd plist environment variable).


I'll also note that your plist looks a lot different than the one given in the github.com article you referenced. In particular, the github plist sets PATH in the environment, and has a completely different ProgramArguments array.

Can you describe exactly where you got your plist from? A URL would be good, so I can read the context of what it should be doing.
 
Last edited:

pacmania1982

macrumors 6502a
Nov 19, 2006
989
186
Birmingham, UK
@chown33 you are the man! I did echo $PATH and the path for npm wasn't listed. So I did as you said and did which npm which gave me /usr/local/bin/npm, so I added that to my /etc/path

Thanks!!!