Skip to content

feat: window ventilation - close, ventilate or fully open door windows (#36) - #53

Merged
nanomad merged 2 commits into
SAIC-iSmart-API:developfrom
townsmcp:feat/window-ventilation
Oct 25, 2026
Merged

nanomad merged 2 commits into
SAIC-iSmart-API:developfrom
townsmcp:feat/window-ventilation

Conversation

@townsmcp

Copy link
Copy Markdown

Closes #36. Part of #26.

Adds control_door_windows(vin, *, action: DoorWindowsAction), which closes, ventilates (opens a few centimetres) or fully opens all four door windows together. This is the iSmart app's "Ventilation" control.

What it sends

Taken from decrypted iSmart app traffic on an MG S6 EV (UK account, EU servers). rvcReqType 3 with:

Parameter Value
8 (sunroof) 0, left alone
9, 10, 11, 12 (door windows) 1 each
13 (action) 0 close, 1 ventilate, 2 fully open

There's no end-of-parameters marker, matching the app.

Notes

  • control_windows is unchanged. It sends 3 as its open value, which the MG S6 EV doesn't use, so the new method sits alongside it rather than changing it for other models.
  • The car reports ventilated and fully open the same way in its status, so the two can't be told apart afterwards.
  • The MG S6 EV doesn't accept single-window control this way. The app only offers all four together.

We've been using this in mg-saic-ha on an MG S6 EV since September.

Changes

  • api/vehicle/windows/schema.py: DoorWindowsAction (CLOSE / VENTILATE / OPEN)
  • api/vehicle/windows/__init__.py: control_door_windows()
  • tests/test_door_windows.py: each action checked byte for byte, plus control_windows unchanged
  • README.md: feature list line

This one doesn't depend on the heated seat PRs and can be merged in any order. ruff (check and format), mypy, pylint and pytest all pass locally on Python 3.13.

SAIC-iSmart-API#36)

control_door_windows(vin, action=DoorWindowsAction.CLOSE/VENTILATE/OPEN)
sends what the iSmart app sends on an MG S6 EV (decrypted app traffic):
request type 3, the sunroof parameter 0 (left alone), all four door
windows 1, then the action (0 close, 1 ventilate, 2 fully open), with no
end-of-parameters marker. control_windows is unchanged for other models
(its open value, 3, isn't used by the MG S6 EV).
@nanomad

nanomad commented Oct 25, 2026

Copy link
Copy Markdown
Contributor

@townsmcp Thanks for the PR, i wonder if this may suffer from the same issue as #51 address, did you test it on a LHD and RHD car?

@nanomad
nanomad changed the base branch from master to develop October 25, 2026 14:18
@nanomad
nanomad merged commit 0f84db3 into SAIC-iSmart-API:develop Oct 25, 2026
4 checks passed
@townsmcp

Copy link
Copy Markdown
Author

Thanks for merging @nanomad. Good question. I've only tested it on my right-hand drive MG S6 EV (UK), not on a left-hand drive car.

I don't think it can have the #51 problem though: control_door_windows doesn't choose a side. It sends the same value (1) for all four door windows (params 9, 10, 11 and 12), leaves the sunroof alone, and sends the action, exactly as the iSmart app does. Every window gets the same instruction, so a swapped left/right mapping can't change what happens.

Where the driver/passenger naming does bite is the window status: the car reports the front windows as driverWindow / passengerWindow, so on a RHD car those are front-right / front-left. We hit that in mg-saic-ha (an MG HS PHEV and my S6 showed the front window sensors swapped) and now map them using the car's LHD/RHD config. That's in the integration rather than the library, but I'm happy to raise an issue for it if you think it belongs here.

If anyone with a LHD car can try ventilate / open / close, it would be good to have that confirmed too.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Window ventilation mode (partial open)

2 participants