hap-java / HAP-Java

Java implementation of the HomeKit Accessory Protocol
MIT License
153 stars 82 forks source link

Question - Is it possible to have window/door sensors? #12

Closed gdombiak closed 8 years ago

gdombiak commented 8 years ago

Hi,

This is not an issue but a question. Couldn't find a place to ask a question so sorry to use this space for asking.

I'm new to HomeKit and been using zwave for some time and thanks to this great library, I'm now being able to use HomeKit to control switches, outlets, lights and door locks. However, my motion sensor and window/door sensors are not being exposed in HomeKit. Looking around, I see that Eve has a door/window sensor that are HomeKit compatible.

Looking at the list of accessories offered by the library, I cannot find one that fits into motion sensor or window/door sensors. Furthermore, looking at HomeKit Framework Reference I also do not see how those sensors can be supported by HomeKit. Am I missing something here? :) Is it possible to use HomeKit to see if my window/door is opened/closed or if my motion sensor detected movement? Should I extend the library to make this happen or is there an accessory that already offers this?

Thanks in advance, Gaston

andylintner commented 8 years ago

HomeKit does have a ContactSensor service type. This library doesn't have the definitions for it built-in yet, but you could always create one by implementing the Service interface directly. (You can find the UUID and required characteristics in Apple's HomeKit simulator)

If you do that, consider doing it within the library and submitting a PR. Otherwise, I do plan on adding the new service types when I get a chance.

gdombiak commented 8 years ago

Andy,

Thanks for the pointers. I think I'll have time this weekend to work on this. Thanks for the pointers. Once I have it running I'll create a PR.

Thanks again, Gaston

andylintner commented 8 years ago

Closed by #13