All Projects → ljezny → Particle Hap

ljezny / Particle Hap

Licence: mit
Connect your Photon to HomeKit.

Projects that are alternatives of or similar to Particle Hap

Redmatic
Node-RED packaged as Addon for the Homematic CCU3 and RaspberryMatic 🤹‍♂️
Stars: ✭ 407 (+714%)
Mutual labels:  homekit
Esp Homekit
Apple HomeKit accessory server library for ESP-OPEN-RTOS
Stars: ✭ 720 (+1340%)
Mutual labels:  homekit
Rmcontrol
RM Control — A python app to control an RM2 from BroadLink.
Stars: ✭ 32 (-36%)
Mutual labels:  homekit
Homebridge Raspbian Image
Official Homebridge Raspberry Pi Image based on Raspbian Lite.
Stars: ✭ 534 (+968%)
Mutual labels:  homekit
Esp Homekit Demo
Demo of Apple HomeKit accessory server library
Stars: ✭ 657 (+1214%)
Mutual labels:  homekit
Homebridge Camera Ffmpeg
Homebridge Plugin Providing FFmpeg-based Camera Support
Stars: ✭ 726 (+1352%)
Mutual labels:  homekit
Hap Python
A python implementation of the HomeKit Accessory Protocol (HAP)
Stars: ✭ 381 (+662%)
Mutual labels:  homekit
Homebridge Loxone Ws
Websocket based Loxone plugin for homebridge
Stars: ✭ 37 (-26%)
Mutual labels:  homekit
Homebridge Homeassistant
DEPRECATED in favor of native HomeKit support. -  Homebridge plugin for Home Assistant
Stars: ✭ 666 (+1232%)
Mutual labels:  homekit
Ubernet
Flexible networking library for Unity
Stars: ✭ 10 (-80%)
Mutual labels:  photon
Arduino Homekit Esp8266
Native Apple HomeKit accessory implementation for the ESP8266 Arduino core.
Stars: ✭ 545 (+990%)
Mutual labels:  homekit
Homebridge Hue
Homebridge plugin for Philips Hue and/or deCONZ
Stars: ✭ 637 (+1174%)
Mutual labels:  homekit
Simex
Start-to-end photon experiment simulation platform
Stars: ✭ 18 (-64%)
Mutual labels:  photon
Homebridge Webos Tv
Homebridge plugin for LG webOS TVs
Stars: ✭ 433 (+766%)
Mutual labels:  homekit
Homebridge Govee
Homebridge plugin to control Govee devices supported by the official Govee API.
Stars: ✭ 33 (-34%)
Mutual labels:  homekit
Homepoint
Espressif ESP32 Based Smarthome screen for MQTT
Stars: ✭ 391 (+682%)
Mutual labels:  homekit
Sonoff Homekit
Make your Sonoff Switch compatible with Apple Homekit! 🎉
Stars: ✭ 722 (+1344%)
Mutual labels:  homekit
Homebridge Hubitat Tonesto7
Hubitat Homebridge Plugin
Stars: ✭ 45 (-10%)
Mutual labels:  homekit
Device Os
Device OS (Firmware) for Particle Devices
Stars: ✭ 976 (+1852%)
Mutual labels:  photon
Esp Homekit Demo Stepbystep
tutorial step by step esp homekit demo
Stars: ✭ 24 (-52%)
Mutual labels:  homekit

particle-hap

Particle HAP is a proof-of-concept tested and working TCP server, which allows you to connect Particle devices to HomeKit, directly, without any in-the-middle HAP JS server. I am successfully using it to control my Window shutters, Lights, Nixie Clocks, Roomba (using serial link) and I've created simple weather station (temperature, humidity, light). Every device works just fine and stable.

BIG THANKS TO:

I've used lot of inspiration and code from these repositories. I would really like to thank:

Video

Example video of pairing and handling.

Watch the video

Configuration

//TCP for handling server port
#define TCP_SERVER_PORT 5115
//Maximum pairings available. Apple recommends 16. But be aware, one pairing needs (36+32)B of your EEPROM
#define MAX_PAIRINGS 16
//if you are using EEPROM, you can set offset for HomeKit to store pairings
#define EEPROM_STORAGE_ADDRESS_OFFSET 512
//Apple requires 8 connections at least and must accommodate a new ones. Photon can handle up to 10 connections, but one is cloud connection.
//So allow 8 connections, every 9th will be closed send HTTP 503 and closed.
//It seems that even 2 connections are working just fine, if you need to use sockets for something else.
#define MAX_CONNECTIONS 8

Also, be aware that there's constant ACCESSORY_KEY (in HKConsts.h). Should be unique per device. I've used constant just to save memory. But it can be a security leak. If you need to really generate accessory key, look for 'generateAccessoryKey' method and store that key somehow in EEPROM.

Integration

This project is available as a Community Library, particle-hap, which you can import into your project.

Please see the example projects in the examples folder for a better idea of how to use particle-hap in your project.

Troubleshooting

If your Particle device isn't showing up in HomeKit, try resetting the HKPersistor.

HKPersistor().resetAll();
System.reset();

If there are too many instances of your Particle device showing up in HomeKit, you may want to restart your iPhone/iPad, and if it doesn't work you need to flush your iOS device's DNS cache. Unfortunately, this also means you will lose any WiFi networks you have set up, and you'll need to re-enter those passwords. Go to Settings, General, Reset and choose Reset Network Settings.

Dependencies

There are no library dependencies. All the crypto is based on WolfSSL, but highly customized to work on DeviceOS.

Known major issues

  • no major issues currently known

Limitations

I had to use static shared memory buffers for processing request and response of HomeKit TCP server. Dynamic allocations of memory causes fragmentation and instability. So currently SHARED_REQUEST_BUFFER_LEN=1024 bytes and SHARED_RESPONSE_BUFFER_LEN=5000 bytes is used. You may reach the response buffer limit if you create some complex composite accessory (more than 5 services).

Troubleshooting

Q: I am not able to see a device in pairing. Why? A: You need to be exactly on same Wifi network. Photon connects to 2.4Ghz and your iPhone connects to 5Ghz network by default. Devices not see each other.

Q: How to debug HomeKit accessory discovery? A: Download Discovery app from AppStore (Bonjour Discovery) and look for _hap._tcp node in that app. You should see your device in there.

Q: Is there any logs? A: Yes, of course. I am using standard Serial log. I log only the warnings (let's say, the negative branches of IFs :-) )

Q: I can see device ready for pairing, but pairing fails. A: Mostly you have an error in describing your devices or characteristics values are bad/not in range etc. HomeKit accessory must be described using Apple defined Services. Each service must be described using mandatory and optional characteristics. All can be found in HAP-Specification-Non-Commercial-Version.pdf document.

What's planned:

  • more accessory types in examples (programmable switch, sensors). What do you need?

Goal:

  • integration with Nixie Clocks so it will support Non-commercial HAP.

Compiling project

When you're ready to compile your project, make sure you have the correct Particle device target selected and run particle compile <platform> in the CLI or click the Compile button in the Desktop IDE. The following files in your project folder will be sent to the compile service:

  • Everything in the /src folder, including your .ino application file
  • Everything in the /lib folder (which includes the particle-hap library)
  • The project.properties file for your project

Contribution

Any contributions are more than welcomed. I would prefer to create PR instead of just posting as issues.

Hire us:

We are two guys, freelancers. We develop Android, iOS applications mostly. We also did some parts of FW for Nixie Clock and of course its iOS app. Just contact me at [email protected]

Licence

Copyright 2019 Lukas Jezny

Licensed under the MIT license.

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].