OpenHAP

HomeKit Accessory Protocol for OpenBSD

OpenHAP connects MQTT-connected Tasmota devices to Apple HomeKit. You can control the devices with the iOS Home app.

Website and manuals: https://www.openhap.org/

Features

Quick Start

make deps
doas make install
doas cp /etc/examples/openhapd.conf /etc/openhapd.conf
doas vi /etc/openhapd.conf
doas rcctl enable mosquitto mdnsd openhapd
doas rcctl start mosquitto mdnsd openhapd

See INSTALL.md for the complete installation instructions.

Documentation

Development

See CLAUDE.md for the development commands, the coding style, and the conventions.

Architecture

iOS Home App
     │
     │ TCP/TLS (HAP)
     ▼
┌─────────────┐     ┌───────────┐     ┌─────────────┐
│  openhapd   │◄───►│ mosquitto │◄───►│   Tasmota   │
│  :51827     │     │  :1883    │     │   Devices   │
└─────────────┘     └───────────┘     └─────────────┘

The protocol libraries

The HAP protocol itself lives in Protocol::HAP, under lib/Protocol/. The library is host-neutral: it uses core Perl plus four declared crypto modules, and it knows nothing about the daemon that hosts it. The engine takes its timers, its writes, and its persistence as injected contracts, so it touches no socket, no timer, and no file of its own. Two classes beside the engine do the work that the contracts describe: a blocking client and a file store. openhapd is the reference host.

The OpenBSD-style daemon plumbing comes from the Fugu distribution, which make deps installs from its latest release.

A CPAN release is planned; see lib/Protocol/HAP.pod for the library overview and the host contracts.

License

ISC License. See LICENSE.