Home

Awesome

Build Status Version downloads

pimatic-hap

pimatic-hap is a pimatic plugin that starts a Homekit Accessory Server and automatically publishes all devices configured in pimatic as Homekit Accessories using a single Accessory bridge.

Currently it supports most devices that pimatic comes with OOB. Some device types cannot be supported because the HomeKit protocol doesn't have similar types.

The supported devices currently are:

These are just base classes, that provide a certain interface, that pimatic-hap understands, but they contain no real logic. All "real" devices, that extend from these, are supported, like HomeduinoRFSwitch. If you want to know if your device is supported, just check the source code of the pimatic plugin. If the device extends from any of the base classes like

  class HomeduinoSwitch extends env.devices.PowerSwitch

then this device is supported.

Apart from the standard devices pimatic-hap supports also devices from third party plugins. Currently this applies to

Note: not all devices that these plugins provide work with pimatic-hap.

If you are the developer of a pimatic plugin that defines a new device class, that fits into the HomeKit world, just create a feature request.

Installation

Since this plugin uses HAP-NodeJS, libnss-mdns and libavahi-compat-libdnssd-dev must be installed on a raspberry pi:

sudo apt-get install libnss-mdns libavahi-compat-libdnssd-dev libcairo2-dev libpango1.0-dev libjpeg-dev libgif-dev librsvg2-dev

To install the plugin just add the plugin to the config.json of pimatic:

{
  "plugin": "hap"   
}

This will fetch the most recent version from npm-registry on the next pimatic start and install the plugin.

Please use 031-45-154 as pin, when pairing with the pimatic homekit bridge.

Every iOS app that works with homekit should work with this (like Apple Home app), so no need for an Apple developer account.

Configuration

The configuration of pimatic can be extended by adding an attribute called "hap" on every supported device. Example:

"devices": [
  {
    "id": "switch",
    "class": "DummySwitch",
    "name": "Switch",
    "hap": {
      "service": "Lightbulb",
      "exclude": true
    }
  }
]

To exclude devices from being registered as Homekit Accessory, just set the "exclude" flag to true. By default all supported devices will be registered.

For some devices it's possible to override the default Service (find the explanation of Services here). This is helpful if e.g. a lamp is connected to a pimatic-enabled outlet. Changing the Service to "Lightbulb" will make Homekit recognize the outlet as light, not as switch. This may also change the commands, that one can use with Siri. Currently just switches may act as a light. If you have suggestions for other possible overrides, that make sense, please create a feature request.

Since the "hap" attribute doesn't belong to the device config schema, pimatic will issue a warning, that this is an unknown config entry. Maybe it will be officially possible to extend the configuration. Since then make sure that pimatic-hap is placed first in your config or just ignore this warning.

Debug logging

To activate verbose debug logging in hap-nodejs, you have to start pimatic with

$ set DEBUG=HAPServer,Accessory,EventedHttpServer
$ sudo service pimatic start

Sponsoring

Do you like this plugin? Then consider a donation to support development.

<span class="badge-paypal"><a href="https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=2T48JXA589B4Y" title="Donate to this project using Paypal"><img src="https://img.shields.io/badge/paypal-donate-yellow.svg" alt="PayPal donate button" /></a></span> Flattr pimatic-hap

Changelog

0.15.0

0.14.0

0.13.0

0.12.0

0.11.2

0.11.0

0.10.0

0.9.5

0.9.4

0.9.3

0.9.2

0.9.1

0.9.0

0.8.3

0.8.2

0.8.1

0.8.0

0.7.0

0.6.4

0.6.3

0.6.1

0.6.0

0.5.6

0.5.5

0.5.4

0.5.3

0.5.2

0.5.1

0.5.0

0.4.1

0.4.0

0.3.4

0.3.3

0.3.2

0.3.1

0.3.0

0.2.2

0.2.1

0.2.0

0.1.0

0.0.2

0.0.1

Credit

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