A bridge between MQTT devices & Apple HomeKit accessories. This project is published as an example and a source of inspiration because it is mostly adapted to my own home automation.
- Build binary with
go build -o ../bin/ - Copy
data/config.example.ymltodata/config.ymland configure settings. - Run with
./bin/hap-mqtt -config data/config.yml
Usage of ./hap-mqtt:
-config string
Configuration filepath (default "data/config.yml")
-debug
Enable debug log
-debughap
Enable HAP debug log
-printcfg
Print configuration
See data/config.example.yml.
- MQTT subscription topic must be provided by first option in
config.yml.
$DEVICEis the device name set inconfig.yml.
- Dim value (0-100):
fhem/stat/$DEVICE/dim - State value (on-off):
fhem/stat/$DEVICE/state
- Dim value (0-100):
fhem/cmnd/$DEVICE/dim - State value (on-off):
fhem/cmnd/$DEVICE/state
$DEVICEis the device name set inconfig.yml.
- State value (on-off):
fhem/stat/$DEVICE/state
- State value (on-off):
fhem/cmnd/$DEVICE/state
$DEVICEis the device name set inconfig.yml.
JSON data (output, brightness): shellies/$DEVICE/status/light:0
string (set,$OUTPUT,$BRIGHTNESS) : shellies/$DEVICE/command/light:0
- Tasmota device with a BME280 (temperature, humidity) sensor and optional MHZ19B (CO2) sensor.
- MQTT subscription topic with JSON payload:
tele/$DEVICE/SENSOR
$OUTPUTdefaults toPOWERbut can be optionally set with first option inconfig.yml.
- Power value (ON-OFF):
stat/$DEVICE/$OUTPUT
- Power value (ON-OFF):
cmnd/$DEVICE/$OUTPUT