HomeGuidesAPI ReferenceChangelog
Log In
Guides

Step 3: Load Solar Production and Calculate Solar Costs

Create or update an actual solar production profile, then calculate solar costs for the historical savings workflow.

Create or update an actual solar production profile, then calculate solar costs for the historical savings workflow.

Solar cost workflow

  1. Create an actual solar production profile for the account.
  2. Use actual-savings-example-solar as the providerProfileId for the solar production profile.
  3. Periodically add new solar production readings as they become available.
  4. Run an Account Cost Calculation for each billing period using the customer’s solar tariff.
  5. Save the calculated solar cost for use in Step 4.

Create a solar profile for actual solar production

Create a solar profile that stores actual solar production in kWh for each hour from your solar data acquisition system. When you create this profile, you can load all the historical solar production you have at the same time. Use this example to add a solar profile with hourly solar production data. Include a systemSize property in the request so it can be used for tariff rates based on system size.

POST /rest/v1/profiles
{  
  "providerAccountId" : "actual-savings-example",  
  "providerProfileId" : "actual-savings-example-solar",  
  "profileName" : "Solar System Actual Production",  
  "serviceTypes" : "SOLAR_PV",  
  "sourceId" : "ReadingEntry",  
  "properties" : {  
    "systemSize" : {  
      "keyName" : "systemSize",  
      "dataValue" : "5"  
    }
  },  
  "readingData" : [  
      { "fromDateTime" : "2015-06-01T09:00-0700",  
        "quantityUnit" : "kWh",  
        "quantityValue" : "2.15",  
        "toDateTime" : "2015-06-01T10:00-0700"  
      },  
      { "fromDateTime" : "2015-06-01T10:00-0700",  
        "quantityUnit" : "kWh",  
        "quantityValue" : "3.64",  
        "toDateTime" : "2015-06-01T11:00-0700"  
      },  
      { "fromDateTime" : "2015-06-01T11:00-0700",  
        "quantityUnit" : "kWh",  
        "quantityValue" : "4.98",  
        "toDateTime" : "2015-06-01T12:00-0700"  
      },  
      { "fromDateTime" : "2015-06-01T12:00-0700",  
        "quantityUnit" : "kWh",  
        "quantityValue" : "5.67",  
        "toDateTime" : "2015-06-01T13:00-0700"  
      },  
      { "fromDateTime" : "2015-06-01T13:00-0700",  
        "quantityUnit" : "kWh",  
        "quantityValue" : "5.13",  
        "toDateTime" : "2015-06-01T14:00-0700"  
      },  
      { "fromDateTime" : "2015-06-01T14:00-0700",  
        "quantityUnit" : "kWh",  
        "quantityValue" : "5.96",  
        "toDateTime" : "2015-06-01T15:00-0700"  
      },  
      { "fromDateTime" : "2015-06-01T15:00-0700",  
        "quantityUnit" : "kWh",  
        "quantityValue" : "4.32",  
        "toDateTime" : "2015-06-01T16:00-0700"  
      },  
      { "fromDateTime" : "2015-06-01T16:00-0700",  
        "quantityUnit" : "kWh",  
        "quantityValue" : "1.02",  
        "toDateTime" : "2015-06-01T17:00-0700"  
      }
  ]
}

After you create the solar profile, save the returned profileId. You will use it to calculate the solar cost in this step and the bill without solar cost in Step 4. To retrieve profile IDs later, run:

GET /rest/v1/profiles?accountId={accountId}

Read Upload a Solar Production Profile with Readings and Get Profiles for more information.

Periodically add new production readings to this solar profile

Update this solar profile with additional solar readings either in real time or periodically, such as every day or month. Use this example request:

PUT /rest/v1/profiles/{profileId}/readings
{  
  "usageProfileId": "{profileId}",  
  "readings" : [ {  
    "fromDateTime" : "2015-06-02T09:00-0700",  
    "toDateTime" : "2015-06-02T10:00-0700",  
    "quantityUnit" : "kWh",  
    "quantityValue" : 1.76  
  },{  
    "fromDateTime" : "2015-06-02T10:00-0700",  
    "toDateTime" : "2015-06-02T11:00-0700",  
    "quantityUnit" : "kWh",  
    "quantityValue" : 2.74  
  },{  
    "fromDateTime" : "2015-06-02T11:00-0700",  
    "toDateTime" : "2015-06-02T12:00-0700",  
    "quantityUnit" : "kWh",  
    "quantityValue" : 3.92  
  },{  
    "fromDateTime" : "2015-06-02T12:00-0700",  
    "toDateTime" : "2015-06-02T13:00-0700",  
    "quantityUnit" : "kWh",  
    "quantityValue" : 4.35  
  },{  
    "fromDateTime" : "2015-06-02T13:00-0700",  
    "toDateTime" : "2015-06-02T14:00-0700",  
    "quantityUnit" : "kWh",  
    "quantityValue" : 5.26  
  },{  
    "fromDateTime" : "2015-06-02T14:00-0700",  
    "toDateTime" : "2015-06-02T15:00-0700",  
    "quantityUnit" : "kWh",  
    "quantityValue" : 5.03  
  },{  
    "fromDateTime" : "2015-06-02T15:00-0700",  
    "toDateTime" : "2015-06-02T16:00-0700",  
    "quantityUnit" : "kWh",  
    "quantityValue" : 4.82  
  },{  
    "fromDateTime" : "2015-06-02T16:00-0700",  
    "toDateTime" : "2015-06-02T17:00-0700",  
    "quantityUnit" : "kWh",  
    "quantityValue" : 1.93  
  },{  
    "fromDateTime" : "2015-06-02T17:00-0700",  
    "toDateTime" : "2015-06-02T18:00-0700",  
    "quantityUnit" : "kWh",  
    "quantityValue" : 3.49  
  }
  ]  
}

Read Update Readings for more information.

Calculate the solar cost

Calculate the cost of the solar production using the customer’s solar tariff. Use this sample request to calculate the solar cost for a billing period:

POST /rest/v1/accounts/pid/actual-savings-example/calculate/
{  
   "fromDateTime":"2015-07-20T00:00-0700",  
   "toDateTime":"2015-08-19T00:00-0700",  
   "serviceType":"SOLAR_PV",  
   "masterTariffId": "{masterTariffId of solar tariff}",  
   "profileId": "{profileId of solar profile}",  
   "billingPeriod": true,  
   "minimums": false,  
   "groupBy":"MONTH",  
   "detailLevel":"CHARGE_TYPE"  
}

Read Account Cost Calculation for more information.

Summary

Previously, you loaded electricity usage data and calculated electricity costs. In this step, you loaded actual solar production and calculated solar costs.

Next, determine what the customer would have paid without solar and calculate actual savings.