## ADR #0004: HomeKit and MQTT are the supported protocols for smart devices 1. **What did you decide?** HomeKit and MQTT are the protocols which shall be used to connect to user provided smart devices and sensors. Other protocols will be unsupported for the first release of SmartHut. 2. **What was the context for your decision?** Due to SmartHut being an open ended system relying and integrating with user provided devices it is crucial to provide support to satisfy the userbase as much as possible. That being said, the more protocols will be supported the higher the development cost in integration will be, and this can be especially hurtful in the MVP and hobbyist-oriented style SmartHut is currently being developed. The protocols chosen shall have a maintained Java open source client library for ease of integration with the existing users and devices backend, which is implemented using the Spring framework. 3. **What is the problem you are trying to solve?** Which protocols will cover a satisfactorily large number of smart devices from the userbase and which libraries can be used to with them? 4. **Which alternative options did you consider?** - MQTT protocol, via the Eclipse [paho.mqtt.java](https://github.com/eclipse/paho.mqtt.java) library; - Apple HomeKit Accessory Protocol, via the [HAP-Java](https://github.com/hap-java/HAP-Java) library; - other protocols (such as Google home, Zigbee, or Alexa), of which I did not find a suitable library. 5. **Which one did you choose?** - MQTT protocol, via the Eclipse [paho.mqtt.java](https://github.com/eclipse/paho.mqtt.java) library; - Apple HomeKit Accessory Protocol, via the [HAP-Java](https://github.com/hap-java/HAP-Java) library; 6. **What is the main reason for that?** The MQTT protocol is standardized and has a simple specification, while being widely adopted in both commercial and industrial IoT settings. Supporting this protocol is a way to future-proof SmartHut and potentially diversify the market of applications in which it can be installed. The _HAP-Java_ library provides good support for HomeKit and it is well maintained, and supporting the protocol will provide an effective way to provide consumer devices which may be seldomly supported by using MQTT only. Pros: - Wide coverage of different applications by providing support for both an industrial-oriented protocol and a consumer-oriented one; - Free and open source libraries for both protocols with non copyleft licenses, providing ease of support for free and compatibility with a possible commercial distribution of SmartHut; Cons: - Supporting two protocols instead of one has higher integration cost; - HomeKit is not a widely-adopted standard when compared to Google home, Zigbee or Alexa, catering for a potentially smaller userbase.