Giter Club home page Giter Club logo

homebridge's Introduction

Homebridge

Unlocking Door

Homebridge is a lightweight Node.js server you can run on your home network that emulates the iOS HomeKit API. It supports Plugins, which are community-contributed modules that provide a basic bridge from HomeKit to various 3rd-party APIs provided by manufacturers of "smart home" devices.

Since Siri supports devices added through HomeKit, this means that with Homebridge you can ask Siri to control devices that don't have any support for HomeKit at all. For instance, using just some of the available plugins, you can say:

  • Siri, unlock the back door. [pictured to the right]
  • Siri, open the garage door.
  • Siri, turn on the coffee maker.
  • Siri, turn on the living room lights.
  • Siri, good morning!

You can explore all available plugins at the NPM website by searching for the keyword homebridge-plugin.

Community

The official Homebridge Discord server and Reddit community are where users can discuss Homebridge and ask for help.

Homebridge Discord Homebridge Reddit

HomeKit communities can also be found on both Discord and Reddit.

Installation

raspbian

Raspberry Pi

Official Homebridge Raspberry Pi Image
Install Homebridge on Raspbian


linux

Linux

Debian or Ubuntu Linux | Red Hat, CentOS or Fedora Linux | Arch / Manjaro Linux|Install Homebridge on Arch Linux


macos

macOS

Install Homebridge on macOS


windows

Windows 10 / 11

Install Homebridge on Windows 10 / 11 Using Hyper V


docker

Docker

Install Homebridge on Docker
Synology | Unraid | QNAP | TrueNAS Scale


docker

Synology DSM

Install Homebridge on Synology DSM 7

Other Platforms

Other Platforms

Adding Homebridge to iOS

  1. Open the Home app on your device.
  2. Tap the Home tab, then tap .
  3. Tap Add Accessory, then scan the QR code shown in the Homebridge UI or your Homebridge logs.

If the bridge does not have any accessories yet, you may receive a message saying Additional Set-up Required, this is ok, as you add plugins they will show up in the Home app without the need to pair again (except for Cameras and TVs).

Cameras and most TV devices are exposed as separate accessories and each needs to be paired separately. See this wiki article for instructions.

Interacting with your Devices

Once your device has been added to HomeKit, you should be able to tell Siri to control your devices. However, realize that Siri is a cloud service, and iOS may need some time to synchronize your device information with iCloud.

One final thing to remember is that Siri will almost always prefer its default phrase handling over HomeKit devices. For instance, if you name your Sonos device "Radio" and try saying "Siri, turn on the Radio" then Siri will probably start playing an iTunes Radio station on your phone. Even if you name it "Sonos" and say "Siri, turn on the Sonos", Siri will probably just launch the Sonos app instead. This is why, for instance, the suggested name for the Sonos accessory is "Speakers".

Plugin Development

The https://developers.homebridge.io website contains the Homebridge API reference, available service and characteristic types, and plugin examples.

The Homebridge Plugin Template project provides a base you can use to create your own platform plugin.

There are many existing plugins you can study; you might start with the Homebridge Example Plugins or a plugin that already implements the device type you need.

When writing your plugin, you'll want Homebridge to load it from your development directory instead of publishing it to npm each time. Run this command inside your plugin project folder so your global installation of Homebridge can discover it:

npm link

You can undo this using the npm unlink command.

Then start Homebridge in debug mode:

homebridge -D

This will start up Homebridge and load your in-development plugin. Note that you can also direct Homebridge to load your configuration from somewhere besides the default ~/.homebridge, for example:

homebridge -D -U ~/.homebridge-dev

This is very useful when you are already using your development machine to host a "real" Homebridge instance (with all your accessories) that you don't want to disturb.

Common Issues

Home App Says Accessory Already Added

To fix this, Reset Homebridge.

My iOS App Can't Find Homebridge

Try the following:

  1. Swap between the Bonjour HAP and Ciao mDNS Advertiser options. See the wiki for more details.
  2. iOS DNS cache has gone stale or gotten misconfigured. To fix this, turn airplane mode on and back off to flush the DNS cache.

Limitations

  • One bridge can only expose 150 accessories due to a HomeKit limit. You can however run your plugins as a Child Bridge or run Multiple Homebridge Instances to get around this limitation.
  • Once an accessory has been added to the Home app, changing its name via Homebridge won't be automatically reflected in iOS. You must change it via the Home app as well.

Why Homebridge?

Technically, the device manufacturers should be the ones implementing the HomeKit API. And I'm sure they will - eventually. When they do, this project will be obsolete, and I hope that happens soon. In the meantime, Homebridge is a fun way to get a taste of the future, for those who just can't bear to wait until "real" HomeKit devices are on the market.

Credit

Homebridge was originally created by Nick Farina.

The original HomeKit API work was done by Khaos Tian in his HAP-NodeJS project.

homebridge's People

Contributors

alistairg avatar bezzers avatar bwp91 avatar cosmo avatar danimal4326 avatar donavanbecker avatar dotsam avatar edc1591 avatar ilcato avatar iraven avatar justme-1968 avatar khaost avatar kraigm avatar maddox avatar madmod avatar nfarina avatar northernman54 avatar oznu avatar plasticrake avatar rodtoll avatar snowdd1 avatar spacecowgirl314 avatar sphtkr avatar stephenyeargin avatar stipus avatar straccio avatar supereg avatar sweidinger avatar thkl avatar webdeck avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

