Sponsored

OverZealous

Well-Known Member
Joined
Oct 19, 2021
Threads
8
Messages
581
Reaction score
1,459
Location
Louisville, Kentucky
Vehicles
2022 R1T LE, 2023 R1S Quad-Adventure
Occupation
Product Manager / Front-End Developer
One of the things I really like about the Tesla, is the open API, you can generate an access token, and pretty much control anything the OEM app can (which is how apps like Tessie work). I mean, I used Postman (desktop REST/API dev/test tool) to open my trunk :D

I had wondered if Rivian offered the same, so we could see custom apps, smart Watch apps, integrate with all sorts of automation services (like rolling up the windows if a weather data service indicates a storm approaching).
Tesla still doesn't offer an official API. Just like Rivian, it has to be reverse engineered, and they can (technically, if not practically) pull the rug out at any time (which they've actually done fairly recently in a way that broke the HomeAssistant setup—it's now only supported via 3rd-party integrations).

I've already asked Rivian several times for an official API—even if it's limited. I think everyone should ask them for this, maybe they'll be better at some point. It's not like security through obscurity is helping here—it's just making it easier to abuse the service and do unexpected things.
Sponsored

 

RWerksman

Well-Known Member
Site Sponsor
First Name
Rob
Joined
Nov 13, 2020
Threads
57
Messages
1,391
Reaction score
3,118
Location
Pittsburgh
Vehicles
Jeep & R1T
Well if OP hadn't written the entire post in Spanish maybe it would be easier to understand...?
🤣

Rivian has setup an API where data about vehicles (and certain other actions) can be accessed remotely. Think of it as a program to program website. This is largely what the app on your phone uses - when you open the app, it makes a call to the API and then uses the stuff that the API sends back (like remaining range) to populate the values in the right place on your screen.

OP has setup a secondary driver on his account and uses the login for that user with a program called Node Red to query the API for data about his truck. He does some checks for things like charging and location to determine if his truck is in motion. He than sends that data to a program called Home Assistant that has an A Better Route Planner add-in available for it.

It's really ingenious.


A few other things to point out to non-technical folks who may be reading this:
  • The app on your phone doesn't directly communicate to your truck. It talks to the server at Rivian (likely running in Amazon Web Services) that is in communication with your truck. When you click the unlock button in the app, it posts that to server. (like when you click the post button here) The server then basically does the same thing to the truck, presumedly, and then the truck posts back that it's now unlocked, and your phone periodically does calls to the API to see status and changes the unlock flag in the app when it sees a different value.
  • There is a whole group of people who basically observe what the app does and then reverse engineer these activities. That's really why you're seeing this.
  • APIs are basically how the world goes around anymore. Nearly every app or server that talks to another server or 'the cloud' almost certainly uses these.
Sorry for the mansplaning. Just figured people would be interested in this...
 
OP
OP

mindstormsguy

