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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.