Sponsored

Rivian API

sub

Well-Known Member
Joined
Jul 23, 2021
Threads
24
Messages
1,465
Reaction score
2,524
Location
USA
Vehicles
Rivian R1S, Tesla Model 3
Does anyone know how frequently you can hit up the vehicle status gateway without annoying Rivian?

I built an AWS Lamba function to log the vehicle status data and having it running 1x a minute. 12 hours in and it seems to be working fine.

I am considering increasing the polling frequency when actively driving or charging. Would every 10-20 seconds be too much?
Sponsored

 

the_mace

Well-Known Member
First Name
Rob
Joined
Apr 8, 2022
Threads
10
Messages
373
Reaction score
308
Location
Boston, MA
Vehicles
Tesla Model S75D, Ford F350 Diesel, Mercedes GLC30
Occupation
CTO
Does anyone know how frequently you can hit up the vehicle status gateway without annoying Rivian?

I built an AWS Lamba function to log the vehicle status data and having it running 1x a minute. 12 hours in and it seems to be working fine.

I am considering increasing the polling frequency when actively driving or charging. Would every 10-20 seconds be too much?
It seems to depend on how much data you ask for. For instance asking for basically everything every second eventually locks your account. I'd recommend using a non-primary account for API access (you can only have 2 accounts today but that's about to change to 4 with this release that's coming out).

I've polled every second for days asking for a very small set of data without issues. Mostly just to see how it did. That being said I don't need data every second so I backed that off to a more reasonable time period for when the data would be useful/interesting.

I'd recommend a minimum of 30s between hits but that's just my personal opinion.
 

OverZealous

Well-Known Member
Joined
Oct 19, 2021
Threads
8
Messages
585
Reaction score
1,464
Location
Louisville, Kentucky
Vehicles
2022 R1T LE, 2023 R1S Quad-Adventure
Occupation
Product Manager / Front-End Developer
Clubs
 
I just had to switch my HomeAssistant integration back to using an alternate account due to my primary account getting rate limited.

Luckily it didn't lock me out completely, as we were 1000 miles away from home! I ended up logging into my HA remotely and re-setting up the integration after inviting my secondary account over.

So I still strongly recommend using an alternate account, since the risk of your primary account getting blocked is still too high.
 

Seattleite

Well-Known Member
First Name
Chris
Joined
Apr 29, 2021
Threads
11
Messages
66
Reaction score
84
Location
Seattle, WA
Vehicles
R1S, Chevy Bolt
Occupation
Slacker
Clubs
 
Hi, complete newbie to HomeAssistant here, but am quite interested in what's being discussed in this thread. If there is a fairly thorough How-To guide as to how to set everything up to get to the level of polling Rivian for pertinent data, I would be most appreciative if someone could point me at it!

Thanks in advance!
 

Zoidz

Well-Known Member
First Name
Gil
Joined
Feb 28, 2021
Threads
114
Messages
3,397
Reaction score
7,431
Location
PA
Vehicles
23 R1S Adv, Avalanche, BMWs-X3,330cic,K1200RS bike
Occupation
Engineer
Does anyone know how frequently you can hit up the vehicle status gateway without annoying Rivian?

I built an AWS Lamba function to log the vehicle status data and having it running 1x a minute. 12 hours in and it seems to be working fine.

I am considering increasing the polling frequency when actively driving or charging. Would every 10-20 seconds be too much?
Just curious - why do you want to poll 10-20 second intervals, especially when charging? FOMO? j/k.

This is a conversation I frequently have with our manufacturing customers who want to log historical manufacturing data at high rates. What useful information would you learn from logging charging data every 10 seconds vs once every 60 or 120 seconds? To be clear, I'm not criticizing, just curious as to why...
 

Sponsored

zefram47

Well-Known Member
First Name
Aaron
Joined
Feb 6, 2022
Threads
15
Messages
2,180
Reaction score
3,442
Location
Denver, CO
Vehicles
R1T, C6 Corvette GS
Occupation
Software Engineer
Just curious - why do you want to poll 10-20 second intervals, especially when charging? FOMO? j/k.