homebridge's Issues

Should be Accessory getServices be asynchronous?

Should getServices be asynchronous to support services discovery? As for by providing this interface we assume that list of services and characteristics is static which could be not always true.

Error on start

Hello, i want to test your homebridge. But i have an error when i start the node.

[email protected] start /home/beber/homebridge
node app.js

Starting HomeBridge server...

undefined:18
}
^
SyntaxError: Unexpected token }
at Object.parse (native)
at Object. (/home/beber/homebridge/app.js:21:19)
at Module._compile (module.js:456:26)
at Object.Module._extensions..js (module.js:474:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Function.Module.runMain (module.js:497:10)
at startup (node.js:119:16)
at node.js:902:3

npm ERR! [email protected] start: node app.js
npm ERR! Exit status 8
npm ERR!
npm ERR! Failed at the [email protected] start script.
npm ERR! This is most likely a problem with the homebridge package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node app.js
npm ERR! You can get their info via:
npm ERR! npm owner ls homebridge
npm ERR! There is likely additional logging output above.
npm ERR! System Linux 3.19.0-20-generic
npm ERR! command "/usr/bin/nodejs" "/usr/bin/npm" "run" "start"
npm ERR! cwd /home/beber/homebridge
npm ERR! node -v v0.10.25
npm ERR! npm -v 1.4.21
npm ERR! code ELIFECYCLE
npm WARN This failure might be due to the use of legacy binary "node"
npm WARN For further explanations, please read
/usr/share/doc/nodejs/README.Debian

0 info it worked if it ends with ok
1 verbose cli [ '/usr/bin/nodejs', '/usr/bin/npm', 'run', 'start' ]
2 info using [email protected]
3 info using [email protected]
4 verbose run-script [ 'prestart', 'start', 'poststart' ]
5 info prestart [email protected]
6 info start [email protected]
7 verbose unsafe-perm in lifecycle true
8 info [email protected] Failed to exec start script
9 error [email protected] start: node app.js
9 error Exit status 8
10 error Failed at the [email protected] start script.
10 error This is most likely a problem with the homebridge package,
10 error not with npm itself.
10 error Tell the author that this fails on your system:
10 error node app.js
10 error You can get their info via:
10 error npm owner ls homebridge
10 error There is likely additional logging output above.
11 error System Linux 3.19.0-20-generic
12 error command "/usr/bin/nodejs" "/usr/bin/npm" "run" "start"
13 error cwd /home/beber/homebridge
14 error node -v v0.10.25
15 error npm -v 1.4.21
16 error code ELIFECYCLE
17 verbose exit [ 1, true ]

ha you got an idea ?

Cant start the Server on Raspberry Pi 2

Hello, i can't start the server on myRPI.. this is the error-message

pi@smarthomeserver:~/homebridge$ sudo npm run start

[email protected] start /home/pi/homebridge
node app.js

Starting HomeBridge server...
module.js:338
throw err;
^
Error: Cannot find module '../build/Release/dns_sd_bindings'
at Function.Module._resolveFilename (module.js:336:15)
at Function.Module._load (module.js:278:25)
at Module.require (module.js:365:17)
at require (module.js:384:17)
at Object. (/home/pi/homebridge/lib/HAP-NodeJS/node_modules/mdns/lib/dns_sd.js:32:22)
at Module._compile (module.js:460:26)
at Object.Module._extensions..js (module.js:478:10)
at Module.load (module.js:355:32)
at Function.Module._load (module.js:310:12)
at Module.require (module.js:365:17)

npm ERR! Linux 3.18.0-20-rpi2
npm ERR! argv "/usr/bin/node" "/usr/bin/npm" "run" "start"
npm ERR! node v0.12.4
npm ERR! npm v2.10.1
npm ERR! code ELIFECYCLE
npm ERR! [email protected] start: node app.js
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] start script 'node app.js'.
npm ERR! This is most likely a problem with the homebridge package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node app.js
npm ERR! You can get their info via:
npm ERR! npm owner ls homebridge
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR! /home/pi/homebridge/npm-debug.log
pi@smarthomeserver:~/homebridge$

have anybody a hint for me ?

HAP-NodeJS as npm vs submodule

Any particular reason you're including HAP-NodeJS as a submodule rather than an npm dependency? Including it as an npm dependency would simplify the installation process a bit.

minimum required characteristics for thermostat service

does anyone know what the minimum required characteristics for the thermostat service are?

with just TARGET_TEMPERATURE_CTYPE i can't add the device to eve or insteon+. insteon+ gives an error about not meeting homekit standards.

thanks
andre

ps: this is for a platform shim for the FHEM home automation system. switches, lights, dimmers, color lights and temperature/humidity sensors are already working bidirectional including pushing updates from fhem to homekit and querying current device state if not cached.

pps: does the SPEAKER_STYPE service really work? my devices just appear as switches in eve. and OUTPUTVOLUME_CTYPE is not visible at all.

Z-Wave thermostat

