Window Covering and Home App Problems

Hi guys,


I've been working on getting some accessories working nicely with the Home App. When dealing with Window Coverings I came across some observations that don't seem to make sense to me and I'd be very thankful if someone would either confirm those observations or tell me, where I am going wrong.


Summary: The Home App does not seem to properly use/display the available characteristics for the "Window Covering" service


The accessory uses a "Window Covering" service with the default characteristics (Current Position, Target Position, Position State) as well as two optional ones (Target Horizontal Tilt Angle & Current Horizontal Tilt Angle) and has been setup in the HomeKit Accessory Simulator.


After adding the accessory to the Home App on my iPad (iOS11.1.2) it properly shows up and I can interact with it while observing the changes in real time in the Simulator.


Now for my observations:


1. The Home App does NOT show the value of "Current Position" anywhere - the only thing that is displayed is "Target Position"

2. The Home App does NOT show the value of "Position State" anywhere - it derives the current state from the delta of "Current Position" and "Target Position". If "Current Position" > "Target Position" it displays "Closing", if "Current Position" < "Opening" and if they are the same, it displays the current value as %.


Is this how it is supposed to work? Am I missing something?


I intend to connect a real accessory via Home Kit Protocol that can be controlled in two ways:


a) by changing the moving direction (up, down, stop)

b) setting a desired target position


With the above observations this leads to the following questions:


1. If I set a target position on the accessory, the accessory will a) broadcast the change to "Target Position" and b) broadcast a series of changes to "Current Position" until it has reached the desired target position. This is properly reflected in the Home App when viewing the control in its small form (Showing "Opening" or "Closed"). Is there any way to make this process visible in the Home App when the the control is opened in full screen as well? As far as I could see it will jump right to the "Target Position" in the slider and not show anything regarding the updates to "Current Position" - even when opening the "Details" dialog.


2. If I change the accessory by using directional controls, the accessory will a) broadcast the change to "Position State" and b) broadcast a series of changes to "Current Position" until it is stopped again. It will NOT broadcast a change to "Target Position", since it is not known when just using directional interaction. This leads to a problem in the Home App. Since the App does NOT check the "Position State", but calculates the value by itself, it ends up with inverted directions when "Current Position" starts changing without changes to "Target Position".


Example: Blind is fully closed ("Current Position" and "Target Position" both being 0). Now the accessory is changed by using directional controls to open. This leads i.e. to "Current Position" to change to 5. Now the Home App does it's math (now "Current Position" > "Target Position") and displays "Closing", which is wrong.


Is there a way to get the Home App to properly display the direction by examining the "PositionState" characteristic?


Please let me know, if you need any additional information - I'll be happy to provide it.


Thanks in advance,


Kind regards,

Michael.

Replies

I have no issues with the windowcovering object.


i have set minValue, maxValue and step to 0,100,100 (so the slider wil not be able to send target position 54 etc.)


say current position=0 (which is closed) and you press the button to open.


the acc will receive a targetPosition (100)

it will need to set the positionState to increasing (either 0 or 1)

next it will need to start moving, you can update current position when it is moving.


once the currentPosition reached targetPosition, stop the movement and update positionstate to 2 (stopped) and send the new current position.


that is the workflow working at my end.

Hi, do you have any updates about this issue. I can confirm your observation and this implementation is very strange, especially in combination with manual controls. Konstantin

Hi have you used adk to create own window covering driver ?