All Projects → mtrudel → hap

mtrudel / hap

Licence: MIT license
A HomeKit Accessory Protocol (HAP) Implementation for Elixir

Programming Languages

elixir
2628 projects

Projects that are alternatives of or similar to hap

ioBroker.yahka
Yet another HomeKit adapter for ioBroker
Stars: ✭ 101 (+102%)
Mutual labels:  homekit, homekit-accessory-protocol
esp-homekit-arduino-sdk
Arduino wrapper for ESP-IDF HomeKit library
Stars: ✭ 34 (-32%)
Mutual labels:  homekit, homekit-accessory-protocol
ESP8266-HomeKit-Air-Quality-Sensor-Elgato-Eve-Room
ESP8266 based  Homekit Indoor Air Quality sensor that acts like Eve Room🌱
Stars: ✭ 58 (+16%)
Mutual labels:  homekit, homekit-accessory-protocol
Homebridge
HomeKit support for the impatient
Stars: ✭ 19,073 (+38046%)
Mutual labels:  homekit, homekit-accessory-protocol
HAS
Homekit Accessory Server
Stars: ✭ 53 (+6%)
Mutual labels:  homekit, homekit-accessory-protocol
Hap Nodejs
Node.js implementation of the HomeKit Accessory Protocol (HAP)
Stars: ✭ 2,541 (+4982%)
Mutual labels:  homekit, homekit-accessory-protocol
homebridge-pc-volume
Homebridge plugin to control your computer's volume using HomeKit and Siri
Stars: ✭ 55 (+10%)
Mutual labels:  homekit
Homebridge-on-RaspberryPi
Example of Homebridge on RaspberryPi 3
Stars: ✭ 34 (-32%)
Mutual labels:  homekit
nerves thermal camera
Thermal camera imaging with Elixir, Nerves, Raspberry Pi, and a MLX90640 sensor
Stars: ✭ 28 (-44%)
Mutual labels:  nerves
elixir bme680
An Elixir library to interface with the BME680 (and BME280) environmental sensor
Stars: ✭ 19 (-62%)
Mutual labels:  nerves
homebridge-zigbee
ZigBee Platform plugin for HomeBridge
Stars: ✭ 101 (+102%)
Mutual labels:  homekit
node-red-contrib-yandex-station-management
Модуль node-red-contrib-yandex-station-management для управления умными колонками от Яндекс
Stars: ✭ 20 (-60%)
Mutual labels:  homekit
elixir-opencv
OpenCv NIF Bindings for Erlang/Elixir.
Stars: ✭ 30 (-40%)
Mutual labels:  nerves
AVPlayerItemHomeOutput
Coordinate the output of content associated with your HomeKit lightbulbs. #Ambilight
Stars: ✭ 38 (-24%)
Mutual labels:  homekit
homebridge-vsx
📻 A VSX and SC Plugin for homebridge
Stars: ✭ 12 (-76%)
Mutual labels:  homekit
nerves system ev3
Base Nerves system configuration for the Lego EV3
Stars: ✭ 23 (-54%)
Mutual labels:  nerves
mdns lite
A simple, no frills mDNS implementation in Elixir
Stars: ✭ 29 (-42%)
Mutual labels:  nerves
homebridge-nature-remo-cloud-aircon
Homebridge Plug-in for Air Conditioner Managed by Nature Remo
Stars: ✭ 28 (-44%)
Mutual labels:  homekit
aiohomekit
asyncio for homekit
Stars: ✭ 37 (-26%)
Mutual labels:  homekit
homebridge-blinds
🌅 Homebridge Plugin to control my blinds over HTTP
Stars: ✭ 51 (+2%)
Mutual labels:  homekit

HAP

Build Status Docs Hex.pm

HAP is a framework for building DIY HomeKit accessories based on Apple's HomeKit Accessory Protocol specification. You can think of it as homebridge for Elixir (with a bit more of a focus on building actual accessories via Nerves) in contrast to Homebridge's typical use as a bridge to existing accessories.

As shown in the HAP Demo project, integrating HAP support into an existing Elixir project is extremely straightforward - all that is required in most cases is to define the services and characteristics you wish to expose, and to provide an implementation of HAP.ValueStore for each non-static characteristic you define.

In many cases, integrating with HAP can be as simple as:

accessory_server =
  %HAP.AccessoryServer{
    name: "My HAP Demo Device",
    model: "HAP Demo Device",
    identifier: "11:22:33:44:12:66",
    accessory_type: 5,
    accessories: [
      %HAP.Accessory{
        name: "My HAP Lightbulb",
        services: [
          %HAP.Services.LightBulb{on: {MyApp.Lightbulb, gpio_pin: 23}}
        ]
      }
    ]
  )

children = [{HAP, accessory_server}]

Supervisor.start_link(children, opts)

...

Supported Services & Characteristics

As originally developed, HAP included a fairly small set of services & characteristics (mostly due to the author's laziness & the immediate need for only a handful of the ~45 services & ~128 characteristics defined in the specification). However, it is quite easy to add definitions for new services & characteristics, and PRs to add such definitions are extremely welcome. The lightbulb service is a complete implementation of a service and serves as an excellent starting point for creating your own. You can consult sections 8 and 9 of the HomeKit Accessory Protocol Specification to determine what characteristics are required and optional for a given service. Note that only implementations of public services and characteristics as defined in the HomeKit specification will be considered for inclusion in HAP.

Asynchronous Change Notifications

HAP supports notifications (as defined in section 6.8 of the HomeKit Accessory Protocol Specification). This allows your accessory to notify HomeKit of changes which happen asynchronously, such as a user pushing a button on the accessory, or a sensor detecting a water leak. To send such notifications, your HAP.ValueStore implementation must support the c:HAP.ValueStore.set_change_token/2 callback. Consult the HAP.ValueStore documentation for more detail.

Known Issues

As HAP is still in active development, there are a number of known rough edges. These include:

  • No support for dynamically updating the services advertised by a HAP instance (this is slated for HAP 2.0)
  • Incomplete support for tearing down existing sessions on pairing removal (this is slated for HAP 2.0)
  • No support for HomeKit Secure Video / RTP (support is not currently planned, but PRs are of course welcome)

In addition, there may well be bugs or gaps in functionality not listed above. If you encounter any, please feel free to file an issue.

Installation

HAP is available in Hex. The package can be installed by adding hap to your list of dependencies in mix.exs:

def deps do
  [
    {:hap, "~> 0.4.0"}
  ]
end

HAP is intended to be used within a host application which provides concrete implementations for various HomeKit characteristics. Check out the HAP Demo app for an example of how to use HAP.

Documentation can be found at https://hexdocs.pm/hap/.

Note that in order to have access to the required crypto methods for HAP to function, OTP 23 or newer is required. Also note that OTP 25.0.x has a defect that breaks HAP (fixed in OTP 25.1 and newer).

Also note that although we still support Elixir 1.11, use of the Kino display module requires Elixir 1.12 or newer.

License

MIT

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].