brutella / hap

The HomeKit Accessory Protocol (hap) implemented in Go
Apache License 2.0
355 stars 43 forks source link

[Question] Windows Shutter process #13

Closed ferllings closed 2 years ago

ferllings commented 2 years ago

Hello again, I'm trying to build a gateway with my shutters. I just want some clarification about the process to update / get update with a WindowsCovering device.

1) As I understand it CurrentPosition is the actual position of the shutter. TargetPosition is the desired value when you use the Homekit UI. Is That correct?

My Actual process is the following:

2) Do I need to SetValue on TargetPosition? and when?

3) Does PositionState need to be updated as well? Or is it handeled by the protocol?

Thanks for your time

brutella commented 2 years ago
  1. Do I need to SetValue on TargetPosition? and when?

I would set the TargetPosition to the CurrentPosition when the shutter is manually positioned. Otherwise the target != current position and the Home app will show that the shutter is moving.

  1. Does PositionState need to be updated as well? Or is it handeled by the protocol?

I think you don't have to because HomeKit can determine if the shutter is moving by comparing the target with the current position. But it's still a good idea to update the position state as well – just in case HomeKit uses it internally for some reason.

ferllings commented 2 years ago

Thanks for the confirmation !