Well-Known Member
Joined
Jan 3, 2021
Threads
10
Messages
303
Reaction score
623
Location
Seattle area
Vehicles
Some
OP has...
Just one clarification, the flow goes like this:
  • Truck sends data Rivian Servers
  • HA plugin to grab the data from Rivian (so that I don't have to maintain my own code to talk to the ever-changing Rivian API)
  • Node Red plugin to pull sensor data from HA (so that I don't have to learn how to write my own direct HA plugin)
  • Node Red HTTP GET call to publish the data to ABRP
All of that is just running on a server at my house, so it magically chugs away without any interaction by me. At that point, I can open ABRP anywhere on any device and it will have live data from my truck.

Eventually, if Rivian releases the rumored web browser, this could even work with a UI right on the main screen. It would just be a really indirect path the information being displayed 😅. But given how they said the browser is delayed while they figure out the security model to isolate the browser so it's not an attack vector, I doubt anything more direct would be possible.
 

RWerksman

Well-Known Member
Site Sponsor
First Name
Rob
Joined
Nov 13, 2020
Threads
57
Messages
1,391
Reaction score
3,118
Location
Pittsburgh
Vehicles
Jeep & R1T
Just one clarification, the flow goes like this:
  • Truck sends data Rivian Servers
  • HA plugin to grab the data from Rivian (so that I don't have to maintain my own code to talk to the ever-changing Rivian API)
  • Node Red plugin to pull sensor data from HA (so that I don't have to learn how to write my own direct HA plugin)
  • Node Red HTTP GET call to publish the data to ABRP
All of that is just running on a server at my house, so it magically chugs away without any interaction by me. At that point, I can open ABRP anywhere on any device and it will have live data from my truck.

Eventually, if Rivian releases the rumored web browser, this could even work with a UI right on the main screen. It would just be a really indirect path the information being displayed 😅. But given how they said the browser is delayed while they figure out the security model to isolate the browser so it's not an attack vector, I doubt anything more direct would be possible.
My bad! Thanks for the clarification.

I'm my defense though, I'm in IT management, so me flubbing at least one part up should have been expected. 😁
 

TheIglu

Well-Known Member
First Name
Clayton
Joined
Apr 6, 2022
Threads
23
Messages
298
Reaction score
417
Location
North Central MA
Vehicles
2022 Rivian R1T, 2004 Mazdaspeed Miata
Occupation
IT
Is NodeRed and HomeAssistant lightweight enough to run on a Raspberri Pi 3?
 

Sponsored

TheIglu

Well-Known Member
First Name
Clayton
Joined
Apr 6, 2022
Threads
23
Messages
298
Reaction score
417
Location
North Central MA
Vehicles
2022 Rivian R1T, 2004 Mazdaspeed Miata
Occupation
IT
Well, there goes some of my free time in the next few nights. I have a couple spare RP3's kicking around with nothing to busy themselves with.
 

zefram47

Well-Known Member
First Name
Aaron
Joined
Feb 6, 2022
Threads
13
Messages
2,016
Reaction score
3,157
Location
Denver, CO
Vehicles
R1T, C6 Corvette GS
Occupation
Software Engineer
Clubs
 
I don't run it on a Pi, but yes, a lot of folks do.
Sweet, I have an RPi 4 that's been doing server duty so I'll probably jump through these hoops when I eventually get my truck.
 

joshtish

Member
Joined
Mar 24, 2022
Threads
0
Messages
24
Reaction score
21
Location
Ann Arbor, MI
Vehicles
2022 Rivian R1T
Occupation
Information Technology.
I’m not sure I understand what this does for me vs just using the ABRP app on my phone while I’m in the car. Is this about having a more accurate state of charge while underway?
 

RWerksman

Well-Known Member
Site Sponsor
First Name
Rob
Joined
Nov 13, 2020
Threads
57
Messages
1,391
Reaction score
3,118
Location
Pittsburgh
Vehicles
Jeep & R1T
I’m not sure I understand what this does for me vs just using the ABRP app on my phone while I’m in the car. Is this about having a more accurate state of charge while underway?
This is a real(ish) time data feed between the vehicle and the app. I'm not 100% sure what the capabilities of the ABRP app are, but theoretically it should be able to provide guidance based on what is actually happening and what was projected.
 

Sponsored

OP
OP

mindstormsguy

Well-Known Member
Joined
Jan 3, 2021
Threads
10
Messages
303
Reaction score
623
Location
Seattle area
Vehicles
Some
Yeah, exactly, it just closes the loop on state of charge. With this, you don't need to tell ABRP your starting charge. And if APRP's estimate was wrong, it will be continuously updated to adjust.
 

zefram47

Well-Known Member
First Name
Aaron
Joined
Feb 6, 2022
Threads
13
Messages
2,016
Reaction score
3,157
Location
Denver, CO
Vehicles
R1T, C6 Corvette GS
Occupation
Software Engineer
Clubs
 
IIRC, wouldn't this data feed also help train ABRP's model for the R1 as well, both for on-road consumption as well as charging profile? One issue I've noticed is they have the 3 battery configurations for both the truck and SUV listed, but they didn't include the various wheel/tire options. So if someone with 21s actually submits data frequently then it'll wind up being very optimistic compared with someone on 20s.
 
OP
OP

mindstormsguy

Well-Known Member
Joined
Jan 3, 2021
Threads
10
Messages
303
Reaction score
623
Location
Seattle area
Vehicles
Some
IIRC, wouldn't this data feed also help train ABRP's model for the R1 as well, both for on-road consumption as well as charging profile? One issue I've noticed is they have the 3 battery configurations for both the truck and SUV listed, but they didn't include the various wheel/tire options. So if someone with 21s actually submits data frequently then it'll wind up being very optimistic compared with someone on 20s.
In general, yes. But the specifics aren't clear. I know when I was feeding data for my e-tron, it learned to apply a general multiplier to my e-tron pretty quickly (the equivalent of changing the "reference consumption" figure). But actually improving the model, I don't know. I believe they model Cd, mass, rolling resistance, temperature effects, etc, but I didn't get the impression that any of that was being tuned.

I think if we got a fleet of Rivians reporting to ABRP, it might actually get trained.

It's too bad ABRP doesn't treat wheel sizes as a model differentiator though.
 

RWerksman

Well-Known Member
Site Sponsor
First Name
Rob
Joined
Nov 13, 2020
Threads
57
Messages
1,391
Reaction score
3,118
Location
Pittsburgh
Vehicles
Jeep & R1T
In general, yes. But the specifics aren't clear. I know when I was feeding data for my e-tron, it learned to apply a general multiplier to my e-tron pretty quickly (the equivalent of changing the "reference consumption" figure). But actually improving the model, I don't know. I believe they model Cd, mass, rolling resistance, temperature effects, etc, but I didn't get the impression that any of that was being tuned.

I think if we got a fleet of Rivians reporting to ABRP, it might actually get trained.

It's too bad ABRP doesn't treat wheel sizes as a model differentiator though.
How far was it off for your e-tron?
 
OP
OP

mindstormsguy

Well-Known Member
Joined
Jan 3, 2021
Threads
10
Messages
303
Reaction score
623
Location
Seattle area
Vehicles
Some
How far was it off for your e-tron?
I don’t remember the figure, and I just recently deleted it from my account so that I could add the Rivian 😅. I don’t have a paid account with ABRP, so I can only have one saved vehicle.
Sponsored

 
 




Top