[OBSOLETE] Hello, Home HomeKit (and Siri!) control via homebridge

via cli? i am running ubuntu server

ok found it and now i am getting this error. config.json is listed below error.

sjs@homebridge:~/.homebridge$ homebridge
*** WARNING *** The program ‘nodejs’ uses the Apple Bonjour compatibility layer of Avahi.
*** WARNING *** Please fix your application to use the native API of Avahi!
*** WARNING *** For more information see http://0pointer.de/avahi-compat?s=libdns_sd&e=nodejs
*** WARNING *** The program ‘nodejs’ called ‘DNSServiceRegister()’ which is not supported (or only supported partially) in the Apple Bonjour compatibility layer of Avahi.
*** WARNING *** Please fix your application to use the native API of Avahi!
*** WARNING *** For more information see http://0pointer.de/avahi-compat?s=libdns_sd&e=nodejs&f=DNSServiceRegister
[6/11/2016, 2:49:34 PM] Loaded plugin: homebridge-nest
[6/11/2016, 2:49:34 PM] Registering platform ‘homebridge-nest.Nest’
[6/11/2016, 2:49:34 PM] —
/usr/lib/node_modules/homebridge/lib/server.js:181
var username = config.bridge.username;
^

TypeError: Cannot read property ‘username’ of undefined
at Server._loadConfig (/usr/lib/node_modules/homebridge/lib/server.js:181:31)
at new Server (/usr/lib/node_modules/homebridge/lib/server.js:44:23)
at module.exports (/usr/lib/node_modules/homebridge/lib/cli.js:26:16)
at Object. (/usr/lib/node_modules/homebridge/bin/homebridge:17:22)
at Module._compile (module.js:413:34)
at Object.Module._extensions…js (module.js:422:10)
at Module.load (module.js:357:32)
at Function.Module._load (module.js:314:12)
at Function.Module.runMain (module.js:447:10)
at startup (node.js:148:18)
at node.js:405:3
sjs@homebridge:~/.homebridge$ cat config.json
{
“description”: “JSON API”,
“platforms”: [
{
“platform”: “SmartThings”,
“name”: “SmartThings”,
“app_url”: “https://graph-na02-useast1.api.smartthings.com:443/api/smartapps/installations/”,
“app_id”: “xxxxx”,
“access_token”: “xxxxx”

found i am missing the bridge section. not sure why it isn’t in there. trying to piece them together now

I need help here guys. I feel like I’m so close but just can’t figure it out.

I am getting the following error:
[6/14/2016, 11:04:12 PM] [SmartThings] Initializing SmartThings platform…
Loading legacy platform SmartThings
[6/14/2016, 11:04:13 PM] [SmartThings] Fetching SmartThings devices…
/usr/local/lib/node_modules/homebridge/lib/api.js:92
if (name.indexOf(’.’) == -1) {
^

TypeError: Cannot read property ‘indexOf’ of undefined

Below is my config.json. Any help would be appreciated.

{
“bridge”: {
“name”: “Homebridge”,
“username”: “D0:52:A8:16:F3:41”,
“port”: 51826,
“pin”: “031-45-154”
},
“description”: “JSON API”,
“platforms”: [{
“platform”: “SmartThings”,
“name”: “SmartThings”,
“app_id”: “XXXXXXXXX-XXXXXX-4bf5-9578-fe98fb61d085”,
“access_token”: “XXXXXXXXX-XXXx-4786-9b11-5d7c7751c997”
}, {
“accessories”: [

		{
			"location": {
				"latitude": 35.93339797,
				"longitude": -84.09202385,
				"mode": "Home",
				"name": "Home",
				"temperature_scale": "F",
				"zip_code": "37930"
			},
			"deviceList": [{
				"name": "Arlo Switch",
				"deviceid": "1450f990-d777-4bda-abbe-366643dc0b2b",
				"capabilities": {
					"Switch": 1,
					"Polling": 1,
					"Switch Level": 1,
					"Refresh": 1,
					"Energy Meter": 1,
					"Power Meter": 1,
					"Sensor": 1,
					"Actuator": 1
				},
				"commands": {
					"on": [],
					"off": [],
					"poll": [],
					"setLevel": ["NUMBER", "NUMBER"],
					"refresh": [],
					"reset": []
				},
				"attributes": {
					"switch": "off",
					"level": 99,
					"energy": 11.562,
					"power": 0
				}
			}, {
				"name": "Dining Table Lights",
				"deviceid": "3ac4d21f-e8fa-45ed-9ab1-02d35b53c96d",
				"capabilities": {
					"Switch": 1,
					"Polling": 1,
					"Switch Level": 1,
					"Refresh": 1,
					"Indicator": 1,
					"Sensor": 1,
					"Actuator": 1
				},
				"commands": {
					"on": [],
					"off": [],
					"poll": [],
					"setLevel": ["NUMBER", "NUMBER"],
					"refresh": [],
					"indicatorWhenOn": [],
					"indicatorWhenOff": [],
					"indicatorNever": []
				},
				"attributes": {
					"switch": "off",
					"level": 95,
					"indicatorStatus": null
				}
			}, {
				"name": "Front Entry Light",
				"deviceid": "32a64b69-dd03-4163-a583-4c3f46cc393a",
				"capabilities": {
					"Switch": 1,
					"Polling": 1,
					"Refresh": 1,
					"Indicator": 1,
					"Sensor": 1,
					"Actuator": 1
				},
				"commands": {
					"on": [],
					"off": [],
					"poll": [],
					"refresh": [],
					"indicatorWhenOn": [],
					"indicatorWhenOff": [],
					"indicatorNever": []
				},
				"attributes": {
					"switch": "off",
					"indicatorStatus": null
				}
			}, {
				"name": "Front Hall Lights",
				"deviceid": "d5af0645-793d-4398-92fc-67069f365a7d",
				"capabilities": {
					"Switch": 1,
					"Polling": 1,
					"Switch Level": 1,
					"Refresh": 1,
					"Indicator": 1,
					"Sensor": 1,
					"Actuator": 1
				},
				"commands": {
					"on": [],
					"off": [],
					"poll": [],
					"setLevel": ["NUMBER", "NUMBER"],
					"refresh": [],
					"indicatorWhenOn": [],
					"indicatorWhenOff": [],
					"indicatorNever": []
				},
				"attributes": {
					"switch": "on",
					"level": 99,
					"indicatorStatus": null
				}
			}, {
				"name": "Garage Coach Light",
				"deviceid": "1ac51519-d423-4032-9426-57d978cfe738",
				"capabilities": {
					"Switch": 1,
					"Polling": 1,
					"Refresh": 1,
					"Indicator": 1,
					"Sensor": 1,
					"Actuator": 1
				},
				"commands": {
					"on": [],
					"off": [],
					"poll": [],
					"refresh": [],
					"indicatorWhenOn": [],
					"indicatorWhenOff": [],
					"indicatorNever": []
				},
				"attributes": {
					"switch": "on",
					"indicatorStatus": null
				}
			}, {
				"name": "Garage Light",
				"deviceid": "3265092a-531b-4118-b48b-d7f38c6d7a83",
				"capabilities": {
					"Switch": 1,
					"Polling": 1,
					"Refresh": 1,
					"Indicator": 1,
					"Sensor": 1,
					"Actuator": 1
				},
				"commands": {
					"on": [],
					"off": [],
					"poll": [],
					"refresh": [],
					"indicatorWhenOn": [],
					"indicatorWhenOff": [],
					"indicatorNever": []
				},
				"attributes": {
					"switch": "off",
					"indicatorStatus": "when off"
				}
			}, {
				"name": "Kitchen Lights",
				"deviceid": "4bd490c2-d91f-45bb-98df-fe67746cc196",
				"capabilities": {
					"Switch": 1,
					"Polling": 1,
					"Switch Level": 1,
					"Refresh": 1,
					"Indicator": 1,
					"Sensor": 1,
					"Actuator": 1
				},
				"commands": {
					"on": [],
					"off": [],
					"poll": [],
					"setLevel": ["NUMBER", "NUMBER"],
					"refresh": [],
					"indicatorWhenOn": [],
					"indicatorWhenOff": [],
					"indicatorNever": []
				},
				"attributes": {
					"switch": "on",
					"level": 89,
					"indicatorStatus": null
				}
			}, {
				"name": "LightStrips 1",
				"deviceid": "ed00a54e-9ac1-4915-b2f1-2cbb9013876d",
				"capabilities": {
					"Switch": 1,
					"Switch Level": 1,
					"Refresh": 1,
					"Color Control": 1,
					"Sensor": 1,
					"Actuator": 1
				},
				"commands": {
					"on": [],
					"off": [],
					"setLevel": ["NUMBER", "NUMBER"],
					"refresh": [],
					"setHue": ["NUMBER"],
					"setSaturation": ["NUMBER"],
					"setColor": ["COLOR_MAP"],
					"setAdjustedColor": [],
					"reset": []
				},
				"attributes": {
					"switch": "on",
					"level": 100,
					"hue": 72,
					"saturation": 99,
					"color": "#5201FD"
				}
			}, {
				"name": "LightStrips 2",
				"deviceid": "27e14cdf-ea07-4ff1-9257-fde66bf5db8e",
				"capabilities": {
					"Switch": 1,
					"Switch Level": 1,
					"Refresh": 1,
					"Color Control": 1,
					"Sensor": 1,
					"Actuator": 1
				},
				"commands": {
					"on": [],
					"off": [],
					"setLevel": ["NUMBER", "NUMBER"],
					"refresh": [],
					"setHue": ["NUMBER"],
					"setSaturation": ["NUMBER"],
					"setColor": ["COLOR_MAP"],
					"setAdjustedColor": [],
					"reset": []
				},
				"attributes": {
					"switch": "on",
					"level": 100,
					"hue": 72,
					"saturation": 99,
					"color": "#5201FD"
				}
			}, {
				"name": "LightStrips 3",
				"deviceid": "a106266d-0df1-4f2c-a220-9f2d1e73743f",
				"capabilities": {
					"Switch": 1,
					"Switch Level": 1,
					"Refresh": 1,
					"Color Control": 1,
					"Sensor": 1,
					"Actuator": 1
				},
				"commands": {
					"on": [],
					"off": [],
					"setLevel": ["NUMBER", "NUMBER"],
					"refresh": [],
					"setHue": ["NUMBER"],
					"setSaturation": ["NUMBER"],
					"setColor": ["COLOR_MAP"],
					"setAdjustedColor": [],
					"reset": []
				},
				"attributes": {
					"switch": "on",
					"level": 97,
					"hue": 72,
					"saturation": 99,
					"color": "#5201FD"
				}
			}, {
				"name": "Living Room Fan",
				"deviceid": "1ac42dc8-4000-4062-8fa5-421bf79f8cf3",
				"capabilities": {
					"Switch": 1,
					"Polling": 1,
					"Refresh": 1,
					"Indicator": 1,
					"Sensor": 1,
					"Actuator": 1
				},
				"commands": {
					"on": [],
					"off": [],
					"poll": [],
					"refresh": [],
					"indicatorWhenOn": [],
					"indicatorWhenOff": [],
					"indicatorNever": []
				},
				"attributes": {
					"switch": "off",
					"indicatorStatus": null
				}
			}, {
				"name": "Living Room Light",
				"deviceid": "56f8dcd3-0897-4200-8803-720f693370fc",
				"capabilities": {
					"Switch": 1,
					"Polling": 1,
					"Switch Level": 1,
					"Refresh": 1,
					"Indicator": 1,
					"Sensor": 1,
					"Actuator": 1
				},
				"commands": {
					"on": [],
					"off": [],
					"poll": [],
					"setLevel": ["NUMBER", "NUMBER"],
					"refresh": [],
					"indicatorWhenOn": [],
					"indicatorWhenOff": [],
					"indicatorNever": []
				},
				"attributes": {
					"switch": "on",
					"level": 99,
					"indicatorStatus": null
				}
			}, {
				"name": "Master Bath Light",
				"deviceid": "b880ef95-1d68-4f32-b669-1c6cf784e296",
				"capabilities": {
					"Switch": 1,
					"Polling": 1,
					"Refresh": 1,
					"Indicator": 1,
					"Sensor": 1,
					"Actuator": 1
				},
				"commands": {
					"on": [],
					"off": [],
					"poll": [],
					"refresh": [],
					"indicatorWhenOn": [],
					"indicatorWhenOff": [],
					"indicatorNever": []
				},
				"attributes": {
					"switch": "off",
					"indicatorStatus": null
				}
			}, {
				"name": "Master Bath Motion",
				"deviceid": "5eb2731c-aade-49c6-a206-6d7a89d48bab",
				"capabilities": {
					"Temperature Measurement": 1,
					"Battery": 1,
					"Motion Sensor": 1,
					"Configuration": 1,
					"Refresh": 1,
					"Health Check": 1
				},
				"commands": {
					"configure": [],
					"refresh": [],
					"ping": [],
					"enrollResponse": []
				},
				"attributes": {
					"temperature": 69,
					"battery": 100,
					"motion": "inactive",
					"checkInterval": null
				}
			}, {
				"name": "MasterBed Fan",
				"deviceid": "a67e7c13-2789-4b7c-96e8-2056a2e63778",
				"capabilities": {
					"Switch": 1,
					"Polling": 1,
					"Refresh": 1,
					"Indicator": 1,
					"Sensor": 1,
					"Actuator": 1
				},
				"commands": {
					"on": [],
					"off": [],
					"poll": [],
					"refresh": [],
					"indicatorWhenOn": [],
					"indicatorWhenOff": [],
					"indicatorNever": []
				},
				"attributes": {
					"switch": "on",
					"indicatorStatus": "when off"
				}
			}, {
				"name": "MasterBed Lights",
				"deviceid": "0a00de88-2376-4d12-8df7-f3ab3a6857bd",
				"capabilities": {
					"Switch": 1,
					"Polling": 1,
					"Switch Level": 1,
					"Refresh": 1,
					"Indicator": 1,
					"Sensor": 1,
					"Actuator": 1
				},
				"commands": {
					"on": [],
					"off": [],
					"poll": [],
					"setLevel": ["NUMBER", "NUMBER"],
					"refresh": [],
					"indicatorWhenOn": [],
					"indicatorWhenOff": [],
					"indicatorNever": []
				},
				"attributes": {
					"switch": "off",
					"level": 99,
					"indicatorStatus": null
				}
			}, {
				"name": "Nest Protect - Hallway",
				"deviceid": "738849cd-73cc-4813-815b-642b317cc774",
				"capabilities": {
					"Battery": 1,
					"Polling": 1,
					"Refresh": 1,
					"Smoke Detector": 1,
					"Carbon Monoxide Detector": 1
				},
				"commands": {
					"poll": [],
					"refresh": [],
					"log": ["STRING", "STRING"]
				},
				"attributes": {
					"battery": null,
					"smoke": "ok",
					"carbonMonoxide": "ok",
					"alarmState": "ok",
					"batteryState": "ok",
					"uiColor": "green",
					"softwareVer": "2.0rc5",
					"lastConnection": "Jun 14, 2016 - 10:43:59 PM",
					"lastTested": "Dec 31, 1969 - 7:00:00 PM",
					"isTesting": "false",
					"apiStatus": "ok",
					"debugOn": "Off",
					"onlineStatus": "Online"
				}
			}, {
				"name": "Nest Thermostat - Family Room (Nest)",
				"deviceid": "e2feb46f-d36c-4c44-9829-b498b713ed74",
				"capabilities": {
					"Temperature Measurement": 1,
					"Relative Humidity Measurement": 1,
					"Polling": 1,
					"Refresh": 1,
					"Thermostat": 1,
					"Sensor": 1,
					"Actuator": 1,
					"Thermostat Cooling Setpoint": 1,
					"Thermostat Mode": 1,
					"Thermostat Fan Mode": 1,
					"Thermostat Operating State": 1,
					"Thermostat Heating Setpoint": 1,
					"Thermostat Setpoint": 1
				},
				"commands": {
					"poll": [],
					"refresh": [],
					"setHeatingSetpoint": ["NUMBER"],
					"setCoolingSetpoint": ["NUMBER"],
					"off": [],
					"heat": [],
					"emergencyHeat": [],
					"cool": [],
					"setThermostatMode": [],
					"fanOn": [],
					"fanAuto": [],
					"fanCirculate": [],
					"setThermostatFanMode": ["ENUM"],
					"auto": [],
					"setSchedule": ["JSON_OBJECT"],
					"away": [],
					"present": [],
					"setAway": [],
					"setHome": [],
					"setPresMode": [],
					"setFanMode": [],
					"setTemperature": [],
					"temperatureUp": [],
					"temperatureDown": [],
					"log": [],
					"heatingSetpointUp": [],
					"heatingSetpointDown": [],
					"coolingSetpointUp": [],
					"coolingSetpointDown": []
				},
				"attributes": {
					"temperature": 74,
					"humidity": 45,
					"heatingSetpoint": null,
					"coolingSetpoint": 74,
					"thermostatSetpoint": null,
					"thermostatMode": "cool",
					"thermostatFanMode": "auto",
					"thermostatOperatingState": "idle",
					"schedule": null,
					"temperatureUnit": "F",
					"targetTemp": null,
					"softwareVer": "5.5-5",
					"lastConnection": "Jun 14, 2016 - 10:49:44 PM",
					"apiStatus": "ok",
					"hasLeaf": "Off",
					"debugOn": "Off",
					"onlineStatus": "Online"
				}
			}, {
				"name": "Water Leak Sensor",
				"deviceid": "0b731e80-f879-490d-b97f-fd397b7d3443",
				"capabilities": {
					"Temperature Measurement": 1,
					"Battery": 1,
					"Water Sensor": 1,
					"Configuration": 1,
					"Refresh": 1,
					"Health Check": 1
				},
				"commands": {
					"configure": [],
					"refresh": [],
					"ping": [],
					"enrollResponse": []
				},
				"attributes": {
					"temperature": 70,
					"battery": 77,
					"water": "dry",
					"checkInterval": null
				}
			}, {
				"name": "David's iPhone",
				"deviceid": "62be24e9-76cb-4c7e-8145-1c50746b24c4",
				"capabilities": {
					"Presence Sensor": 1,
					"Sensor": 1
				},
				"commands": {},
				"attributes": {
					"presence": "not present"
				}
			}, {
				"name": "Mike's iPhone",
				"deviceid": "bd3c0af7-4a08-4b33-8638-bc59ead21687",
				"capabilities": {
					"Presence Sensor": 1,
					"Sensor": 1
				},
				"commands": {},
				"attributes": {
					"presence": "present"
				}
			}, {
				"name": "Rhonda's iPhone",
				"deviceid": "a656fb5d-e328-4aea-9544-bc24f2f8a269",
				"capabilities": {
					"Presence Sensor": 1,
					"Sensor": 1
				},
				"commands": {},
				"attributes": {
					"presence": "present"
				}
			}, {
				"name": "Patio Door",
				"deviceid": "b8cb84cc-bbc8-41ed-a62e-f55f93790a2c",
				"capabilities": {
					"Battery": 1,
					"Contact Sensor": 1,
					"Configuration": 1,
					"Sensor": 1
				},
				"commands": {
					"configure": []
				},
				"attributes": {
					"battery": null,
					"contact": "closed"
				}
			}]
		}
	]
}]

}

1 Like

Ok, after struggling all day with this, these are my adapted instructions that are completely up to date for running Homebridge on a Raspberry Pi 2 Model B. If you run on other systems, you may have to adapt the installation of nodejs.

Instructions:
noobs clean install Raspbian

Connect using Terminal (on Mac):
SSH pi@xx.x.x.xx
copy key (in MAC terminal)
nano /Users/xxxx/.ssh/
paste key
SSH pi@xx.x.x.xx

sudo apt-get update
sudo apt-get upgrade
sudo apt-get install git-core make

Install Node.js

wget https://nodejs.org/dist/v6.2.1/node-v6.2.1-linux-armv7l.tar.gz
tar -xvf node-v6.2.1-linux-armv7l.tar.gz
cd node-v6.2.1-linux-armv7l
sudo cp -R * /usr/local/
cd /usr/local/
node –v

Install Other Dependent Packages & Finally, Homebridge

sudo npm install npm -g
sudo apt-get install libavahi-compat-libdnssd-dev
sudo apt-get install libkrb5-dev
sudo npm install --unsafe-perm -g homebridge
sudo npm install -g homebridge-smartthings

Install json SmartApp:


Goto the ‘My SmartApps’ tab
Click ‘+ New SmartApp’ button top right
Click ‘From Code’
paste json-complete-api.groovy
Click ‘Create’
Click ‘App Settings’
Click ‘OAuth’
Click ‘Enable OAuth in Smart App’ leave all settings as defaults
Click ‘Update’
Finally, under the json-complete-api.groovy app, click “Publish”

On iPhone:
Open Smartthings app.
Go to Marketplace - Smartapps - My apps - JSON Complete API
Select all my devices
Go to the Config screen
Send the text to my laptop

Now SSH back into the Pi:
nano /home/pi/.homebridge/config.json
(Paste the lower part from text sent from iPhone)

{
"bridge": {
"name": "Homebridge",
"username": "D0:00:00:00:00:00",
"port": 51826,
"pin": "031-45-154"
},

"description": "JSON API",
"platforms": [{
"platform": "SmartThings",
"name": "SmartThings",
"app_url": "https://graph.api.smartthings.com:443/api/smartapps/installations/",
"app_id": “INSERT APP_ID HERE“,
"access_token": “INSERT ACCESS_TOKEN HERE“
}]
}

Exit & Save

Homebridge

Back on the Phone:
Open EVE (or any HomeKit app or Home on iOS 10) on iPhone and enter PIN number from Homebridge program.
Note: If you want Homebridge to auto-start, you should follow the auto startup instructions BEFORE configuring it on the phone, as it seems to create a new instance of Homebridge.

**Auto Startup (**More advanced)
On newer Raspberry Pi and Debian systems, managing of services with init.d is (transparently) replaced with systemd. If you wish to use systemd for running Homebridge on boot, you can follow these instructions.
As you can see, the service definition is much shorter than a comparable init.d script.

(1) Place homebridge under /etc/default
sudo nano /etc/default/homebridge
copy and past homebridge code and save.

homebridge:

# Defaults / Configuration options for homebridge
# The following settings tells homebridge where to find the config.json file and where to persist the data (i.e. pairing and others)
HOMEBRIDGE_OPTS=-U /var/homebridge

# If you uncomment the following line, homebridge will log more 
# You can display this via systemd's journalctl: journalctl -f -u homebridge
# DEBUG=*

(2)Place homebridge.service under /etc/systemd/system on your Raspberry Pi.
sudo nano /etc/systemd/system
copy and past homebridge.service code and save.

homebridge.service:

[Unit]
Description=Node.js HomeKit Server 
After=syslog.target

[Service]
Type=simple
User=homebridge
EnvironmentFile=/etc/default/homebridge
ExecStart=/usr/local/bin/homebridge $HOMEBRIDGE_OPTS
Restart=on-failure
RestartSec=10
KillMode=process

[Install]
WantedBy=multi-user.target

(3) Create a system user named homebridge. You can easily create this user with
useradd --system homebridge

(4) Create a directory called /var/homebridge, writable by the user created above, and a corresponding config.json file in that directory.

sudo chmod 777 /var/homebridge
sudo nano /var/homebridge/config.json

copy and paste config.json file here

Homebridge by default looks for its configuration in/home/<username>/.homebridge. This is unsuitable for services and the -U /var/homebridge flag ensures the config is read from a different place.

(5) Enable and run the service (first time) with the following commands:

systemctl daemon-reload
systemctl enable homebridge
systemctl start homebridge

You can check the status of the service by calling
systemctl status homebridge
On subsequent reboots, it should start automatically, if not, use the journalctl -u homebridge to check the error cause.
Notes

  • The service will restart after 10 seconds if it fails for any reason (or if you kill it for example with kill -s SIGSEGV )

Resources:


7 Likes

thought i finally had it but now i get this error. i confirmed my token is what shows in the app. i confirmed my config.json is valid with the online file checker

[6/15/2016, 4:01:29 AM] Loaded plugin: homebridge-nest
[6/15/2016, 4:01:29 AM] Registering platform ‘homebridge-nest.Nest’
[6/15/2016, 4:01:29 AM] —
[6/15/2016, 4:01:29 AM] There was a problem reading your config.json file.
[6/15/2016, 4:01:29 AM] Please try pasting your config.json file here to validate it: http://jsonlint.com
[6/15/2016, 4:01:29 AM]
/usr/lib/node_modules/homebridge/lib/server.js:176
throw err;
^

SyntaxError: Unexpected token {
at Object.parse (native)
at Server._loadConfig (/usr/lib/node_modules/homebridge/lib/server.js:170:19)
at new Server (/usr/lib/node_modules/homebridge/lib/server.js:44:23)
at module.exports (/usr/lib/node_modules/homebridge/lib/cli.js:26:16)
at Object. (/usr/lib/node_modules/homebridge/bin/homebridge:17:22)
at Module._compile (module.js:413:34)
at Object.Module._extensions…js (module.js:422:10)
at Module.load (module.js:357:32)
at Function.Module._load (module.js:314:12)
at Function.Module.runMain (module.js:447:10)
at startup (node.js:148:18)
at node.js:405:3

any chance of someone developing an easy installer for this? I’m trying to install it as is but I keep running into problems (mac).

Unfortunately not at this time. It involves some knowledge of Terminal & Linux navigation. My instructions are as close as it gets to easy.

And we’re officially up and running here. @brianjlambert’s guide helped. I actually didn’t need most of my config.json but whatever it all works. Going to use your guide again tomorrow when the new Pi comes in the mail. But for now the mac works and I’m happy. Thanks all.

1 Like

can i see your config.json? i cannot get this thing right.

Note: For username, it can be any string that looks like a MAC address. fill the app_id and access_token with your values. This is for the North American version, or else the app_url must be adjusted for UK users.

Is anyone on iOS 10 Beta that can confirm if Homebridge works with the new Home app?
I saw somewhere that it may only work with supported devices.

It does work, and seems to work with the same devices that are exposed via Homebridge that used to work with other apps add/or Siri.

1 Like

thanks. i have something wrong for sure. i used your exact config (with actual app id and token) and it gives that same error. i had found some others with this issue but their fixes did not seem to work for me.

[6/16/2016, 3:46:28 PM]
/usr/lib/node_modules/homebridge/lib/server.js:176
throw err;
^

SyntaxError: Unexpected token {
at Object.parse (native)
at Server._loadConfig (/usr/lib/node_modules/homebridge/lib/server.js:170:19)
at new Server (/usr/lib/node_modules/homebridge/lib/server.js:44:23)
at module.exports (/usr/lib/node_modules/homebridge/lib/cli.js:26:16)
at Object. (/usr/lib/node_modules/homebridge/bin/homebridge:17:22)
at Module._compile (module.js:413:34)
at Object.Module._extensions…js (module.js:422:10)
at Module.load (module.js:357:32)
at Function.Module._load (module.js:314:12)
at Function.Module.runMain (module.js:447:10)
at startup (node.js:148:18)
at node.js:405:3

I know I’ve seen others try this to no avail, but just to make sure, did you try using the JSON validator at http://jsonlint.com to verify that the syntax of the config.json is correct. For a long while, other users’ config.json had too many { } brackets.

It actually looks like its picking up a syntax error in the homebridge files…

Anyone have a better knowledge of error codes?

yea. and i opened a thread on the github site. someone thinks it is the " in my file. not sure what to do. they said the ascii character may be causing an issue. i have tried multiple config.jsons that are validated on the site you mentioned but fail to load on my server

This is a screenshot of my config file (redacted of course) for reference. I just made up the MAC address.

and the status:

I also set up a cron job to restart the server every day at 3a to refresh the homebridge. I may change it to once a week, it’s been running great today.

You must use a “plain text” editor to create or modify config.json. Do NOT use apps like TextEdit on Mac or Wordpad on Windows; these apps will corrupt the formatting of the file in hard-to-debug ways. I suggest using the free Atom text editor.

1 Like

Thanks Megan,
I here is what I tried so far.
notepad
notepad ++
atom

to no avail.

i may just type in up manually in nano to see. kind of a pain but doable

1 Like

I did mine in nano, just to be safe. I would share, but I am being lazy at work and my Pi is at home :slight_smile: