Skip to content

Add more Parallax controls and wait for command results - #235

Draft
tn9design wants to merge 9 commits into
bretterer:mainfrom
tn9design:feature/r2-parallax-controls
Draft

tn9design wants to merge 9 commits into
bretterer:mainfrom
tn9design:feature/r2-parallax-controls

Conversation

@tn9design

@tn9design tn9design commented Oct 25, 2026 •

Copy link
Copy Markdown

This builds on @ibain's signed lock/unlock work in #229. It adds the payloads needed for frunk, rear liftgate, windows, climate, seat conditioning and charging, plus a helper that waits for the vehicle to report the result.

Why

Getting the command accepted by the cloud doesn't always tell us what happened at the vehicle. During R2 testing, some charging commands took effect even though the result came back with operation error 3. Retrying those automatically could send the same command twice.

What

  • Add closure, climate and charging payload encoders using the existing VehicleCommand parameters and temperature/charge-limit bounds.
  • Subscribe to command results before sending, then wait for a matching command ID and RVM with a successful completion status. Clean up interrupted subscription setup so timeouts and cancellations do not leave stale registrations.
  • Send each command once. If the result is missing or ambiguous, report that the command may have taken effect and ask the caller to check the vehicle before retrying. Raw server messages and credentials stay out of these errors.

Testing

Vehicle tests used the earlier local build; the subsequent subscription-cleanup and input-validation refinements were verified offline.

The existing HA wake button was tested successfully. Earlier attempts took a few minutes; the latest user-operated test woke the R2 quickly, with HA reporting ready. The wake command remains on its existing path; this is not a new Parallax wake implementation. Rear-liftgate open and close were also confirmed by the owner and HA state history.

  • 384 tests pass on Python 3.12. Network access was restricted to localhost for the mock servers.
  • Ruff and mypy pass. Regenerating the protobuf modules produces no changes.
  • Added tests for payload bytes, parameter validation, matching results, timeouts, cancellation and subscription cleanup.
  • Tested on one R2: locks, frunk opening, rear-liftgate opening/closing, climate and temperature, driver-seat heat/ventilation, steering-wheel heat, defrost, Gear Guard and charging controls. Charging worked in these tests; some acknowledgements were inconsistent as described above. We haven't seen evidence of a major charging-control problem, but the cause of those responses is still uncertain.

Windows didn't move during testing, and iOS Shortcuts reported window venting unavailable for this R2. The R2 frunk closes manually, so powered frunk closing does not apply to this vehicle. Panic hasn't been physically tested. There are more details in docs/parallax-commands.md.

Related work / merge order

This branch includes @ibain's commits from #229 with their attribution intact. Happy to rebase this onto main after #229 merges, or keep the combined branch if you'd prefer to review and merge it together. That choice is up to the maintainers and #229's author.

The companion HA integration change can be reviewed alongside this. It needs a published client version containing both sets of changes before it can use them through its normal dependency pin.

Testing was done with the R2 parked at home and connected to Wi-Fi. Commands used Rivian's cloud API. We expect the same behavior when the vehicle is connected over cellular, but haven't verified that separately.

ibain and others added 9 commits October 20, 2026 09:40
command.proto describes the envelope, operation and state messages of a
signed remote command, and body.proto the lock and unlock payloads. The
modules are regenerated with the protoc hook.
encode_command signs an operation the way the Android app does,
decode_command_state_message reads the vehicleCommandStatePx messages,
and encode_lock and encode_unlock build the lock and unlock payloads.
_debug_message is taken out of core.py so the new decoder logs unknown
fields like the others.
send_parallax_command posts a signed command, and
subscribe_for_parallax_command_state follows it. The keys are
keyword-only, and a command id that is not a UUID is refused before
anything is sent.
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.

2 participants