Repository navigation
Add sending and ending trips - #248
Conversation
- `send_trip_to_vehicle` sends stops the way the Rivian app's trip planner does. The vehicle plans the route and charging stops itself, arriving with at least the given charge, at chargers of the given networks (`CHARGING_NETWORKS`, named like the app's charging filter; all by default, as the app sends without a filter). - `end_trip` ends the trip the vehicle is navigating, with an unsigned `sendParallaxPayload` on `c2v_navigation.trip_copilot.updated_trip`. `parallax.encode_end_trip` builds it from a new `UpdatedTrip` schema, in the same envelope as a signed command. Neither needs a paired phone key. Verified against a 2026 R1S (Gen 2) running 2026.36.01: a one-stop trip appeared in the vehicle's navigation, and `end_trip` ended it. Not tested: several stops, a network filter, Gen 1 vehicles. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FxWHBTrHU6eTPotwMWgtJF
natekspencer
left a comment
There was a problem hiding this comment.
Thanks, this works well and the validation is thorough. One small thing:
networks=[] is ambiguous. It passes validation and sends an empty networks list, while the docstring only describes None (all networks). Whether the API treats an empty filter as "no chargers" or "all" isn't stated, so callers can't tell what they'll get. Either raise RivianBadRequestError for an empty list, or document what it does (ideally after checking it on the vehicle), with a test for it.
This also needs a rebase once the other ready PRs land (additive conflicts in parallax/__init__.py, rivian.py and tests/test_rivian.py).
The networks are the Rivian app's "Preferred Networks", a soft preference rather than a filter. On a 2026 R1S (Gen 2, 2026.36.01) they made no visible difference: a trip to St. Louis planned the same Tesla stop with Tesla only, Electrify America only and all networks, and an Electrify America only trip went to a ChargeLab charger. `networks` is gone, and every network id is sent, as the Rivian app does by default. A trip sent while the vehicle navigates another one was ignored until `end_trip`, so the docstring now says to end it first.
|
Good call. Dug into it with the truck and the app. "networks" is the app's Preferred Networks, a soft preference ( Also found a new trip is ignored while one's active, so the docstring now says to end it first. I'll drop the matching option from home-assistant-rivian#347. |
Does the service still accept it and return Update: I tested this myself on the truck, and it does. With a trip to one stop active, sending a trip to a second stop returned |
natekspencer
left a comment
There was a problem hiding this comment.
Thanks for testing that against the truck. Dropping the preference that has no visible effect and always sending the app's default list is the right call, and the note about ending an active trip first is helpful.
send_trip_to_vehicle: sends stops like the app's trip planner. The vehicle plans the route and charging stops, with a minimum arrival charge.end_trip: ends the current trip (parallax.encode_end_trip, newUpdatedTripschema)Neither needs a paired phone key.
Tested
2026 R1S (Gen 2), 2026.36.01:
end_tripended themend_tripNot tested: multiple stops, Gen 1