karlentwistle / ruby_home

Ruby HAP Server - HomeKit support for the Rubyist

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

unable to set Typ of Contact Sensor

andreasgrau opened this issue · comments

in Homekit there are different types of contact sensors available, e.g. door or window.
Setting the typ should be possible when creating services.

Hey @andreasgrau thanks for another great suggestion.

I've just taken a look into this and I am afraid the response is very similar to #61. I don't think this is a currently supported feature within the HomeKit Accessory Protocol Specification. As far as I can tell you have to configure the "type" of contact sensor from within the HomeKit API used by HomeKit apps like the Home app on iOS.

HAP specification (page 223)

These are the optional and required characteristics for a contact sensor. I cannot see a "type" attribute that is available for use:

screenshot 2019-02-24 at 21 30 38

Configure type

This is where you can configure the type from within the Home application on iOS:

Test code used:

require 'ruby_home'
RubyHome::ServiceFactory.create(:contact_sensor)
RubyHome.run