This is a conversation I frequently have with our manufacturing customers who want to log historical manufacturing data at high rates. What useful information would you learn from logging charging data every 10 seconds vs once every 60 or 120 seconds? To be clear, I'm not criticizing, just curious as to why...
As someone who has taken data for a couple charging curves using video, very little of the curve is interesting beyond about 60s interval. In a couple spots with a big swing in requested power I'd look at 15s intervals, but it didn't seem all that important. At high power though, close to 200 kW, you could argue for 30s resolution, but as it falls off down to 120 kW or so you just don't need the high temporal resolution.
 

sub

Well-Known Member
Joined
Jul 23, 2021
Threads
24
Messages
1,465
Reaction score
2,524
Location
USA
Vehicles
Rivian R1S, Tesla Model 3
Just curious - why do you want to poll 10-20 second intervals, especially when charging? FOMO? j/k.

This is a conversation I frequently have with our manufacturing customers who want to log historical manufacturing data at high rates. What useful information would you learn from logging charging data every 10 seconds vs once every 60 or 120 seconds? To be clear, I'm not criticizing, just curious as to why...
The easiest answer is that I don't know yet what useful information I will be able to get out of the data or exactly how I will use it. I would rather over-sample now than be annoyed later wishing that I had better data. It is way easier to purge data later than recreate data I didn't collect.

Storage and compute on AWS is so cheap the only reason to sample less is to reduce the risk of annoying Rivian and getting booted out.

A DC fast charging session does not last very log so 60 second sampling does not give you very much data to work with. A 15 minute charging session with only 7-15 datapoints (60-120sec) seems pretty light. For a 12 hour level 1 or 2 charge, I agree 60 seconds is probably more than enough.

One thing that I know I want to track/calculate is kwh/mi when driving.

The API only exposes battery % so I need some way of figuring out how to convert % to kwh. That number will change over time, so I don't want to just use a fixed number. I need some way to calculate it. I think charging will be the best opportunity to calculate kwh / %, so I want to make sure I have good data during the charge to increase my odds of success.

It would be really nice if Rivian used a static value kwh/mi value when calculating distanceToEmpty. But it doesn't, or at least they claim it is not static, so distanceToEmpty is of no use for calculating kwh/mi.
 

sub

Well-Known Member
Joined
Jul 23, 2021
Threads
24
Messages
1,465
Reaction score
2,524
Location
USA
Vehicles
Rivian R1S, Tesla Model 3
I just had to switch my HomeAssistant integration back to using an alternate account due to my primary account getting rate limited.

Luckily it didn't lock me out completely, as we were 1000 miles away from home! I ended up logging into my HA remotely and re-setting up the integration after inviting my secondary account over.

So I still strongly recommend using an alternate account, since the risk of your primary account getting blocked is still too high.
How frequently were you hitting up the API?
 

OverZealous

Well-Known Member
Joined
Oct 19, 2021
Threads
8
Messages
585
Reaction score
1,464
Location
Louisville, Kentucky
Vehicles
2022 R1T LE, 2023 R1S Quad-Adventure
Occupation
Product Manager / Front-End Developer
Clubs
 
How frequently were you hitting up the API?
I have no idea how frequently the HomeAssistant integration hits it, I wasn’t doing anything special.

It hadn’t been a problem for a while. Early on, there was a bug in the integration that got my entire account locked out for a week, which was a bit of an issue, since I couldn’t log back into the app, and lost both PaaK and all remote functionality.

I actually used my primary account by accident, due to shuffling some accounts around when we got our R1S.
 

sub

Well-Known Member
Joined
Jul 23, 2021
Threads
24
Messages
1,465
Reaction score
2,524
Location
USA
Vehicles
Rivian R1S, Tesla Model 3
Since Graphql doesn't let you ask for a list of all available fields, I have been making up field names and trying them out. So far I have found one new field in vehicleState.

"batteryCapacity": {
"__typename": "TimeStampedFloat",
"timeStamp": "2023-08-03T14:58:50.761Z",
"value": 127
},

127 seems like it would be kWh @ 100% charge. But with my brand new vehicle and a perfectly round number I can't tell if that is hard coded based on battery type, or if it is how much capacity the vehicle actually thinks the battery could hold.

