Repository navigation
Conversation
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.
|
Thanks for this. #229 is now merged (squashed), and #232 removed the
Also, @walthowd mentioned on #229 that they have Parallax versions of the vehicle commands in their fork. It's worth comparing notes so you don't duplicate work. |
|
Hey @tn9design, I've been hacking on the same thing in my fork (walthowd#2), so comparing notes like Nate suggested. Good news: your payloads and mine match byte for byte, all but one. I fired your exact bytes at my 2026 R1S (Gen 2, 2026.36.01) and everything worked: locks, windows, frunk, liftgate, seat heat/vent, steering wheel heat, preconditioning, temp including HI and LO, defrost, charge limit, start/stop charging. The liftgate working on a Gen 2 R1S should cover the ask in bretterer/home-assistant-rivian#338. A few notes from the truck:
Mine also has charge port door, panic, and Gear Guard video on/off if you want to fold those in. No sense having two of these, so I'm happy to drop my PR and build on #235. |
|
Thanks for all the work on this, and for testing on an R2. Since this was opened, the rest of it has landed in other PRs, so I'm closing it:
Your R2 results are worth keeping here: liftgate open and close worked; the windows didn't move (and iOS Shortcuts showed window venting unavailable); the frunk closes by hand; and some charging commands took effect even though the result came back as operation error 3. |
* Remove a subscription that's interrupted while starting start_subscription registers a subscription before sending the subscribe request. If the send fails or is cancelled, the caller never gets an unsubscribe handle, but the registration stays: every reconnect resubscribes it, its callback keeps getting messages, and the web socket never closes because it always has a subscription. Remove the registration when the send is interrupted, and close the connection if nothing else is on it. A subscribe cancelled while connecting or waiting for the ack also closes an otherwise unused connection. Cleanup is bounded to 5 seconds and keeps the original error. From #235. Co-authored-by: tn9design <52539250+tn9design@users.noreply.github.com> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Keep the connection for subscribes still starting The cancel cleanup closed the web socket whenever it had no subscriptions, which includes while another subscribe is still waiting for the ack on the same connection, so that one failed too. The client now counts the subscriptions it's still starting and closes the connection only when nothing is subscribed or starting on it. The monitor no longer closes it when a subscribe send is interrupted: it removes its own registration and leaves the closing to the client. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Tidy the interrupted subscription cleanup and its tests Check the web socket before the guarded send, so an assertion can't be logged as a failed send, and shorten _close_unused_ws's docstring. The two-waiter test now waits for both subscribes to be starting rather than sleeping, and the interrupted-send test checks the server is told the subscription is complete. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: tn9design <52539250+tn9design@users.noreply.github.com> Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
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
VehicleCommandparameters and temperature/charge-limit bounds.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.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.