ikalchev / HAP-python

A python implementation of the HomeKit Accessory Protocol (HAP)
Other
618 stars 118 forks source link

adding different 'sensor' types #154

Open ignalex opened 5 years ago

ignalex commented 5 years ago

hi guys is it possible to add other, more generic sensor types (probably handled by services.json and characteristics.json) to have it categorized differently? for example - I've got methods reading last values of scanned internet speed (stored in db), but there is no 'sensor' which could be used for 'Mb/s' units. Ff embedding it into 'light sensor' or similar - works well but measuring it in lux is not too smart, and also Siri put it into category with other light sensors and to the question 'how bright' read this one too which is not good.

another case - I couldn't find the single event state-less trigger. like press a button (not a switch) (door bell is closest but still not what is needed).

I could try to modify the jsons see what will happens but, would it fit the other home-kit environment? Cheers

ikalchev commented 5 years ago

Hi @ignalex, you can define your own type of Service or Characteristic and add it to your Accessory. The problem is that the Home app will not show a service/char that is not Apple-defined - all services and chars in the resources folder are Apple defined. I don’t know if you can extend that with a separate iOS app.

For the second question - I need to check, occasionally some services could be missing, I need to re-parse the Apple file to add them. Will check and get back to you. Is the StatelessProgrammableSwitch the one you need?

ignalex commented 5 years ago

StatelessProgrammable does not what you would expect from it. It appears in the iOS but it requires to program other existing services into it. It is kind of creating a ‘bridge’ combining other services: for instance it can combine lamp and fan into one service reacting to some specific triggers. Regs

Sent from my iPhone

On 4 Oct 2018, at 17:10, Ivan Kalchev notifications@github.com wrote:

Hi @ignalex, you can define your own type of Service or Characteristic and add it to your Accessory. The problem is that the Home app will not show a service/char that is not Apple-defined - all services and chars in the resources folder are Apple defined. I don’t know if you can extend that with a separate iOS app.

For the second question - I need to check, occasionally some services could be missing, I need to re-parse the Apple file to add them. Will check and get back to you. Is the StatelessProgrammableSwitch the one you need?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or mute the thread.