Sponsored

Rivian API

p3ck

Well-Known Member
First Name
Bill
Joined
May 3, 2021
Threads
6
Messages
198
Reaction score
289
Location
Massachusettes, USA
Vehicles
Rivian R1T
Occupation
Software Engineer
Clubs
 
Delete and reinstall the integration to redo the auth. Working on a fix.
I had a backup but it's good to see that I didn't lose my view when deleting and re-adding.

Thanks for the great integration!
 

ImAI

Well-Known Member
Joined
Feb 16, 2022
Threads
10
Messages
157
Reaction score
176
Location
Sf Bay Area
Vehicles
Taycan TS, R1T
Thanks to @AdamUCF for the reverse engineering to create the PowerShell script. I've ported it over to Python to be compatible with more architectures including Mac and Linux.

Has anyone noticed that either the Python or Powershell script now errors out with error "UNAUTHENTICATED" when invoking the RestMethod?

This started happening as of 11/6/2022 or so. No changes to username or password and logging on via Rivian's web portal works using the same creds.
 

OverZealous

Well-Known Member
Joined
Oct 19, 2021
Threads
8
Messages
581
Reaction score
1,460
Location
Louisville, Kentucky
Vehicles
2022 R1T LE, 2023 R1S Quad-Adventure
Occupation
Product Manager / Front-End Developer
Has anyone noticed that either the Python or Powershell script now errors out with error "UNAUTHENTICATED" when invoking the RestMethod?

This started happening as of 11/6/2022 or so. No changes to username or password and logging on via Rivian's web portal works using the same creds.
The HomeAssistant integration was having issues which they resolved. It might be related, you can check out the thread and changes made here.

Specifically, the root issues were in the python client.
 

the_mace

Well-Known Member
First Name
Rob
Joined
Apr 8, 2022
Threads
10
Messages
368
Reaction score
304
Location
Boston, MA
Vehicles
Tesla Model S75D, Ford F350 Diesel, Mercedes GLC30
Occupation
CTO
For those that run into this thread, the code from earlier in this thread no longer works. I poked at it some but ended up using https://githu.com/bretterer/rivian-python-client as a starting point as it remains active/updated. I also used the unofficial API docs at https://rivian-api.kaedenb.org/, then just wrapping my own stuff around that/extending things.

Don't have the truck yet but the basic APIs pre-delivery are working:
% ./rivian_cli.py --privacy
Order ID: xxxx2477
Order ID: ORDERED
Status: READY_FOR_FULFILLMENT
Item: R1T
Customer flow complete: No
VIN: xxxx7FCT
ID: Not available yet
Carrier: RIVIAN
Status: INIT
Delivery date: Not available yet
 

Sponsored

zefram47

Well-Known Member
First Name
Aaron
Joined
Feb 6, 2022
Threads
14
Messages
2,100
Reaction score
3,313
Location
Denver, CO
Vehicles
R1T, C6 Corvette GS
Occupation
Software Engineer
Clubs
 
For those that run into this thread, the code from earlier in this thread no longer works. I poked at it some but ended up using https://githu.com/bretterer/rivian-python-client as a starting point as it remains active/updated. I also used the unofficial API docs at https://rivian-api.kaedenb.org/, then just wrapping my own stuff around that/extending things.

Don't have the truck yet but the basic APIs pre-delivery are working:
Doesn't look like the API page has collected much on order states. Mine lists status as PENDING_FULFILLMENT along with a non-VIN vehicleId. Guide indicated it means my truck is in production and/or waiting for factory QC/QA and that VIN assignment happens when it's ready for transport.
 

the_mace

Well-Known Member
First Name
Rob
Joined
Apr 8, 2022
Threads
10
Messages
368
Reaction score
304
Location
Boston, MA
Vehicles
Tesla Model S75D, Ford F350 Diesel, Mercedes GLC30
Occupation
CTO
Doesn't look like the API page has collected much on order states. Mine lists status as PENDING_FULFILLMENT along with a non-VIN vehicleId. Guide indicated it means my truck is in production and/or waiting for factory QC/QA and that VIN assignment happens when it's ready for transport.
Yeah mine has a VIN and is shipping/waiting on shipment (wish I knew). Its been a week after getting to step 7/8. From earlier in this thread it looks like more info used to be available but so far I havent found that info via the API. Still looking.

I think the vehicle ID (not vin) doesnt go on the account until close to actual delivery time.

For Tesla, that sort of thing happened a bit post-delivery.
 

pkropf

Member
First Name
Peter
Joined
Jan 1, 2023
Threads
0
Messages
8
Reaction score
7
Location
Oakland, CA
Vehicles
Tesla Model 3
Doesn't look like the API page has collected much on order states. Mine lists status as PENDING_FULFILLMENT along with a non-VIN vehicleId. Guide indicated it means my truck is in production and/or waiting for factory QC/QA and that VIN assignment happens when it's ready for transport.
Slight typo, first link should be:

https://github.com/bretterer/rivian-python-client
 

the_mace

