Skip to content

Google Sheets Integration

Leonard Schüngel edited this page Dec 25, 2021 · 8 revisions

ACC Race Control can be connected to a Google Sheet spreadsheet to use as a central place to coordinate your stewards. It will automatically write any detected incidences to the spreadsheet to allow the stewards to review them.

For an example of this take a look at this race report from a 2x 30minute race with 40 drivers.
Example race report.

Credentials

To use the Google sheets integration you you will need to supply your own API Key. This step has to be done only once. The API Key should remain secret but you can share them with your team without a problem. To create your own, first follow the steps outlined here to create a Google Cloud Platform project. https://developers.google.com/workspace/guides/create-project

Once you have done that, you need to follow the next steps:

Creating the API is done in three steps:

A) Add the Google Sheets API to your project

  1. Open your project and navigate to "API & Services"-> Library
  2. Search for "Google Sheets API".
  3. Click on it and enable it.

B) Configure your OAuth consent screen.

  1. Navigate to "API's & Services" -> "OAuth consent screen.
  2. Select external and click create.
  3. Add an App name and an email adress and click continue.
  4. Click Add or remove scopes.
  5. Add the "See, edit create and delete spreadsheets" scope from the Google Sheets API. Save and continue through the rest.
  6. Navigate back to "API's & Services" -> "OAuth consent screen.
  7. Press the "Publish App" button in the "Pusblishing status" section to move your app into the "In production" state.

C) Create the API Key

  1. Navigate to "API & Services" -> "Credentials" -> "+Create Credentials" -> "OAuth client ID".
  2. Select Application type "Desktop app", give it a nice name and click create.
  3. Download the credentials file and place it into the "Google Sheets API Key" folder.
  4. Rename file to "credentials.json".

or watch this short video.

If you have any trouble with creating the API Key feel free to contact me under schuengel.leonard@gmail.com

Connecting to a spreadsheet

To connect to a spreadsheet first create a copy of the template..

Start ACC Race Control and navigate to the "Race Control" page and click the "Google Sheets API" button to open the configuration window. Copy the full URL of the spreadsheet you wish to use and paste it into the "Spreadsheet link" text field. Select your credentials file. If you placed your credentials into the "Google Sheets API Key" they should already be selected here.

Click connect.

Your default browser should open a new window and ask you to sign in with your google account. Confirm the messages and now ACC Race Control is connected to the spreadsheet. A new "Overview" tab will open in the configuration window. Click the "Send empty incident" button to send a test incident to the spreadsheet which will be placed in the current sheet target.

Race report template

You can find the template here
Create a copy of it into your own google drive to modify.

How to use

Sheet target

The tool is designed to target different sheets in the Spreadsheet depending on which session is taking place. During Practice and Qualifying any incidents will be sent to the Practice and Qualifying sheet respectively.
During the Race session the tool will count the number of race sessions, race one will be sent to "Race 1", the second to "Race 2" and the third to "Race 3" and so on.
The current spreadsheet and the targeted sheet is shown in the header. If the target sheet does not match the correct session you can manually change the target sheet in the configuration window in the "overview" tab.

Greenflag offset

The replay of a session will start before the actual session starts. That means the session time of an incident will be some offset away from the replay time. I call this the greenflag offset because it measures the time from the start of the replay to when the green flag is waved. Adding the greenflag offset to the session time will give you an approximated replay time accurate withing +-5 seconds.

Entry list

When Race Controll connects to the spreadsheet it will send an entrylist with the driver name and their car number.
During team races it will send the full name of each driver and their car number.
If a driver connects, their entry will be added to the list. Should a driver disconnect their entry will remain in the list.

Incident information

Race Controll will always report the time in the session when a incident occured.
Any additional information about an incident will vary depending on the type of the incident.

Collision incident

For a collision incidents Race Control will send a list of all the cars that were involved in the crash. It will add the lap number for each car in brackets behind the car number e.g. 513[13] & 123[14]. Car #513 and car #123 had a collision when car #513 was in lap 13 and #123 was in lap 14.
If a car has already finished the session it will show an [F] behind the car number. Because of limitations from the game, it is sometimes possible that multiple separate incidences will be combined into one. This happens mostly at the start of a race when there are lots of incidences in a short time frame.
It is also possible that not every car involved in an incident will be listed.

VSC incident

For virtual safety car incidents Race Control will send an incident to mark the start and the end of the VSC period. If a car triggers a VSC violation during that period it will be reported with the car number, the speed over the speed limit and the time spend over the speed limit e.g. 512 +15kmh +5.2s

Modifying the template or using your own spreadsheet

If you plan to use your own spreadsheet you are able to modify which cells the tool will write the incidents to. To do so, untick the "Use defaults" checkbox in the configuration window and modify the values to your needs.

The entry list will always be send to a sheet named entry list. The program will write a new entry into the first free line in the range B1:C500.

The greenflag offset will be send to the current target sheet into the specified cell.

An incident will be send to the current target sheet. The program will search the specified "Incident range" for the first free line. It will then write the session time to the specified "Session column" and the incident info to the specified "Incident info column".