Here's the format and conditions when importing tank monitor readings:


1. Go to System Manager, select Company Configuration menu. This will open the Company Configuration screen.

2. Navigate to Tank Management, Tank Monitor tab, click Interface Type.

3. Select Anova Gaslog.

4. Enter the details provided by customer, then click Save

  • Default - set to to true
  • API URL - URL used for sending credentials and getting tank information
  • Vendor Name - vendor username
  • Customer Name - customer name
  • API_KEY - vendor's unique key
  • Password - vendor password

Note: The Postman is used to check the data synced from API server to i21 Tank Management. This is used for testing purposes only and does not require to be installed in customer server.


Postman Credentials and Getting the Access Token to Retrieve Tank Information

1. Download and install Postman.

2. Open Postman, click "+" buttonGET New Request will be added on your tab.

3. On New Request tab, change the selection on dropdown menu to POST.

4. Enter the request URL

5. On New Request tab, navigate to Body tab. Select x-www-form-urlencoded, then enter the following details:

KEYVALUE
grant_typepassword
usernamevendor name set in Company Configuration > TM > Tank Monitor tab
passwordpassword set in Company Configuration > TM > Tank Monitor tab
client_idcustomer name set in Company Configuration > TM > Tank Monitor tab
client_secretAPI Key set in Company Configuration > TM > Tank Monitor tab


6. Click Send button. Response will be generated. 

Note: access_token change every send.


Retrieve the List of All Tanks

1. Click "+" button. GET New Request will be added on your tab.

2. Enter the request URL

3. Navigate to Authorization tab then select Bearer Token.

4. Copy the generated access_token from previous step response.

5. Enter it in the Token field, then click Send button.

6. Click Save Response > Save to a file

 7. Select path to save file, then click Save button. File will be saved as response.json.

Note: lastReportedDate change every day.
Details in generated response will be used in Clock reading, Customer creation, Device creation, and Consumption Site


The following should be setup/ready before the import:

1. Customer with Consumption Site - customer should have an existing consumption site. Customer Number is used as the mapping for customerAccount.

2. Devices - consumption site should have an attached devices. Device Tank Monitor Serial # (serialNumber) and Device Tank Serial # (customerTank) are paired with customer number where the combination is used as mapping for import. 

3. Clock Reading - a reading date entry should also exists in Clock Reading as this is being mapped as lastReportedDate.

The date should also not exist in Events tab of the Consumption Site.


FieldExamplei21 FieldNotes
deviceId618000Not Used


serialNumber7534188TM > Site > Device > Tank Monitor Serial #

Matching Hierarchy #1, this is the first to check.

  • Device Type = Tank Monitor
  • Device Serial # matches to file
  • Device Linked to a Site

If no match then try Matching Hierarchy #2.

customerAccount

12430655

TM > Site > Customer

Matching Hierarchy #2

  • Site with Customer # that Matches API > customerAccount
  • Device Linked to Site
  • Device Type = Tank
  • Device Serial # matches API > customerTank

If no match then give errors that no match was found.

customerNameJohn ClutterNot Used
customerTank1361978TM > Site > Device > Tank Serial #Part of Matching Hierarchy #2 see customerAccount
tankSize500NAShould already be setup on TM Site > Tank Device
addressHoward StreetNot Used
townCowenNot Used
stateWVNot Used
postcode26206Not Used
latitude38.4132843TM > Site > LatitudeUsed to Update TM Site if there is no existing value
longitude-80.5601714TM > Site > LongitudeUsed to Update TM Site if there is no existing value
lastReportedDate08/23/2021 06:39:00TM > Site > Reading Event > Event DateWill ignore adding duplicate readings
lastReportedLevel66

TM > Site > Estimated % Left

TM > Site > Estimated Gallons Left


Use Estimated % Left x TM Site > Total Capacity to get Estimated Gallons Left

lastDeliveryDate03/04/2021 14:52:00Not Used
tankTypeHorizontal TankNot Used
dailyUsage0.0Not Used

Sample JSON with 2 records:

[
    {
        "deviceId""618000",
        "serialNumber""7534188",
        "customerAccount""12430655",
        "customerName""John Clutter",
        "customerTank""1361978",
        "tankSize""500",
        "address""Howard Street",
        "town""Cowen",
        "state""WV",
        "postcode""26206",
        "latitude""38.4132843",
        "longitude""-80.5601714",
        "lastReportedDate""10/04/2021 06:39:00",
        "lastReportedLevel""65",
        "lastDeliveryDate""03/04/2021 14:52:00",
        "tankType""Horizontal Tank",
        "dailyUsage"0.028571
    },
    {
        "deviceId""618001",
        "serialNumber""7542459",
        "customerAccount""63150005",
        "customerName""RDR Energy Resources Inc.",
        "customerTank""Concrete Plant",
        "tankSize""2005",
        "address""411 Sycamore Street",
        "town""Clarksburg",
        "state""WV",
        "postcode""26301",
        "latitude""39.2861121",
        "longitude""-80.3520409",
        "lastReportedDate""10/03/2021 15:37:00",
        "lastReportedLevel""54",
        "lastDeliveryDate""10/01/2021 15:00:00",
        "tankType""Diesel",
        "dailyUsage"13.54483
    }

]


1. On the Menu panel, click the Tank Monitor menu. This will open the Import Tank Monitor Readings screen. Default format is Anova Gaslog.

2. Click Import toolbar button. The message below will display indicating that the importing is in progress.

3. Once the import is completed, a message will display based on the import status.

  • When Import is successful, this message below will display.

  • Show records imported successfully in Logs. Detail includes: Record 1 (ESN, Customer Number, Site ID, Date and Status)

  • On Consumption Site's Details tab, Estimated Gallons Left will update.

  • On Consumption Site's Events tab, Devices Installed and Tank Monitor Reading will reflect.


  • When Import is not fully successful, this message below will display.

  • Log screen will display. This includes successful and unsuccessful imports.

  • When Import is NOT successful

  • Log screen will display.
    • Unsuccessful Imports will display:
      • ESN - serial number
      • Date - date of import
      • Status - Reason why it failed 
    • Failed Reasons includes:
      • No customer site
      • Device not found
      • No clock reading


  • No labels