Well-Known Member
First Name
Rob
Joined
Apr 8, 2022
Threads
10
Messages
368
Reaction score
304
Location
Boston, MA
Vehicles
Tesla Model S75D, Ford F350 Diesel, Mercedes GLC30
Occupation
CTO
For those that run into this thread, the code from earlier in this thread no longer works. I poked at it some but ended up using https://githu.com/bretterer/rivian-python-client as a starting point as it remains active/updated. I also used the unofficial API docs at https://rivian-api.kaedenb.org/, then just wrapping my own stuff around that/extending things.

Don't have the truck yet but the basic APIs pre-delivery are working:
I got my truck so I updated the API to support vehicle status commands/polling.

API/CLI here: https://github.com/the-mace/rivian-python-api


Code:
Vehicle State:
Power State: sleep
Drive Mode: everyday
Gear Status: park
Battery Level: 64.0%
Range: 302 miles
Battery Limit: 70.0%
Charging state: charging_ready
Charger status: chrgr_sts_not_connected
Mileage: 704.7 miles
Version: 2023.06.05
OTA: 0.0.0
OTA Download progress: 0.0%
OTA Installation Duration: 0
OTA Install progress: 0.0%
OTA Install Ready: ota_available
OTA Installation Time: 0
OTA Installation Type: Convenience
OTA Installation Status: Idle
OTA Current Status: Install_Success
Location: <lat>,<long> (hidden as its my house!)
Location Last Seen: 03/25/2023, 15:02PM EDT
Climate Interior Temp: 46.4ºF
Climate Driver Temp: 69.8ºF
Cabin Preconditioning Status: undefined
Cabin Preconditioning Type: NONE
Defrost: Off
Steering Wheel Heat: Off
Alarm active: false
Pet Mode: Off
Gear Guard Video: Enabled
Gear Guard Mode: Away_From_Home
Last Alarm: 03/25/2023, 09:13AM EDT
Time to end of charge: 0
Time to end of charge: 0
Doors:
   Front left locked: True
   Front left closed: True
   Front right locked: True
   Front right closed: True
   Rear left locked: True
   Rear left closed: True
   Rear right locked: True
   Rear right closed: True
Windows:
   Front left closed: True
   Front right closed: True
   Rear left closed: True
   Rear right closed: True
Seats:
   Front left Heat: False
   Front right Heat: False
   Rear left Heat: False
   Rear right Heat: False
Frunk:
   Frunk locked: True
   Frunk closed: True
Gear Guard Locked: False
Lift Gate:
   Lift Gate Locked: True
   Lift Gate Closed: False
Tonneau:
   Tonneau Locked: False
   Tonneau Closed: False
Wiper Fluid: normal
Tire pressures:
   Front Left: OK
   Front Right: OK
   Rear Left: OK
   Rear Right: OK
Currently playing with polling to see if it keeps the vehicle awake etc. If anyone has studied this please let me know.
 

Sponsored

the_mace

Well-Known Member
First Name
Rob
Joined
Apr 8, 2022
Threads
10
Messages
368
Reaction score
304
Location
Boston, MA
Vehicles
Tesla Model S75D, Ford F350 Diesel, Mercedes GLC30
Occupation
CTO
It doesn’t. Vehicle uploading to the cloud is independent of you querying.
There are definite sleep times. Sometimes you open the Rivian app and it indicates the car is sleeping and other times it doesn’t. The api also returns a sleep state when it’s sleeping. So there is a time (like Tesla) when the car is sleeping to reduce phantom drain. The algorithm on the Tesla is pretty well known now. Im trying to figure what Rivian is doing. So far it looks immature.
 

atlastracer

Well-Known Member
Joined
Sep 30, 2019
Threads
7
Messages
367
Reaction score
409
Location
BC, Canada
Vehicles
R1S LE, Honda Pilot
I will definitely miss my teslafi data when we get our Rivian (and sell the model 3). Maybe I'll need to put my $dayjob skills to work building my own rivianfi 😎
 

the_mace

Well-Known Member
First Name
Rob
Joined
Apr 8, 2022
Threads
10
Messages
368
Reaction score
304
Location
Boston, MA
Vehicles
Tesla Model S75D, Ford F350 Diesel, Mercedes GLC30
Occupation
CTO
After a few days of poking at it it seems the API has no impact on sleep. It does what it does regardless of passive API pokes. Active API pokes (wake, open frunk) are a different story but require you to take up one of 2 precious phone slots for API use for active commands due to the way they cryptographically sign those. They should allow more than 2 phones anyway.
 

atlastracer

Well-Known Member
Joined
Sep 30, 2019
Threads
7
Messages
367
Reaction score
409
Location
BC, Canada
Vehicles
R1S LE, Honda Pilot
After a few days of poking at it it seems the API has no impact on sleep. It does what it does regardless of passive API pokes. Active API pokes (wake, open frunk) are a different story but require you to take up one of 2 precious phone slots for API use for active commands due to the way they cryptographically sign those. They should allow more than 2 phones anyway.
Is that 2 phones per driver account or 2 phones per vehicle?
Sponsored

 
 




Top