Is there anyway to get a wave thermostat working? I'm running homebridge on my pi2 running through smart things. I'm wondering if it would be possible to have Siri set the temperature or turn on and off the thermostat. I'm guessing a Js needs to be written for it but I have no idea. any thoughts would be cool!

XfinityHome.js commands

This isn't really an issue, so I'm sorry to post on here, but just wondering if you can give some examples of the spoken commands that you would tell Siri to arm the alarm system for example?

Server-side change publication?

I know HomeKit supports the ability to "push" server-side state changes back to subscribing HomeKit clients. With my zero understanding of Node, it looks like the underlying HAP library supports this too.

Any chance you could point me to a quick example (which I'll happily admit I may have missed) on how you're anticipating developers build shims that support state notification changes? I'm more than happy to start building out some shims (my first would be support for the NuTech AD2USB alarm interface)... but updating HomeKit from the backend would be critical....

Too many open files

After running for 10-12 hours I get this error:

  return binding.open(pathModule._makeLong(path), stringToFlags(flags), mode);
                 ^
Error: EMFILE, too many open files '/tmp/spawn-sync_input_208028a732bfc46b34947fb70'
    at Object.fs.openSync (fs.js:427:18)
    at Object.fs.writeFileSync (fs.js:966:15)
    at spawnSyncFallback (/root/chains-devices/homebridge/node_modules/sync-request/node_modules/spawn-sync/lib/spawn-sync.js:83:6)
    at doRequest (/root/chains-devices/homebridge/node_modules/sync-request/index.js:19:13)
    at Object.RequestAccessory.toggle (/root/chains-devices/homebridge/accessories/Request.js:31:20)
    at Object.characteristics.onUpdate (/root/chains-devices/homebridge/accessories/Request.js:109:50)
    at Object.updateCharacteristicValue (/root/chains-devices/homebridge/lib/HAP-NodeJS/Characteristic.js:34:9)
    at Object.processCharacteristicsValueWrite (/root/chains-devices/homebridge/lib/HAP-NodeJS/AccessoryController.js:59:16)
    at Object.responseCharacteristic (/root/chains-devices/homebridge/lib/HAP-NodeJS/Server.js:112:29)
    at IncomingMessage.<anonymous> (/root/chains-devices/homebridge/lib/HAP-NodeJS/Server.js:52:17)

Error on start

hello, sorry, but you close my issue ans my problem is again here.

beber@beber-Portable:~/homebridge$ sudo npm run start

[email protected] start /home/beber/homebridge
node app.js

Starting HomeBridge server...
*** 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

/home/beber/homebridge/lib/HAP-NodeJS/node_modules/ed25519/node_modules/bindings/bindings.js:83
throw e
^
Error: Symbol ed25519_module not found.
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Module.require (module.js:364:17)
at require (module.js:380:17)
at bindings (/home/beber/homebridge/lib/HAP-NodeJS/node_modules/ed25519/node_modules/bindings/bindings.js:76:44)
at Object. (/home/beber/homebridge/lib/HAP-NodeJS/node_modules/ed25519/index.js:1:99)
at Module._compile (module.js:456:26)
at Object.Module._extensions..js (module.js:474:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)

npm ERR! [email protected] start: node app.js
npm ERR! Exit status 8
npm ERR!
npm ERR! Failed at the [email protected] start script.
npm ERR! This is most likely a problem with the homebridge package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node app.js
npm ERR! You can get their info via:
npm ERR! npm owner ls homebridge
npm ERR! There is likely additional logging output above.
npm ERR! System Linux 3.19.0-20-generic
npm ERR! command "/usr/bin/nodejs" "/usr/bin/npm" "run" "start"
npm ERR! cwd /home/beber/homebridge
npm ERR! node -v v0.10.25
npm ERR! npm -v 1.4.21
npm ERR! code ELIFECYCLE
npm WARN This failure might be due to the use of legacy binary "node"
npm WARN For further explanations, please read
/usr/share/doc/nodejs/README.Debian

npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /home/beber/homebridge/npm-debug.log
npm ERR! not ok code 0
beber@beber-Portable:~/homebridge$

[Feature] Phillips hue shim

There is a fairly robust node module that, if I'm reading this all correctly, could be used in creating a shim. I did a refactor on a Hubot module recently to use that one, so I may be able to take a look at this one.

Custom commands for HomeKit

Hey,

Is it possible that you can insert your own commands that aren't related to HomeKit but for Siri with this library?

Proper Fahrenheit support

(Moving discussion from #70, #65)

So it looks like HomeKit thermostats can be set to Celsius or Fahrenheit directly. Notice how in the HomeKit Accessory Simulator you can set the unit type. And in the JSON service info, there's a TEMPERATURE_UNITS_CTYPE setting, as well as a unit: property for the TARGET_TEMPERATURE_CTYPE.

Does anyone know how this is supposed to work? Is user supposed to say something like "Change my thermostat units to fahrenheit"? Or is this an innate setting of the accessory itself, and if so what is the correct value?

Thermostat celsius conversion

I am creating an accessory for my Radio Thermostat CT50. It has its own API. The unit talks in Fahrenheit, but it seems that Siri likes to talk in Celsius after viewing this thread https://github.com/KhaosT/HAP-NodeJS/issues/29

The problem is that when I say "Set the temperature to 85", Siri sends in 29 celsius instead of 29.4444, which then gets converted to 84.2F. This is just one example.

Is this a bug with Siri/HomeKit? Is it a bug with HAP? Or is it a bug with the Insteon+ app? I have traced the issue into node_modules/HAP-NodeJS/Server.js this.accessoryController.processCharacteristicsValueWrite(data, request.socket.remotePort); but cannot debug data to see if the phone is at fault or not.

siri homekit

Never get prompt to enter PIN

I have installed Domoticz on my pi and am able to access it from the web and have created a dummy device and test lights on the site
latest commit of homekit is also installed on the pi and the config file is set up to point to local address and port 8080

I can see the devices in the insteon+ app however after selecting the device, I never get a pop up to enter the pin and eventually the device times out and i get the following printed to the console

[Domoticz] There was a problem connecting to Domoticz.
An Error Occured on HAP side connection, { [Error: connect ETIMEDOUT] code: 'ETIMEDOUT', errno: 'ETIMEDOUT', syscall: 'connect' }
Server Disconnected

HomeBridge stops working after a time

I'm posting this as a discussion topic for an issue I've been having personally to see if it's been a problem for anyone else.

I have my personal homebridge running on an old Mac Mini with about a dozen or so accessories loaded. Everything works very well generally, but after the server has been running for a day or so, I'm unable to get Siri to do anything until I restart the server.

I've worked around this by making the server auto-restart daily, but before proposing that this be "the solution", I wanted to know if anyone else has experienced this.

/cc @jnewland, @maddox

Philips Hue rate limiting

The Philips Hue bridge only allows a certain number of requests each second. When I change a scene it is sending an API call for each characteristic of each bulb. A possible solution to this might be to group characteristic changes for each bulb into a single call. I'm trying to figure out a good way to cache characteristic changes by bulb for a few ms before sending them to the bridge. I am working on a PR but don't have a lot of time today so it may have to wait until tomorrow.

Multiple ios 8 devices

Is there a known way to get homebridge working with more than one ios 8.4 device at the same time?
When my light devices are assigned to an ios 8 device then other ios devices can not find them (eve app). Devices that are not assigned could be used. Trying IOS 9 beta 2 did not work for me at all because "eve" could not access icloud homekit database for an unknown reason.
Thanx in advance.

PS: using FHEM platform shim which can be found here (german thread): http://forum.fhem.de/index.php/topic,32652.msg314166.html#msg314166

Server doesn't want to start. Have spent days trying to learn how to make this work, NEED HELP PLEASE

I'm trying to connect to my wink hub. I feel like I'm very close but can't seem to get the server to run. I really need some help. Any help would be greatly appreciated. Here is the messages I get.

administrator@HomeBridge:~/homebridge$ node -v && npm -v
v0.12.7
2.11.3

administrator@HomeBridge:~/homebridge$ sudo npm run start

[email protected] start /home/administrator/homebridge
node app.js
Starting HomeBridge server...
*** 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
Loading 1 platforms...
[Wink] Initializing Wink platform...
[Wink] Fetching Wink devices.
Loading 0 accessories...
response in http: {"data":{"access_token":"*************_","refresh_token":"_
_","token_type":"bearer","token_endpoint":"https://winkapi.quirky.com/oauth2/token","scopes":"full_access"},"errors":[],"pagination":{},"access_token":"**_*******_","refresh_token":"**_**********","token_type":"bearer","token_endpoint":"https://winkapi.quirky.com/oauth2/token","scopes":"full_access"}
response in http: {"data":[],"errors":[],"pagination":{"count":0}}
administrator@HomeBridge:~/homebridge$

Explore "Bridged mode" server

(Discussion forked from #54)

So here's an example of a problem here - try running HAP-NodeJS in bridged mode, add the bridge (which bridges a few sample accessories). Now you can do things like "Open the garage door" and it works behind the bridge.

However, now shut down HAP-NodeJS, remove/rename the GarageDoorOpener_accessory.js and restart the server. HomeKit doesn't "know" that the garage door is now gone. It still shows up in your HomeKit apps on your phone. And you can't Delete it yourself, because it was a bridged accessory. It's just sort of a zombie.

Blinds (or up / down state?)

Two questions,

  • I'm going to look at extending the http shim, as I think this will solve how to integrate with my HA server. However, is there any way to add a verb to the shim, up or down (ie Siri turn the blind up / Siri turn up the blind)?
  • Building on that, there is actually a blind object, called WINDOW_COVERING, any ideas how this might work?

start on reboot

do you know the best way to start homebridge on reboot on the raspberry pi. I tried using npm forever, but ran into stability issues

Error during install

Trying to install homebridge on my Raspberry pi and got this error after the first "sudo npm install"

npm ERR! Error: 1995645456:error:10067066:elliptic curve routines:ec_GFp_simple_oct2point:invalid encoding:../deps/openssl/openssl/crypto/ec/ecp_smpl.c:939:
npm ERR! 1995645456:error:1408D132:SSL routines:SSL3_GET_KEY_EXCHANGE:bad ecpoint:../deps/openssl/openssl/ssl/s3_clnt.c:1566:
npm ERR!
npm ERR! at CleartextStream._puller (tls.js:618:24)
npm ERR! at CleartextStream.CryptoStream._pull (tls.js:552:19)
npm ERR! at SecurePair.cycle (tls.js:842:20)
npm ERR! at EncryptedStream.CryptoStream.write (tls.js:230:13)
npm ERR! at Socket.ondata (stream.js:38:26)
npm ERR! at Socket.EventEmitter.emit (events.js:88:17)
npm ERR! at TCP.onread (net.js:395:14)
npm ERR! If you need help, you may report this log at:
npm ERR! http://github.com/isaacs/npm/issues
npm ERR! or email it to:
npm ERR! [email protected]

Initially I posted this issue within npm github area but no luck so far, it seems related with OpenSSL

Homebridge won't start

Hi,
I upgraded my nodejs to 0.12.1 and then installed everything. Unfortunately the server doesn't start with following details in the logfile.

pi@raspberrypi ~/homebridge $ npm run start

[email protected] start /home/pi/homebridge
node app.js

Starting HomeBridge server...
/home/pi/homebridge/lib/HAP-NodeJS/node_modules/mdns/lib/dns_sd.js:35
throw ex;
^
Error: Module did not self-register.
at Error (native)
at Module.load (module.js:355:32)
at Function.Module._load (module.js:310:12)
at Module.require (module.js:365:17)
at require (module.js:384:17)
at Object. (/home/pi/homebridge/lib/HAP-NodeJS/node_modules/mdns/lib/dns_sd.js:24:20)
at Module._compile (module.js:460:26)
at Object.Module._extensions..js (module.js:478:10)
at Module.load (module.js:355:32)
at Function.Module._load (module.js:310:12)

npm ERR! Linux 3.12.21+
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "run" "start"
npm ERR! node v0.12.1
npm ERR! npm v2.5.1
npm ERR! code ELIFECYCLE
npm ERR! [email protected] start: node app.js
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] start script 'node app.js'.
npm ERR! This is most likely a problem with the homebridge package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node app.js
npm ERR! You can get their info via:
npm ERR! npm owner ls homebridge
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR! /home/pi/homebridge/npm-debug.log

The content of the npm-debug.log file is
0 info it worked if it ends with ok
1 verbose cli [ '/usr/local/bin/node', '/usr/local/bin/npm', 'run', 'start' ]
2 info using [email protected]
3 info using [email protected]
4 verbose run-script [ 'prestart', 'start', 'poststart' ]
5 info prestart [email protected]
6 info start [email protected]
7 verbose unsafe-perm in lifecycle true
8 info [email protected] Failed to exec start script
9 verbose stack Error: [email protected] start: node app.js
9 verbose stack Exit status 1
9 verbose stack at EventEmitter. (/usr/local/lib/node_modules/npm/lib/ut
ils/lifecycle.js:213:16)
9 verbose stack at EventEmitter.emit (events.js:110:17)
9 verbose stack at ChildProcess. (/usr/local/lib/node_modules/npm/lib/ut
ils/spawn.js:14:12)
9 verbose stack at ChildProcess.emit (events.js:110:17)
9 verbose stack at maybeClose (child_process.js:1008:16)
9 verbose stack at Process.ChildProcess._handle.onexit (child_process.js:1080:5)
10 verbose pkgid [email protected]
11 verbose cwd /home/pi/homebridge
12 error Linux 3.12.21+
13 error argv "/usr/local/bin/node" "/usr/local/bin/npm" "run" "start"
14 error node v0.12.1
15 error npm v2.5.1
16 error code ELIFECYCLE
17 error [email protected] start: node app.js
17 error Exit status 1
18 error Failed at the [email protected] start script 'node app.js'.
18 error This is most likely a problem with the homebridge package,
18 error not with npm itself.
18 error Tell the author that this fails on your system:
18 error node app.js
18 error You can get their info via:
18 error npm owner ls homebridge
18 error There is likely additional logging output above.
19 verbose exit [ 1, true ]

Any suggestion ?
Thanks
Rudy

Can only add one Device on Raspberry Pi 2

Hello,

it works just great on my Mac, but when I run it on my Raspberry Pi 2, it wouldn't add a second device.

I tried resetting my HomeKit configuration and deleted the persist-Folder.
I can add one device, the second one appears but when I select it, it wouldn't return and states as busy.

Pull Request

Hey, I created a shim for the HomeMatic CCU(XML-API), but i can't make a pull request, because you have only one branch, or am I doing something wrong??

[Brainstorm] Platform discovery and installation

Certain platforms like Philips Hue require a non-trivial setup process to require secret keys. (See #40) To simplify this process we might consider a secondary persistent store for platforms and accessories or a interface to save changes to it's entry in the config.json. (Not great but nice to have a central place for all config that the user can read.) Alternatively giving each accessory and platform it's own sub folder (possibly as a separate node module like yeoman and node-red) would allow them to store persistent caches independently of other modules and have the side benefit of reducing core dependencies. Having separate node modules would also make contributing to the project easier because we could avoid merge conflicts with package.json, but add effort required to discover new modules. Separate repos would fragment this small project too much and increase complexity managing conflicts with Siri's keywords. I propose that we create a separate repo for "bridges" that are npm modules with a common prefix. That way you could run npm i homebridge-philips-hue or whatever and we would still have a central place to manage issues. It would also remove the issue of conflicts in package.json. An example of a project using this pattern is tomahawk.

WARNING *** Please fix your application to use the native API of Avahi!

Hi,

I'm getting the following error when trying to run this on a Pi 2:

[email protected] start /home/pi/homebridge
node app.js

Starting HomeBridge server...
*** WARNING *** The program 'node' 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=node
*** WARNING *** The program 'node' 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=node&f=DNSServiceRegister

Node version is v0.12.1 and NPM is 2.5.1. My installation steps are:

sudo apt-get install libavahi-compat-libdnssd-dev (I get a MDNS related error without these packages)
wget http://node-arm.herokuapp.com/node_latest_armhf.deb
sudo dpkg -i node_latest_armhf.deb
git clone https://github.com/nfarina/homebridge.git
cd homebridge
git submodule init
git submodule update
npm install
cd lib/HAP-NodeJS
npm install

I have created a config.json based on the sample output but when I run npm run start I get the above error. Does anyone have any ideas?

Many thanks in advance.

Notify Homekit about changes

I looked a lot around in homebride and HAP-NodeJS code to figure out how to notify any homekit device about changes of an accessory. For example a thermostat: it detects periodically the current temperature and through a node library I'll receive an event. How can I pass this value to the hap service?

Another case are my light switches. The light is not only switchable through an app. There are light switches spread over the whole building. How to tell homekit about the actual bulb state when a switch will be actuated?!

I know about the onRead callback, but this seems only be triggered if i ask Siri about a specific state…

Reading the current state

What can we do to support reading the current state of a device, like a thermostat?
I'm working on a shim for the HomeMatic thermostat sensors. I can receive the variable with a http pull request.

add characteristic.username

i think it would be good to have a characteristic.username that can be set from a platform module and is then used with accessory_Factor.Accessory instead of the one create by createUsername.

this would allow to keep the id tied to a specific device even if the user visible name changes.

Higher level API

I think we should consider adding some more abstraction on top of HAP-NodeJS for ease of development. I think this project could be a good starting point for design. Using chaining with getters, setters, and event emitters would greatly reduce the amount of code required to create an accessory. It also reduces the HomeKit specific knowledge required for a new developer to start contributing to the project. We might also want to consider some higher level accessory base classes such as Light, Switch, Lock, Door, Alarm, Sensor, etc. which provide defaults and create characteristics based on what parts of the interface the developer chooses to implement.

Here is an example of a potential interface using EventEmitters with callbacks. The underlying API would create permissions, cTypes, and other HomeKit specific attributes for HAP-NodeJS based on the event listeners that are implemented.

var accessory = new Accessory('First Garage Liftmaster');

var safetyLight = new Accessory.Light('Overhead Light');
accessory.addService(safetyLight);

safetyLight
    .on('setPowerOn', function (callback) {
        // Liftmaster API call for turning light on
    })
    .on('setPowerOff', function () {
        // Liftmaster API call for turning light off
    });

var backlight = new Accessory.Light('Information Display Backlight');
accessory.addService(backlight);

backlight
    .on('setPowerOn', function () {
        // Liftmaster API call for turning light on
    })
    .on('setPowerOff', function () {
        // Liftmaster API call for turning light off
    });

var securityLock = new Accessory.Lock(
    'Control Panel Lock',
    // We could add accessory type specific options such as Apple's auto lock feature like this
    {
        autoLock: true,
        lockTimeout: 10000
    }
);

accessory.addService(securityLock);

securityLock
    // Auto lock also calls this to simplify the interface
    .on('setLocked', function (isLocked, done) {
        // Fake Liftmaster API call for locking garage controls
        liftmasterApi.setControlLock(isLocked, function (err) {
            done(err);
        });
    })
    .on('getLocked', function (done) {
        // Fake Liftmaster API call for getting lock state of garage controls
        var isLocked = liftmasterApi.getControlLock(function (err, locked) {
            // Node js style callback with err, result
            done(null, isLocked);
        });
    });

// Example fake Liftmaster API event callback for updating a read-only characteristic
liftmasterApi
    .obstructionDetected(function () {
        securityLock.emit('obstructionDetected');
    });

// Run this when any discovery and setup is done to start the server
accessory.publish();

Rooms and Zones

I recently got homebridge to work using the Insteon+ app with my Belkin WeMo's. I can directly control my switches (but not my LED Lights due to the library used) with homekit. However, I cannot tell Siri to turn on or off all the lights in a particular room or zone. Siri tells me it cannot find any lights. Is this specific to the WeMo implementation or is there some identifier that the accessories are missing?

I also can't seem to get scene's to work correctly with the Insteon+ app though this is most likely a separate issue.

[Feature] Particle support

Hi,

Can somebody have a look at the Particle, formerly know as Spark.
A microcontroller that is cloud enabled and even a channel in IFTTT.

The way a function is called is through a REST API.

For Example:

POST /v1/devices/{DEVICE_ID}/{FUNCTION}

EXAMPLE REQUEST

curl https://api.particle.io/v1/devices/0123456789abcdef01234567/brew
-d access_token=1234123412341234123412341234123412341234
-d "args=202,230"

First you have the URL of the cloud service
then a version: in this case v1
A device ID
and then the function called, brew in this case
then also the access token needs to be passed and some arguments.

As I'm not an experienced programmer I wonder if someone could make an "accessory" for this ?

I guess the whole particle community would be pleased with this extension.
Thanks
Rudy

sonos being detected but does not react

I get this when starting up:

> [email protected] start /Users/max/code/homekit/homebridge
> node app.js

Starting HomeBridge server...
Loading 0 platforms...
Loading 1 accessories...
[Speakers] Initializing Sonos accessory...
TCP server accepting connection on port: 51826
HAP Server is listening
[Speakers] Found device at 192.168.1.140
[Speakers] Found device at 192.168.1.145
[Speakers] Found device at 192.168.1.148
[Speakers] Found device at 192.168.1.159
[Speakers] Found device at 192.168.1.129
[Speakers] Found device at 192.168.1.117
[Speakers] Found device at 192.168.1.136
[Speakers] Found device at 192.168.1.151
New Session 55966
Server Connection Established 61027
Start Verify M1
Verify M1 Finished
Start Verify M3
M3: Verify Success
{ characteristics: [ { aid: 1, iid: 9, ev: true } ] }
Enable Event: true
{ characteristics: [ { aid: 1, iid: 9, value: false } ] }

but when I use insteon+ or siri to turn speakers on or off then I get this in the log:

[Speakers] No device found (yet?)

any idea on how to fix that ?

Connection Reset interacting with Hue

I'm getting this odd error interacting with the two Hue hubs in my home. Both hubs are running the latest firmware, and both happily went through the initial linking / user generation process.

Any thoughts? :|

[Media Room Hue] Initializing PhilipsHue platform...
[Media Room Hue] Fetching Philips Hue lights from 172.16.1.23, user <Removed>...
Loading 0 accessories...
/Users/alistair/Dropbox/Development/Node/homebridge/node_modules/node-hue-api/node_modules/q/q.js:126
                    throw e;
                          ^
Error: connect ECONNRESET
    at exports._errnoException (util.js:746:11)
    at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1010:19)

http.js with shutters

Hello , is it possible to use " http.js " to order shutters with SIRI ?

Siri, open the kitchen shutters.

thank you

Julien

Homebridge won't start

Hi,

I'm trying to use homebride on my Mac on Yosemite.

Here the message when I try to run server.

homebridge stephane$ node -v
v0.10.13
homebridge stephane$ npm -v
1.3.2
homebridge stephane$ sudo npm run start

[email protected] start /Developer/homebridge
node app.js

Starting HomeBridge server...

/Developer/homebridge/lib/HAP-NodeJS/node_modules/ed25519/node_modules/bindings/bindings.js:83
throw e
^
Error: Symbol ed25519_module not found.
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Module.require (module.js:364:17)
at require (module.js:380:17)
at bindings (/Developer/homebridge/lib/HAP-NodeJS/node_modules/ed25519/node_modules/bindings/bindings.js:76:44)
at Object. (/Developer/homebridge/lib/HAP-NodeJS/node_modules/ed25519/index.js:1:99)
at Module._compile (module.js:456:26)
at Object.Module._extensions..js (module.js:474:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
npm ERR! weird error 8
npm ERR! not ok code 0

any idea ?

Crash on adding

If I try to add a accessory from my iPhone running KhaosT´s HomeKitDemo application I get the following error:
I´m using a Pi running node.js v0.10.26 and NPM v1.4.3.

Loading 1 accessories...
[Front Door] Initializing Lockitron accessory...
TCP server accepting connection on port: 51826
HAP Server is listening
New Session 57262
Server Connection Established 50024
Identify!
Start Pair M1
Start Pair M3
Start Pair M5

buffer.js:188
throw new TypeError('First argument needs to be a number, ' +
^
TypeError: First argument needs to be a number, array or string.
at new Buffer (buffer.js:188:15)
at Buffer (buffer.js:158:12)
at Object.processPairStepFive (/home/pi/development/homebridge/lib/HAP-NodeJS/Server.js:325:27)
at Object.processPairStepFour (/home/pi/development/homebridge/lib/HAP-NodeJS/Server.js:309:9)
at Object.processPairStepThree (/home/pi/development/homebridge/lib/HAP-NodeJS/Server.js:292:8)
at Object.processPairSequence (/home/pi/development/homebridge/lib/HAP-NodeJS/Server.js:224:11)
at IncomingMessage. (/home/pi/development/homebridge/lib/HAP-NodeJS/Server.js:39:17)
at IncomingMessage.EventEmitter.emit (events.js:95:17)
at IncomingMessage. (_stream_readable.js:746:14)
at IncomingMessage.EventEmitter.emit (events.js:92:17)

Startup Issue

I am getting the following error:

Starting HomeBridge server...
Couldn't find a config.json file in the same directory as app.js. Look at config-sample.json for examples of how to format your config.js and add your home accessories.

npm ERR! Darwin 14.4.0
npm ERR! argv "node" "/usr/local/bin/npm" "run" "start"
npm ERR! node v0.12.5
npm ERR! npm v2.11.2
npm ERR! code ELIFECYCLE
npm ERR! [email protected] start: node app.js
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] start script 'node app.js'.
npm ERR! This is most likely a problem with the homebridge package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node app.js
npm ERR! You can get their info via:
npm ERR! npm owner ls homebridge
npm ERR! There is likely additional logging output above.

I am using the config-sample.json file and renamed it to config.json locally. The file is in fact in the same directory as app.js. Any suggestions?

screen shot 2015-06-30 at 10 58 31 am

Problem Authenticating with SmartThings

I have everything setup but I am receiving authentication error
Starting HomeBridge server...
Loading 1 platforms...
[SmartThings] Initializing SmartThings platform...
[SmartThings] Fetching SmartThings devices...
[SmartThings] There was a problem authenticating with SmartThings.

I know the app-id and token are correct:
Here is my config.json:
{
"description": "This is an example configuration file with all supported devices. You can use this template for creating your own configuration file containing devices you actually own.",

"platforms": [
    {
            "platform": "SmartThings",
            "name": "SmartThings",
            "appId" : "myStAppId",
    "accessToken" : "myStAccessToken"
    }
]

}

Unreachable after stopping and restarting homebridge

Hi,

I've installed homebridge on a Mac mini (OS X 10.10.4) and I'm using the EVE App on my iPhone 6 (iOS 8.4). It works fine, however after restarting homebridge EVE shows the message "unreachable".
In order to reactivate the communication I've to restart (power off/on) my iPhone.

For testing I just defined a simple Dummy.js Accessory.

Error LogitechHarmony.js

If try to use this shim I get an error during the startup:

/home/pi/homebridge/platforms/LogitechHarmony.js:174
this.log('TODO: Support onRead for devices');
^
TypeError: undefined is not a function
at Object.LogitechHarmonyAccessory.getPowerState as onRead
at Object.valueForUpdate (/home/pi/homebridge/node_modules/HAP-NodeJS/Characteristic.js:136:9)
at Object.jsonForCharacteristicUpdate (/home/pi/homebridge/node_modules/HAP-NodeJS/AccessoryController.js:48:30)
at Object.responseCharacteristic (/home/pi/homebridge/node_modules/HAP-NodeJS/Server.js:110:29)
at Object. (/home/pi/homebridge/node_modules/HAP-NodeJS/Server.js:69:13)
at Server.emit (events.js:110:17)
at HTTPParser.parserOnIncoming as onIncoming
at HTTPParser.parserOnHeadersComplete (_http_common.js:111:23)
at Socket.socketOnData (_http_server.js:343:22)
at Socket.emit (events.js:107:17)

npm ERR! Linux 4.0.8-v7+
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "run" "start"
npm ERR! node v0.12.6
npm ERR! npm v2.11.2
npm ERR! code ELIFECYCLE
npm ERR! [email protected] start: node app.js
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] start script 'node app.js'.
npm ERR! This is most likely a problem with the homebridge package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node app.js
npm ERR! You can get their info via:
npm ERR! npm owner ls homebridge
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR! /home/pi/homebridge/npm-debug.log

Cannot find module 'is-property'

Trying to run the server I get the following

Loading 6 accessories...
module.js:338
    throw err;
          ^
Error: Cannot find module 'is-property'
    at Function.Module._resolveFilename (module.js:336:15)
    at Function.Module._load (module.js:278:25)
    at Module.require (module.js:365:17)
    at require (module.js:384:17)
    at Object.<anonymous> (/home/pi/homebridge/node_modules/wemo/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/node_modules/generate-object-property/index.js:1:80)
    at Module._compile (module.js:460:26)
    at Object.Module._extensions..js (module.js:478:10)
    at Module.load (module.js:355:32)
    at Function.Module._load (module.js:310:12)
    at Module.require (module.js:365:17)
    at require (module.js:384:17)

npm ERR! Linux 3.18.11-hypriotos-v7+
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "run" "start"
npm ERR! node v0.12.6
npm ERR! npm  v2.11.2
npm ERR! code ELIFECYCLE
npm ERR! [email protected] start: `node app.js`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the [email protected] start script 'node app.js'.

Does anyone know how to fix this?

lib/HAP-NodeJS change?

Hello there,

Maybe im being blind but your documentation says:
cd lib/HAP-NodeJS and then npm install
but when i do a fresh copy of the latest git after npm install i dont see any subdir called lib
the HAP-NodeJS seems to be in the node-modules directory for me?

Any idea?

iOS 9 - No devices detected, no changes in HAP status regarding existing devices

Hi,

Has anyone tried this under iOS 9? I'm using an adaptation of homebridge to micasaverde Vera (this one https://github.com/Hackworth/VeraHomeKitBridge) and while it worked fine with iOS 8.x (I added some scenes and was controlling those with Siri), now it doesn't detect any device and the HAP server status doesn't show any change.

I even tried removing one of them to see if it would pop back up, but to no avail, it wasn't detected.

Do you have any idea of what I can try here?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.