Can someone with an older vehicle check and see if you get something other than exactly 127.

Even if it is hardcoded into the battery, it could still be useful for determining which battery you have once standard/max batteries enter production.
 

Sponsored

the_mace

Well-Known Member
First Name
Rob
Joined
Apr 8, 2022
Threads
10
Messages
373
Reaction score
308
Location
Boston, MA
Vehicles
Tesla Model S75D, Ford F350 Diesel, Mercedes GLC30
Occupation
CTO
Since Graphql doesn't let you ask for a list of all available fields, I have been making up field names and trying them out. So far I have found one new field in vehicleState.

"batteryCapacity": {
"__typename": "TimeStampedFloat",
"timeStamp": "2023-08-03T14:58:50.761Z",
"value": 127
},

127 seems like it would be kWh @ 100% charge. But with my brand new vehicle and a perfectly round number I can't tell if that is hard coded based on battery type, or if it is how much capacity the vehicle actually thinks the battery could hold.

Can someone with an older vehicle check and see if you get something other than exactly 127.

Even if it is hardcoded into the battery, it could still be useful for determining which battery you have once standard/max batteries enter production.
Nice! Just added to my project (https://github.com/the-mace/rivian-python-api) and it shows 127 for my R1T (March 2023).

Thought they were supposed to be 135 kW?

Code:
% bin/rivian_cli --state --privacy
Vehicle State:
Power State: sleep
Drive Mode: everyday
Gear Status: park
Odometer: 5345.6 mi
Battery:
   Battery Level: 63.8%
   Range: 185.8 mi
   Battery Limit: 85.0%
   Battery Capacity: 127 kW
   Charging state: charging_ready
   Charger status: chrgr_sts_not_connected
   Time to end of charge: 0
 

sub

Well-Known Member
Joined
Jul 23, 2021
Threads
24
Messages
1,465
Reaction score
2,524
Location
USA
Vehicles
Rivian R1S, Tesla Model 3
Can someone else confirm if getLiveSessionData or any of the other /chrg/user/ queries are still working for you? All I can get from any of the chrg/user queries is "null".


"data": {
"getLiveSessionData": {
"isRivianCharger": null,
"isFreeSession": null,
"vehicleChargerState": {
"__typename": "StringValueRecord",
"value": "charging_ready",
"updatedAt": "2023-08-04T17:59:34.499Z"
},
"chargerId": null,
"startTime": null,
"timeElapsed": null,
"timeRemaining": null,
"kilometersChargedPerHour": null,
"power": null,
"rangeAddedThisSession": null,
"totalChargedEnergy": null,
"currentPrice": null
}
}
 

Chewy734

Well-Known Member
First Name
Ashu
Joined
Nov 8, 2020
Threads
23
Messages
1,007
Reaction score
1,967
Location
Los Angeles
Vehicles
BMW, Ford, Rivian
Clubs
 
Is anyone thinking about making a Homebridge plugin for our vehicles? That could be pretty useful to have for those of us tied to the Apple ecosystem.
 

the_mace

Well-Known Member
First Name
Rob
Joined
Apr 8, 2022
Threads
10
Messages
373
Reaction score
308
Location
Boston, MA
Vehicles
Tesla Model S75D, Ford F350 Diesel, Mercedes GLC30
Occupation
CTO
Can someone else confirm if getLiveSessionData or any of the other /chrg/user/ queries are still working for you? All I can get from any of the chrg/user queries is "null".


"data": {
"getLiveSessionData": {
"isRivianCharger": null,
"isFreeSession": null,
"vehicleChargerState": {
"__typename": "StringValueRecord",
"value": "charging_ready",
"updatedAt": "2023-08-04T17:59:34.499Z"
},
"chargerId": null,
"startTime": null,
"timeElapsed": null,
"timeRemaining": null,
"kilometersChargedPerHour": null,
"power": null,
"rangeAddedThisSession": null,
"totalChargedEnergy": null,
"currentPrice": null
}
}
You can see example real data in these docs:
https://rivian-api.kaedenb.org/app/charging/get-live-session-data/#getlivesessiondata
Sponsored

 
 




Top