crownstone / crownstone-app

Mobile app for the Crownstone (Android & iOS). The apps are freely available from Google and Apple app stores. The code is based on React Native.
https://crownstone.rocks/app/
Apache License 2.0
16 stars 14 forks source link

HomeKit support (or homebridge) #43

Closed adriaandotcom closed 3 years ago

adriaandotcom commented 3 years ago

I would love to automate my home. I do have some automation in place that I like to keep using. For example I use my Apple TV as a home hub to control some lights and switches.

It would be great to have HomeKit support so I can use Crownstone with my current UX. That's why I love HomeKit: it has a great UI and works very well from all my devices and from outside my home.

An alternative that would also work for me is an integration with Homebridge.

AlexDM0 commented 3 years ago

Hi Adriaan,

I've seen homebridge and it looks like an interesting way to support homekit. We do not support it natively because dont want to completely ignore android users in a household :).

We're currently developing our own hub, which would make it much easier (more reliable, and you dont have to be in the house perse) to integrate with Crownstones. I think that Homebridge support would be a fun candidate for 2021! We currently have our plates quite full with other important milestones so I don't see this being picked up very soon.

We'll look into it! Cheers!

mrquincle commented 3 years ago

Homebridge sounds interesting. It looks like something for Apple power users. I'll try to uncover the following in the meantime. Feel free to provide extra info as well to make the case.

adriaandotcom commented 3 years ago

Thanks for your honest timeline. I will not expect anything soon ;) A hub could also be a solution, but having a home hub functioning as well it seems a bit redundant for Apple users.

I did some testing with a simple Node.js app and it's super easy to just have the basic features of HomeKit in a device (that runs Node.js). I understand this will be totally different when developing for Crownstone, but I just want to leave it here as a reference.

HAP-NodeJS does not require HomeBrige and just talks to HomeKit directly.

Creating a HomeKit assasory in HAP-NodeJS ```bash ~/Downloads/homekit $ npm install hap-nodejs + hap-nodejs@0.8.2 added 14 packages from 19 contributors and audited 14 packages in 4.32s found 0 vulnerabilities ~/Downloads/homekit $ node index.js Accessory setup finished! Queried current brightness level: 100 Queried current light state: false Setting light state to: true Setting light state to: false Setting brightness level to: 26 Setting light state to: true Setting brightness level to: 44 ``` See content of [`index.js`](https://github.com/homebridge/HAP-NodeJS-examples/blob/master/light-example-typescript/src/light.ts)

I would understand if it just has very basic functionality like being a switch and a dimmer only.

adriaandotcom commented 3 years ago

I guess Homebridge or Home Assistant would be fun for playing around with Crownstones. But in the end you just want to have it working directly with HomeKit. I would not spent much time in make Homebridge work. Just HomeKit on and off integration would be best to start I think. And would be best if there was no third-party app needed (maybe when you want to see power usuage or something, but not so much for just switching the lights).

AlexDM0 commented 3 years ago

We'll always need our consumer app at least for setting up the Crownstones. We could also try looking into adding HAP-nodeJS to our own hub code. That would greatly simplify the process. One way or another, a hub device is required. Be it our hub, or a home bridge.

Once you have set everything up using our consumer app, you wouldn't really need that any more if you dont want to use localization or behaviour.

adriaandotcom commented 3 years ago

With other home automation devices you can use a certain code that you have to scan or manually fill in. Even with Bluetooth only devices (I'm using the Qingping temp and RH sensor). They work just a iOS device and even remotely with the home hub. They don't need a hub to function though. I wonder how that works then:

AlexDM0 commented 3 years ago

In that case, the bluetooth device supports the homekit protocol. This is not something we will do because it will actually lock the Crownstones into the homekit ecosystem. We don't want to require a device like a hub or bridge to allow android users to communicate with Crownstones.

adriaandotcom commented 3 years ago

That makes sense! Then a bridge would be needed. Thanks for taking the time to explain.

AlexDM0 commented 3 years ago

We've discussed this a bit internally, I think we'd prefer to add HAP-NodeJS to our own hub. This would require much less work, testing and maintenance on our part, which makes it feasible to move this up the planning. An integration with homebridge would require us to test and maintain this on all platforms they support as well, making this the less preferable option.

adriaandotcom commented 3 years ago

Great! Personally I'm more happy with having HAP-NodeJS than Homebridge support. No need to me to add another hub/bridge. Let me know when I can order that hub, love to test!

AlexDM0 commented 3 years ago

I don't think we can use this reverse-engineered library on our hub. It would be fun, but this is an unlicensed implementation that we can't sell as a feature. You're free to use it yourself though! Nice project!

adriaandotcom commented 2 years ago

Using Home Assistant now, and works great. Crownstones are more reliable than the zigbee devices.