Repository navigation
Add climate hold and pet mode commands - #247
Merged
natekspencer merged 6 commits intoNov 15, 2026
Merged
Conversation
This was referenced Nov 14, 2026
walthowd
force-pushed
the
feat/climate-hold-pet-mode
branch
from
November 14, 2026 22:53
09a4477 to
74052a0
Compare
This was referenced Nov 15, 2026
Collaborator
|
#252, #246 and #248 have been merged, so this now conflicts with They will land in this order, so rebasing in the same order keeps the later ones from conflicting again:
I've moved this to draft for now; please mark it ready for review once it's rebased. |
natekspencer
marked this pull request as draft
November 15, 2026 19:13
The server ends a subscription with an `error` message when it fails, for example when the vehicle refuses a command the subscription waits on. The web socket only logged those at debug, so a caller waiting on the subscription could only time out. Subscriptions can now take an `on_error` callback that gets the error message; existing callers are unchanged.
An `on_error` that raised escaped the receive loop and ended the receiver task. Both callbacks now run through `_run_callback`, which logs a failure instead of raising and awaits coroutine callbacks.
`start_gear_guard_live_stream` starts a live camera stream the way the Rivian app does and returns its Kinesis Video WebRTC config (signaling endpoint, ICE servers and role), for a viewer to join: - It subscribes to `gearGuardLiveConfig` with a fresh command id, then sends the signed `security.video_monitoring.start_live_streaming` command with that same id; the cloud routes the config by it. - `parallax.encode_live_streaming` builds the command's payload from a new `LiveStreamingRequest` schema; `GEAR_GUARD_CAMERAS` names the cameras. - A refused start (e.g. a camera the vehicle doesn't have) raises RivianApiException straight away, through the subscription's `on_error`. It needs Gear Guard video monitoring on and a paired phone. The vehicle serves one session at a time, about 3 minutes each and an hour a day. Builds on bretterer#249. Verified against a 2026 R1S (Gen 2) running 2026.36.01: the config arrived within seconds of the start when the vehicle was awake, and the front and right cameras streamed in a WebRTC viewer. A sleeping vehicle can take longer to wake than the default 40 second timeout. Not tested: the rear, left and bed cameras, the R2's cabin camera.
A refusal that reached the future before the start command was rejected was never read, so asyncio logged "Future exception was never retrieved"; it is now read before returning. The error handler also takes a `payload` sent as an object, not only as a list, so it still fails the start instead of raising in the callback.
- `search_places` searches like the Rivian app's map search (its `places` query): results with a Google place id, name, address, coordinates and the driving distance and time from where you search. - `suggest_places` returns the app's suggested search texts for partial text (the same query with autocomplete), such as "restaurants" and "Red Lobster" for "RE", for type-ahead in front of `search_places`. - `utils.place_url` builds the Rivian app's link for a result, which `send_location_to_vehicle` sends so the vehicle shows the place's name. None of them needs a paired phone key. Tested against the API: a search returned Google's results in under a second, in their own order rather than nearest first, and suggestions came back in about a tenth of a second. `maxResults` was ignored, so it is left out.
Encoders for the payloads of the signed `comfort.cabin.set_climate_hold` and
`comfort.cabin.set_pet_mode` commands, both a single on/off action as in the
Rivian app:
await rivian.send_parallax_command(
vehicle_id, SET_PET_MODE_RVM, encode_pet_mode(True), ...
)
Verified against a 2026 R1S (Gen 2) running 2026.36.01: pet mode on/off and
climate hold on/off each reported the new state within seconds. The pet mode
payloads match the app's (captured with mitmproxy); the app's climate hold
control only sets the duration (`set_climate_hold_duration`), so that
payload comes from the app's code. Not tested: Gen 1 vehicles, the R1T and
R2.
walthowd
force-pushed
the
feat/climate-hold-pet-mode
branch
from
November 15, 2026 20:31
74052a0 to
5a924dd
Compare
walthowd
marked this pull request as ready for review
November 15, 2026 20:31
Contributor
Author
|
Rebased onto #251 in your merge order (so the diff shows the ones ahead until they land), ready for review. |
natekspencer
approved these changes
Nov 15, 2026
natekspencer
left a comment
Collaborator
There was a problem hiding this comment.
Thanks, this looks good; the payloads match the app's climate hold and pet mode commands.
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.
Builds on #251.
Adds
encode_climate_holdandencode_pet_modefor the signedcomfort.cabin.set_climate_holdandcomfort.cabin.set_pet_modecommands (on/off).Tested
2026 R1S (Gen 2), 2026.36.01: pet mode and climate hold on/off each reported the new state within seconds. Pet mode payloads match the app's.
Not tested: Gen 1, R1T, R2