Skip to content

Instantly share code, notes, and snippets.

@daz
Last active June 30, 2017 07:56
Show Gist options
  • Save daz/68f1374872dd906439989687944d7be9 to your computer and use it in GitHub Desktop.
Save daz/68f1374872dd906439989687944d7be9 to your computer and use it in GitHub Desktop.
LIFX with Homebridge on macOS
sudo npm uninstall -g homebridge
sudo npm uninstall -g homebridge-lifx-lan
sudo npm install -g --unsafe-perm homebridge
sudo npm install -g homebridge-lifx-lan
cat << 'JSON' > ~/.homebridge/config.json
{
"bridge": {
"name": "Homebridge",
"username": "CC:22:3D:E3:CE:30",
"port": 51826,
"pin": "031-45-154"
},
"description": "Barebones Homebridge with LifxLan.",
"platforms": [
{
"platform": "LifxLan",
"name": "LIFX"
}
]
}
JSON
cat << 'XML' > ~/Library/LaunchAgents/com.homebridge.server.plist
<?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>RunAtLoad</key>
<true/>
<key>KeepAlive</key>
<true/>
<key>Label</key>
<string>com.homebridge.server</string>
<key>ProgramArguments</key>
<array>
<string>/usr/local/bin/homebridge</string>
<string>-I</string>
</array>
<key>EnvironmentVariables</key>
<dict>
<key>PATH</key>
<string>/usr/local/bin/:$PATH</string>
</dict>
</dict>
</plist>
XML
launchctl unload ~/Library/LaunchAgents/com.homebridge.server.plist
launchctl load ~/Library/LaunchAgents/com.homebridge.server.plist
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment