homebridge / HAP-NodeJS

Node.js implementation of the HomeKit Accessory Protocol (HAP)
Apache License 2.0
2.69k stars 630 forks source link

How is this possible? #665

Closed seydx closed 4 years ago

seydx commented 5 years ago

I recently see a video of a valve(?) service with following ui

7BEB5A7B-CBD0-45B6-B544-A98D9B1C0523 446E4498-7AE0-4B17-A0EF-6AC27C59FDCB

Is this currently possible? Or is this a special version of HomeKit?

Here in action: https://m.youtube.com/watch?feature=youtu.be&v=D6FzNLDbw5Q

I tried to create a valve service or faucet service with additional current/target temperature characteristics etc.. no chance

Any idea @KhaosT ?

Best regards

KhaosT commented 5 years ago

Linked services I assume

https://github.com/nfarina/homebridge/issues/1707#issuecomment-486418630

Sent from my iPhone

On Apr 24, 2019, at 1:18 PM, Seyd notifications@github.com wrote:

I recently see a video of a valve(?) service with following ui

Is this currently possible? Or is this a special version of HomeKit?

Here in action: https://m.youtube.com/watch?feature=youtu.be&v=D6FzNLDbw5Q

I tried to create a valve service or faucet service with additional current/target temperature characteristics etc.. no chance

Any idea @KhaosT ?

Best regards

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

tobekas commented 5 years ago

Ah... wow! I was wondering what the usecase of Characteristic.ValveType.SHOWER_HEAD would be. But not sure, how you can get this to work. Maybe it’s similar to the irrigation system. You may need a Service.Faucet and a Service.Valve for each shower head (with ValveType set to SHOWER_HEAD) linked to the Faucet service. But it‘s still a guess. I‘m not able to test this out for the next week.

For the temperature it might be a Service.Thermostat or just a Characteristic.TargetTemperature. Since TargetTemlerature is not defined as an optional characteristic for Faucet or similar, I suspect it‘s a service.

Unfortunately there is no HAP documentation out there, that states which combinations of linked services are supported.

seydx commented 5 years ago

So, i tried many combinations with different services als linked service and characteristics... I cant get the temp slider... other things like the shower heads is no problem, but how can i get the slider....????

seydx commented 5 years ago

As "Main Service" we need the Service.Faucet and we need to add Service.Valve as linked services with different subtypes to the Service.Faucet

It is possible to add multiple Service.Valve to Service.Faucet

Because of slider i tried adding Service.Thermostat as linked Service and Service.TemperatureSensor

I tried also different characteristics on Service.Valve and Service.Faucet like Characteristic.TargetTemperatureand Characteristic.CurrentTemperature, but the temperature slider will not appear...

seydx commented 5 years ago

I finally made it!

IMG_4064

Have to test something, will immediately post an instruction

seydx commented 5 years ago

Ok guys, i think im ready..

It is possible to trigger all added valves at the same time, but at least one of them must be "InUse" (InUse = 1 / Active = 1) to activate the main Faucet, otherwise it will loop at "Starting..." - Also for disabling the main Faucet, all extra valves need to disabled (InUse = 0 / Active = 0)

A short summary for Active / InUse - Logic:

Active=0, InUse=0 -> Off Active=1, InUse=0 -> Waiting [Starting, Activated but no water flowing (yet)] Active=1, InUse=1 -> Running Active=0, InUse=1 -> Stopping

(thx to @tobekas for the short summary)

tobekas commented 5 years ago

Nice! I wonder if there are even more combined control elements available in Home. Would be also useful for multiple lightbulbs or switches...

jvmahon commented 5 years ago

@SeydX. Can you post a file with the code? @tobekas - I was wondering the same thing about multiple dimmers. For example, in my kitchen, I have 4 dimmers to control lighting. Could they be linked so they show up as one device but with 4 sliders on its main page? If you find out anything more, let us know.

seydx commented 5 years ago

@jvmahon

yes, im implementing it to my tado-platform plugin but with only one valve

https://github.com/SeydX/homebridge-tado-platform/blob/dev/src/accessories/boiler.js

n0rt0nthec4t commented 5 years ago
  • To add names, you need also add Characteristic.ConfiguredNameto these services, otherwise all Service.Valvewill appear as Faucet 1, Faucet 2, Faucet 3 etc...

Interestingly, using this idea, I added that characteristic to my "sprinklers" in my irrigation system. Seems you can have an on.('set' event bound to that to get notified of the name changing in the Home App. awesome

tobekas commented 5 years ago

I found this header file with some very interesting comments in it for the usage and combination (linked services...) of the HAP Services: https://github.com/MrAB-AbhijeetMahashabde/Quectel_BG96/blob/c97440947309d13c41c5cc55919413fa2c1847e9/Apple_Homekit/HomeKit%20ADK%202.0/HomeKit%20ADK%202.0/ADK/HAP/include/HAPServiceTypes.h

Especially the use of IrrigationSytem and Faucet (with linked HeaterCooler) is well documented there.

tobekas commented 5 years ago

@SeydX: So it seems to be better to put the temperature characteristics into a linked HeaterCooler Service for this Shower system.

seydx commented 5 years ago

@tobekas Thx for the link!

Im reading the hap r13 pdf and there are all informations we need to build these accessories... there are also informations about tv accessories and some (new?) characteristics like siri etc

https://github.com/MrAB-AbhijeetMahashabde/Quectel_BG96/blob/c97440947309d13c41c5cc55919413fa2c1847e9/Apple_Homekit/HomeKit%20Accessory%20Protocol%20Specification%20R13.pdf

@KhaosT maybe something for homebridge here?

KhaosT commented 5 years ago

As of right now there is no plan to implement support for remote control profile, since that's a really useless profile... Just use Siri Remote for that 😅

n0rt0nthec4t commented 5 years ago

I finally made it!

IMG_4064

Have to test something, will immediately post an instruction

Doesn't work atm like this in IOS 13 (beta2 and public beta 1). Just shows the on/off switch without the temp control.. See how it goes in future betas

jvmahon commented 5 years ago

@tobekas Thx for the link!

Im reading the hap r13 pdf and there are all informations we need to build these accessories... there are also informations about tv accessories and some (new?) characteristics like siri etc

https://github.com/MrAB-AbhijeetMahashabde/Quectel_BG96/blob/c97440947309d13c41c5cc55919413fa2c1847e9/Apple_Homekit/HomeKit%20Accessory%20Protocol%20Specification%20R13.pdf

@KhaosT maybe something for homebridge here?

I tried to download that R13 HAP specification, but no luck. Is there a new link to it?

Supereg commented 5 years ago

I tried to download that R13 HAP specification, but no luck. Is there a new link to it?

Apple was pretty quick in removing it. As it should only be accessible to people with an Mfi license agreement. Only the non-commercial version from few years ago is publicly available.

seydx commented 5 years ago

@jvmahon

You can find the file here

https://github.com/SeydX/hap-r13/blob/master/HomeKit%20Accessory%20Protocol%20Specification%20R13.pdf

noelhibbard commented 2 years ago

I wrote a plugin for a custom outdoor shower which I made using two sprinkler solenoids and a Raspberry Pi. This thread was really helpful in writing the plugin. I'm curious though, has anyone been able to use Siri to set the temperature? I can use Siri to turn the shower on and off but when I set the temp, Siri responds saying she did it but the slider doesn't actually move.