Skip to content

feat: Support position commands for state-only window coverings - #35

Open
ergusto wants to merge 1 commit into
athombv:masterfrom
ergusto:fix/state-only-window-coverings
Open

ergusto wants to merge 1 commit into
athombv:masterfrom
ergusto:fix/state-only-window-coverings

Conversation

@ergusto

@ergusto ergusto commented Oct 16, 2026

Copy link
Copy Markdown

Problem

Devices that only have windowcoverings_state (up / idle / down) and no windowcoverings_set, such as Somfy RTS blinds, are exposed with just the Lift feature. That only supports UpOrOpen / DownOrClose / StopMotion.

Apple Home controls blinds by position: it sends GoToLiftPercentage and expects a current and target position. With only Lift, these devices show up in Apple Home as "Not Supported" or "No Response" and can't be controlled. The existing note in this branch points at the same thing ("The status seems to be synced, but it doesn't show up in Apple Home").

Change

State-only window coverings are now exposed as position-aware two-position blinds (Lift + PositionAwareLift):

  • goToLiftPercentage: positions of 50% or more send down, lower positions send up
  • upOrOpen / downOrClose send up / down as before, and set the position to fully open or closed
  • stopMotion sends idle as before and leaves the position unchanged
  • An up / down state change in Homey updates the reported position
  • The initial position is closed if the current state is down, otherwise open

Blinds with windowcoverings_set and all other device classes are unaffected.

Removed: operationalStatus syncing

Most of the deleted lines are the code that mapped windowcoverings_state to operationalStatus (Opening / Closing / Stopped), both on creation and on state changes. I removed it because these devices' state stays up / down after the blind has finished moving. It only returns to idle on an explicit stop, so the status would report "Opening" / "Closing" indefinitely. With position support added, that risks controllers showing the blind as permanently moving. The reported position now carries the state instead. Happy to restore it if you'd prefer to keep it.

Trade-offs

  • These devices have no position feedback, so the reported position is assumed from the last command. Moving the blind with its physical remote isn't reflected (as before).
  • Existing pairings see the endpoint gain PositionAwareLift. In my case, Apple Home picked this up after an app restart.

Testing

  • Two Somfy RTS blinds (via com.somfy) on Homey Self-Hosted Server, controlled from Apple Home: open, close, slider and stop all work.
  • Added tests/window-coverings.test.mjs, covering position commands, up/down/stop, and Homey state sync. It fails on the current code and passes with this change. The full npm test suite passes (28/28).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant