solar-solution-js-sdk
TypeScript icon, indicating that this package has built-in type declarations

3.3.2 • Public • Published

EagleView Solar Solution SDK for Javascript [OFFICIAL]

An OFFICIAL Javascript SDK for integrating with EagleView Solar Solution for TrueDesign. Tested with nodejs v16.14.2

Introduction

Solar Solution SDK V3.3.2 has been developed to facilitate the integration of customer workflows with Eagleview's TrueDesign V2.1 Solar Product. The integration effort, that includes the time required to authenticate, place an order, check the order status and loading the TrueDesign UI is simplified by means of a simple API as a package. This SDK provides a JavaScript API for Eagleview services.

Version History

  • V3.3.2 - This is the official version of the Solar Solution SDK and it includes the following functionalities

    • Added PdfConfiguration option for TrueDesign pdf in "getDeliverableApi" for TrueDesign Pdf.
  • V3.3.1 - This is the official version of the Solar Solution SDK and it includes the following functionalities

    • Removed weatherData attribute from PVWatts presets.
  • V3.3.0 - This is the official version of the Solar Solution SDK and it includes the following functionalities

    • Added one new deliverable (Essentials+ PDF) in getDeliverable function.
    • Added one more option (alignment) in maxlayout function.
    • Added two new attributes in design preset i.e. initialAlignment and initialOrientation. Need to add them in "getDesignPresetBody" function.
  • V3.2.0 - This is the official version of the Solar Solution SDK and it includes the following functionalities

    • Added API to get topview Image, system details and monthly production in single call.
    • Added API to close the report.
  • V3.1.2 - This is the official version of the Solar Solution SDK and it includes the following functionalities

    • Package dependency cleanup - moved typescript and eslint packages to devdependencies
  • V3.1.1 - This is the official version of the Solar Solution SDK and it includes the following functionalities

    • Added API to create copy of an existing version
    • Added Design and Perspective options to SystemImage API.
  • V3.1.0 - This is the official version of the Solar Solution SDK and it includes the following functionalities

    • Added environment manager, now onwards we don't need to put .env file in directory.
    • Added Get Order Status to get status and sub-status of order.
  • V3.0.0 - This is the official version of the Solar Solution SDK and it includes the following functionalities

    • Change in authentication process, going forward 3 Legged Authentication is the only one needed for both Order Workflow and TrueDesign.
    • Now onwards only 1 creds we need for both order placing APIs and truedesign.
    • added API to get refresh token using one time code.
    • removed support for TD 1.0 completely, as we are moving towards TD 2.0 (a better experience).
  • V2.1.0 - This is the official version of the Solar Solution SDK and it includes the following functionalities

    • Chnage in Update Filter Function :- Now you can set multiple filter at a time with priority.
    • Delete Version in a TrueDesign report.
    • Update energy generation based on Report ID, Version ID, Pattern and Structure
    • Get system Roof details based on report ID.
    • Update Roof Details (disable/enable) for given version.
  • V2.0.0 - This is the official version of the Solar Solution SDK for TrueDesign 2.0 and it the following functionalities are updated

    • Initialisation and authentication of SDK user
    • TrueDesign Init for TDViewer Roles
    • Embedded Script for accessing TrueDesign UI
    • TrueDesign deliverable downloads (DXF, JSON, PDF)
    • TrueDesign TopView Image URL
    • TrueDesign System Details in PDF or JSON format
    • Version Dictionary for TrueDesign Report
    • Update Filter for a TrueDesign Report
    • Save Model in a TrueDesign Order
    • Create a new Version in a TrueDesign Order
    • Rename a Version in a TrueDesign Order
    • Delete a Version in a TruDesign Order
    • Get the presets for a TrueDesign Order
    • Update Custom presets for a TrueDesign Order
    • Get monthly AC production for a TrueDesign Order
  • V1.0.0 - This is the official version of the Solar Solution SDK and it includes the following functionalities

    • Initialization of SDK (With Authentication and Authorization)
    • Place Order with Custom Presets for Solar Products with product availability check
    • Fetch Order Status to monitor Order completion
    • Generate iFrame URL for accessing TrueDesign UI
    • Order Delegation for a client to place order on behalf of their customers
    • Download TrueDesign Deliverables of order placed
    • Place Order upgradation to previous placed order
  • V0.0.1 - This is the first version of the Solar Solution SDK and it includes the following functionalities

    • Initialization of SDK (With Authentication and Authorization)
    • Place Order with Custom Presets for Solar Products with product availability check
    • Fetch Order Status to monitor Order completion
    • Generate iFrame URL for accessing TrueDesign UI

Installation

Install from github:

$ npm i solar-solution-js-sdk

The SDK exports the following sub-packages:

  • Order
  • TrueDesign

Additionally, the base package exports some configuration and some Examples.

Usage

Prerequisite

For accessing the SDK features the following is required.

a. Username and Password for an EagleView account [Obtained by creation of account on EagleView US ]

b. Client authorisation credentials [Generated specifically for each customer per role]

Initializing the SDK

The SDK requires environmental variables and configuration parameters for initialisation and authentication. A .env file will be provided by EagleView with url variables and this needs to be included in the client environment. The function newContext() is called to Initialise the sub packages like Order and TrueDesign with the user’s configuration parameters. On successful authentication and authorisation, the required API calls can be made.

The list of parameters are as below:

  • clientId ClientID you ll get from api center
  • clientSecret ClientSecret you ll get from api center
  • refreshToken Refresh token you ll get from token generation API, or a function also provided in this SDK
  • logger Optional - Logging target for verbose SDK logging. This will help get the logs from SDK in your own logging console

Here's an example:

import {Order, ReportAddresses, PlaceOrder, PRODUCTS} from 'solar-solution-js-sdk'

const config = {
    clientId: "<clientId>",
    clientSecret: "<clientSecret>",
    refreshToken: "<refresh_token>",
}

const initializeSDK = async () => {
    const order = new Order(config)
    const resp = await order.newContext();
    if (resp.responseCode != 200) {
        logger.error("Error while initializing Context: " + resp.message)
    } else {
        logger.info("Context initialized successfully!")
    }

Making API calls

Each Solar SDK API takes in a request type and returns a response type. The typical pattern for making API calls is:

  • Instantiate the argument via the New* convenience functions in the SDK
  • Invoke the API
  • Process the response (or handle error, as below)

Place Order:

This function [placeOrderAPI] allows you to place an order with Eagleview


import {Order, ReportAddresses, PlaceOrder, PRODUCTS} from 'solar-solution-js-sdk'

const config = {
    clientId: "<clientId>",
    clientSecret: "<clientSecret>",
    refreshToken: "<refresh_token>",
}

const placeOrderFn = async () => {
    const order = new Order(config)
    const resp = await order.newContext();
    if (resp.responseCode != 200) {
        logger.error("Error while initializing Context: " + resp.message)
        return
    } else {
        logger.info("Context initialized successfully!")
    }

    // Function to form ReportAddress json
	const [reportAddress, error] = order.newSetReportByAddress(<address>, <city>, <state>, <zip>, <country>)
	if (error != "") {
        logger.error("Error while placing order: " + error)
        return
	}
	var reportAddressArray :ReportAddresses[] = []
	reportAddressArray.push(reportAddress)
	const primaryProductId = PRODUCTS.TRUE_DESIGN_FOR_SALES
    const buildingId = "House"
    const deliveryProductId = 8
    const measurementInstructionType = 1
    const changesInLast4Years = false

    // Function to form PlaceOrder json
	const [placeOrderBody, error2] = order.newSetReportPlaceOrder(reportAddressArray, buildingId, primaryProductId, deliveryProductId, [], 
                        measurementInstructionType, changesInLast4Years, "", undefined, undefined)
	if (error2 != "")  {
        logger.error("Error during set Report address. " + error2)
        return
	}

    // More than one orders can be created and it should be pushed to the below array
	var placeOrderBodyArray : PlaceOrder[] = []
	placeOrderBodyArray.push(placeOrderBody)

	const [resp, error3] = await order.placeOrderAPI(placeOrderBodyArray)
	if (error3 != "") {
        logger.error("Error during Place order :  " + error3)
        return []
	}
    logger.info("Place order returned successfully : " + JSON.stringify(resp.ReportIds))
	return resp.ReportIds
}

The helper functions used to create the request body are in Appendix - I

Successful creation of an order will return

{
    "OrderId"      : number;
    "ReportIds"    : number[];
    "ResponseCode" : number;
}

PlaceOrder attributes Input body: Placing an order requires the following PlaceOrder object

{
  "OrderReports": [
      {
        "ReportAddresses": [
            {
              "Address": <address>, (string)
              "City": <city>, (string)
              "State": <state>, (string)
              "Zip": <zip>, (string)
              "Country": <country>, (string)
              "Latitude": <latitude>, //Either LatLong or Address needs to be sent (float)
              "Lattude": <longitude>, (float)
              "AddressType": <addresstype> (int)
            }
        ],
        "BuildingId": <buildingid> (string)
        "PrimaryProductId": <primaryproductid>, (int)
        "DeliveryProductId": <deliveryproductid>, (int)
        "AddOnProductIds": <addonproductids> ([]int)
        "MeasurementInstructionType": <measurementinstructiontype>, (int)
        "ChangesInLast4Years": <changesinlast4years> (bool)
        "Comments: <comments> (string)
        "UpgradeFromReportId": <upgradefromreportid> (number)
        "PresetPreference": <presetpreference> (PresetPreference Object)
      }
  ]
}

In case preset preferences need to be added, you can use Preset Data or Preset Custom Attributes

"presetData": {
	"design"  : number;
	"panel"   : number;
	"setBack" : number;
	"pvWatts" : number;
}

//All 26 attributes need to be added if custom attributes are added
"PresetCustomAttributes": [
    {
        "AttributeId":35,
        "AttributeValue":"2"
    }
]

All the preset custom attributes and their ranges are in Appendix - I

Fetch Order:

This function [fetchOrderApi] is used to check the status of the order placed. Currently, a user can only check the status of the orders they have placed. The code snippet below illustrates the use of fetchOrder function

import {Order} from 'solar-solution-js-sdk'

const config = {
    clientId: "<clientId>",
    clientSecret: "<clientSecret>",
    refreshToken: "<refresh_token>",
}

const fetchOrderFn = async () => {
    const order = new Order(config)
    const resp = await order.newContext();
    if (resp.responseCode != 200) {
        logger.error("Error while initializing Context: " + resp.message)
        return
    } else {
        logger.info("Context initialized successfully!")
    }

	const [fetchOrderStatus, error] = await order.fetchOrderApi(reportId.toString())
	if (error != "") {
		logger.error ("Fetch order failed with error : " + error)
        return
	}
    logger.info("Fetch order returned status : " + fetchOrderStatus.Status)
}

Successful execution of this function will return

{
    ReportId         : number;
	Status           : string;
	ProductPrimaryId : number;
	SubStatus        : string;
	ResponseCode     : number;
}

Get Order Status:

This function [getOrderStatusApi] is used to get the status and sub-status of the order placed. Currently, this function is diff from fetchOrderApi func as this only provides you status and sub status as strings instead of complete response.

import {Order} from 'solar-solution-js-sdk'

const config = {
    clientId: "<clientId>",
    clientSecret: "<clientSecret>",
    refreshToken: "<refresh_token>",
}

const SuccessGetOrderStatus = async (reportId : number) => {

    const order = new Order(successConfig)
    const res = await order.newContext();
    if (res.responseCode != 200) {
        logger.error("-----------------Error while initializing Context: " + res.message + "-----------------")
        return
    } else {
        logger.info("-----------------Context initialized successfully-----------------------")
    }

	const [status, substatus, error] = await order.getOrderStatusApi(reportId.toString())
	if (error != "") {
		logger.error ("-----------------" + error + "-----------------")
        return
	}
    logger.info("-----------------Fetch order returned status : " + status + " and substatus " + substatus + "-----------------")
	return
}

Successful execution of this function will return status and sub-status or order as string.

Place Upgrade Order:

This function [placeUpgradeOrderApi] allows Customers to place upgrade order on reports that have already been placed. This function also validates if the order upgrade from current product to new product is supported before placing upgrade order

import {Order} from 'solar-solution-js-sdk'

const config = {
    clientId: "<clientId>",
    clientSecret: "<clientSecret>",
    refreshToken: "<refresh_token>",
}

const PlaceUpgradeOrderFn = async (reportId : number, productId : number) => {
    const order = new Order(successConfig)
    const res = await order.newContext();
    if (res.responseCode != 200) {
        logger.error("-----------------Error while initializing Context: " + res.message + "-----------------")
        return
    } else {
        logger.info("-----------------Context initialized successfully-----------------------")
    }

    var placeUpgradeOrder : PlaceUpgradeOrder = {
        ReportId : reportId,
        MeasurementRequestTypeId : 1,
        ProductId : productId,
        ProductDeliveryId : DELIVERYPRODUCTS.REGULAR_DELIVERY,
    }

	const [newReportId, error] = await order.placeUpgradeOrderApi(placeUpgradeOrder)
	if (error != "") {
		logger.error ("-----------------" + error + "-----------------")
        return
	}
    logger.info("-----------------Place Upgrade order returned reportId : " + newReportId + "-----------------")
	return
}

Successful execution of this function will return a new reportId of the upgraded product

Order Delegation:

This function [orderDelegationApi] allows Customers to place order on behalf of their Customers. This is a one time authorisation that the customer provides to clients for placing order on their behalf.

import {Order} from 'solar-solution-js-sdk'

const config = {
    clientId: "<clientId>",
    clientSecret: "<clientSecret>",
    refreshToken: "<refresh_token>",
}

// Username and password of Customer who wants to delegate to client with credentials
const orderDelegationConfig = {
    username : "<username>",
    password :  "<password>"
}
const OrderDelegationFn = async () => {
    const order = new Order(successConfig)
    const res = await order.newContext();
    if (res.responseCode != 200) {
        logger.error("-----------------Error while initializing Context: " + res.message + "-----------------")
        return
    } else {
        logger.info("-----------------Context initialized successfully-----------------------")
    }

	const status = await order.orderDelegationApi(orderDelegationConfig.username, orderDelegationConfig.password)
	if (status != "Success") {
		logger.error ("-----------------" + status + "-----------------")
        return
	}
    logger.info("-----------------Order Delegation returned status : " + status + "-----------------")
	return
}

Successful execution of this function will return a success response

Embedded Script for accessing TrueDesign UI:

In TrueDesign V2.0, we will be supporting embedding TD UI to Integration partner UI instead of iFrame as in the previous version. The below example html has the details on the script that needs to be included in the Integration partner UI. This example also shows how Save operation can be triggered from enclosing page (client to client)

This page on load will require 2 inputs dynamically.

ReportId to be set as shown in line 47.

The token got from Token API should be added to local cache in the below format.

key -> ‘truedesigntoken' / 'token’

value → {“access_token”:“”}

<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="utf-8" />
    <title>EV - Solar View Beta</title>
    <meta name="viewport" content="width=device-width, initial-scale=1" />
  <body>
    <button type="button" onclick="saveSdkVersion()">Save Version</button>
    <script>
        function saveSdkVersion() {
            const saveButtonElement = document.getElementById("sdk-save-trigger")
            saveButtonElement.click()
        }
    </script>
    <script>
        const fileLink = "https://solar-api.eagleview.com/"
        fetch(fileLink + '/asset-manifest.json').then(async (data) => {
        const assets = await data.json();
        if (assets) {
            const getJsEntryPoints = (num) => {
                if(num < assets.entrypoints.length){
                    if(assets.entrypoints[num].includes('.js')){
                            var script = document.createElement('script');
                            script.type = 'text/javascript';
                            script.src = fileLink + '/' + assets.entrypoints[num]
                            document.body.appendChild(script);
                            getJsEntryPoints(num + 1)
                    }
                    else{
                            var head = document.getElementsByTagName('head')[0];
                            var link = document.createElement('link');
                            link.rel = 'stylesheet';
                            link.type = 'text/css';
                            link.media = 'all';
                            link.src = fileLink + '/' + assets.entrypoints[num]
                            head.appendChild(link)
                            getJsEntryPoints(num + 1)
                    }
                }
            }
            getJsEntryPoints(0)
        }
        });
    </script>
    <script>
    const truedesign = document.createElement("truedesign-editor");
    truedesign.reportId = "<ReportID>";
    document.body.append(truedesign)
    </script>
  </body>
</html>

TrueDesign Download Deliverables:

This function [getDeliverableApi] fetches the download link to the final deliverable in one of the below formats: PDF, DWG or JSON. This function is explicit for TrueDesign deliverable download

import {TrueDesign} from 'solar-solution-js-sdk'

const config = {
    clientId: "<clientId>",
    clientSecret: "<clientSecret>",
    refreshToken: "<refresh_token>",
}

const DownloadDeliverableFn = async (reportId : string) => {
    const td = new TrueDesign(successConfig)
    const res = await td.newContext();
    if (res.responseCode != 200) {
        logger.error("-----------------Error while initializing Context: " + res.message + "-----------------")
        return
    } else {
        logger.info("-----------------Context initialized successfully-----------------")
    }

	const [link1, error1] = await td.getDeliverableApi(reportId, FILEFORMAT.PDF)
	if (error1 != "") {
		logger.error ("-----------------" + error1 + "-----------------")
        return
    }
    logger.info("-----------------DownloadUrl returned file link : " + link1 + "-----------------")
	const [link2, error2] = await td.getDeliverableApi(reportId, FILEFORMAT.DXF, versionId)
	if (error2 != "") {
		logger.error ("-----------------" + error2 + "-----------------")
        return
    }
    logger.info("-----------------DownloadUrl returned file link : " + link2 + "-----------------")
	const [link3, error3] = await td.getDeliverableApi(reportId, FILEFORMAT.JSON, versionId)
	if (error3 != "") {
		logger.error ("-----------------" + error3 + "-----------------")
        return
    }
    logger.info("-----------------DownloadUrl returned file link : " + link3 + "-----------------")
    const [link4, error4] = await td.getDeliverableApi(reportId, FILEFORMAT.RADIANCE_FILES, versionId)
	if (error4 != "") {
		logger.error ("-----------------" + error4 + "-----------------")
        return
    }
    logger.info("-----------------DownloadUrl returned file link : " + link4 + "-----------------")
    const [link6, error6] = await td.getDeliverableApi(reportId, FILEFORMAT.ESSENTIALPLUS, versionId)
	if (error6 != "") {
		logger.error ("-----------------" + error6 + "-----------------")
        return
    }
    logger.info("-----------------DownloadUrl returned file link : " + link6 + "-----------------")
    //Configuration for FILEFORMAT.PDF only .Allows user to download selected section of pdf.
    const pdfConfiguration=[PDFCONFIGURATION.AERIALIMAGERY,PDFCONFIGURATION.TRUEDESIGNRESULT]
    const [link7, error7] = await td.getDeliverableApi(reportId, FILEFORMAT.PDF,versionId,pdfConfiguration)
	if (error7 != "") {
        logger.error ("-----------------" + error7 + "-----------------")
        return
    }
    logger.info("-----------------DownloadUrl returned file link : " + link7 + "-----------------")
	return

}

Successful execution of this function will return a file download link

TrueDesign Init for TDViewer Roles:

In TrueDesign V2.0 the concept of Session has been completely removed. All requests are only based on ReportId.

This function [init] allows Customers to set Custom scope, Feature Flag, Default version and Versions to hide for a given report ID. This API is optional. This has to be called only if you have any of these options to set.

import {TrueDesign} from 'solar-solution-js-sdk'

const config = {
    clientId: "<clientId>",
    clientSecret: "<clientSecret>",
    refreshToken: "<refresh_token>",
}

const SuccessInit = async (reportId : string) => {
    const td = new TrueDesign(successConfig)
    const res = await td.newContext();
    if (res.responseCode != 200) {
        logger.error("-----------------Error while initializing Context: " + res.message + "-----------------")
        return
    } else {
        logger.info("-----------------Context initialized successfully-----------------")
    }

    const customScope : number[] = [CUSTOMSCOPE.TDEDIT_CANVAS, CUSTOMSCOPE.TDEDIT_FACETDETAILS, CUSTOMSCOPE.TDEDIT_SYSTEMDETAILS]
    const featureConfig : number[] = [FEATURECONFIG.TDALLOW_PANELSTATE, FEATURECONFIG.TDHIDE_ONLINEREPORT, FEATURECONFIG.TDHIDE_DOWNLOADTAB]
    const defaultVersion : string = "358a53db-8abd-4063-9302-1f43f2d91045"
    const hideVersions : string[] = ["ae1768d8-e691-4e4f-a66b-116f8acf62e3", "70938c36-e10a-4557-9093-5662887ff0a5"]

	const [token1, data1, error1] = await td.init(reportId, customScope, featureConfig, defaultVersion, hideVersions)
	if (error1 != "") {
		logger.error ("-----------------" + error1 + "-----------------")
        return
    }
    logger.info("-----------------Init API returned : " + data1 + "-----------------")

    const [token2, data2, error2] = await td.init(reportId, undefined, undefined, defaultVersion, hideVersions)
	if (error2 != "") {
		logger.error ("-----------------" + error2 + "-----------------")
        return
    }
    logger.info("-----------------Init API returned : " + data2 + "-----------------")
	return
}

Successful execution of this function will return a success response

TrueDesign TopView Image URL:

This function [getTopViewImageUrl] allows Customers to retrieve a URL for the topView image for a given ReportId and VersionId. Also now we can get oblique images with or without panel info using this API

import {TrueDesign} from 'solar-solution-js-sdk'

const config = {
    clientId: "<clientId>",
    clientSecret: "<clientSecret>",
    refreshToken: "<refresh_token>",
}

const SuccessTopViewImage = async (reportId : string, versionID : string) => {
    const td = new TrueDesign(successConfig)
    const res = await td.newContext();
    if (res.responseCode != 200) {
        logger.error("-----------------Error while initializing Context: " + res.message + "-----------------")
        return
    } else {
        logger.info("-----------------Context initialized successfully-----------------")
    }

	const [link1, error1] = await td.getTopViewImageUrl(reportId)
	if (error1 != "") {
		logger.error ("-----------------" + error1 + "-----------------")
        return
    }
    logger.info("-----------------SystemImage returned : " + link1 + "-----------------")

    const [link2, error2] = await td.getTopViewImageUrl(reportId, versionID)
	if (error2 != "") {
		logger.error ("-----------------" + error2 + "-----------------")
        return
    }
    logger.info("-----------------SystemImage returned : " + link2 + "-----------------")

    // Default values for design is yes and perspective is ortho, in case they are not given by user
    const [map1, error3] = await td.getTopViewImageUrl(reportId, versionID, SYSTEMIMAGE_DESIGN.NO, SYSTEMIMAGE_PERSPECTIVE.ALL)
	if (error3 != "") {
		logger.error ("-----------------" + error3 + "-----------------")
        return
    }
    logger.info("-----------------SystemImage returned : " + JSON.stringify(map1) + "-----------------")

    const [map2, error4] = await td.getTopViewImageUrl(reportId, undefined, SYSTEMIMAGE_DESIGN.YES, SYSTEMIMAGE_PERSPECTIVE.ALL)
	if (error2 != "") {
		logger.error ("-----------------" + error4 + "-----------------")
        return
    }
    logger.info("-----------------SystemImage returned : " + JSON.stringify(map2) + "-----------------")
	return
}

Successful execution of this function will return a Image URLs and success response

TrueDesign Get System Details:

This function [getSystemDetails] allows Customers to retrieve a the system details for a given reportId and optionally versionId. Additionally, they can specify the active version and the response format (RESPONSEFORMAT.PDF, RESPONSEFORMAT.JSON) of the data retrieved

import {TrueDesign} from 'solar-solution-js-sdk'

const config = {
    clientId: "<clientId>",
    clientSecret: "<clientSecret>",
    refreshToken: "<refresh_token>",
}

const SuccessSystemDetails = async (reportId : string, versionID : string) => {
    const td = new TrueDesign(successConfig)
    const res = await td.newContext();
    if (res.responseCode != 200) {
        logger.error("-----------------Error while initializing Context: " + res.message + "-----------------")
        return
    } else {
        logger.info("-----------------Context initialized successfully-----------------")
    }

	const [data1, error1] = await td.getSystemDetails(reportId, versionID, respFormat)
	if (error1 != "") {
		logger.error ("-----------------" + error1 + "-----------------")
        return
    }
    logger.info("-----------------System Details: " + data1 + "-----------------")

    const [data2, error2] = await td.getSystemDetails(reportId, undefined, respFormat)
	if (error2 != "") {
		logger.error ("-----------------" + error2 + "-----------------")
        return
    }
    logger.info("-----------------System Details : " + data2 + "-----------------")

	return
}

Successful execution of this function will return a system details in the specified format and success response

TrueDesign Version Dictionary:

This function [getVersionDictionary] allows Customers to retrieve a the version dictionary (list of version IDs and their corresponding names) for a given reportId.

import {TrueDesign} from 'solar-solution-js-sdk'

const config = {
    clientId: "<clientId>",
    clientSecret: "<clientSecret>",
    refreshToken: "<refresh_token>",
}

const SuccessVersionDictionary = async (reportId : string) => {
    const td = new TrueDesign(successConfig)
    const res = await td.newContext();
    if (res.responseCode != 200) {
        logger.error("-----------------Error while initializing Context: " + res.message + "-----------------")
        return ""
    } else {
        logger.info("-----------------Context initialized successfully-----------------")
    }

    const [dictionary, error] = await td.getVersionDictionary(reportId)
	if (error != "") {
		logger.error ("-----------------" + error + "-----------------")
        return ""
    }
    logger.info("-----------------Get version dictionary returned : " + dictionary + "-----------------")
	return dictionary
}

Successful execution of this function will return the version Dictionary and success response

TrueDesign Update Filter:

This function [updateFilter] allows Customers to update the filter values (MIN_TSRF, MODULES, DC_SIZE, KWH_PRODUCTION) and in addition (ACTIVE or PASSIVE) count for tiles, for for a given reportId and optionally versionId.

import {TrueDesign} from 'solar-solution-js-sdk'

const config = {
    clientId: "<clientId>",
    clientSecret: "<clientSecret>",
    refreshToken: "<refresh_token>",
}

const SuccessSetMultiFilter = async (reportId : string, versionId: string) => {
    const td = new TrueDesign(successConfig)
    const res = await td.newContext();
    if (res.responseCode != 200) {
        logger.error("-----------------Error while initializing Context: " + res.message + "-----------------")
        return ""
    } else {
        logger.info("-----------------Context initialized successfully-----------------")
    }

    var filterMap = new Map<string, number>();
    filterMap.set(FILTERFIELDS.TSRF, 70)
    filterMap.set(FILTERFIELDS.KWH_PRODUCTION, 15000)
    const [filterResponse, error] = await td.setMultiFilter(reportId, filterMap, versionId)
	if (error != "") {
		logger.error ("-----------------" + error + "-----------------")
        return ""
    }
    logger.info("-----------------Update filter returned : " + JSON.stringify(filterResponse) + "-----------------")
	return filterResponse
}

Successful execution of this function will update the filter for the given reportId and success response

TrueDesign Save Model:

In TrueDesign V2.0 Save operation can be triggered from enclosing page (client to client). The example is part of section Embedded Script for accessing TrueDesign UI

TrueDesign Create Version This function [createVersion] allows Customers to create a new version for a report order

import {TrueDesign} from 'solar-solution-js-sdk'

const config = {
    clientId: "<clientId>",
    clientSecret: "<clientSecret>",
    refreshToken: "<refresh_token>",
}

const SuccessCreateVersion = async (reportId : string, versionName : string, moduleType : string) => {
    const td = new TrueDesign(successConfig)
    const res = await td.newContext();
    if (res.responseCode != 200) {
        logger.error("-----------------Error while initializing Context: " + res.message + "-----------------")
        return ""
    } else {
        logger.info("-----------------Context initialized successfully-----------------")
    }

    const [result, error] = await td.createVersion(reportId, versionName, moduleType)
	if (error != "") {
		logger.error ("-----------------" + error + "-----------------")
        return ""
    }
    logger.info("-----------------Create Version returned : " + result + "-----------------")
	return result
}

Successful execution of this function will create a new version in given report and return the newly created versionId and success response

TrueDesign Rename Version:

This function [renameVersion] allows Customers to rename an existing version for a report order

import {TrueDesign} from 'solar-solution-js-sdk'

const config = {
    clientId: "<clientId>",
    clientSecret: "<clientSecret>",
    refreshToken: "<refresh_token>",
}

const SuccessRenameVersion = async (reportId : string, versionId : string, newVersionName : string) => {
    const td = new TrueDesign(successConfig)
    const res = await td.newContext();
    if (res.responseCode != 200) {
        logger.error("-----------------Error while initializing Context: " + res.message + "-----------------")
        return ""
    } else {
        logger.info("-----------------Context initialized successfully-----------------")
    }

    const [result, error] = await td.renameVersion(reportId, versionId, newVersionName)
	if (error != "") {
		logger.error ("-----------------" + error + "-----------------")
        return ""
    }
    logger.info("-----------------Rename Version returned : " + result + "-----------------")
	return result
}

Successful execution of this function will rename the version in given report and success response

TrueDesign Delete Version:

This function [deleteVersion] allows Customers to delete an existing version for a report order

import {TrueDesign} from 'solar-solution-js-sdk'

const config = {
    clientId: "<clientId>",
    clientSecret: "<clientSecret>",
    refreshToken: "<refresh_token>",
}

const SuccessDeleteVersion = async (reportId : string, versionId : string) => {
    const td = new TrueDesign(successConfig)
    const res = await td.newContext();
    if (res.responseCode != 200) {
        logger.error("-----------------Error while initializing Context: " + res.message + "-----------------")
        return ""
    } else {
        logger.info("-----------------Context initialized successfully-----------------")
    }

    const [result, error] = await td.deleteVersion(reportId, versionId)
	if (error != "") {
		logger.error ("-----------------" + error + "-----------------")
        return ""
    }
    logger.info("-----------------Delete Version returned : " + result + "-----------------")
	return result
}

Successful execution of this function will delete the version and success response

TrueDesign Get Applied Presets for a Report:

This function [getPreset] allows Customers to get the applied presets in all the 5 categories for an existing TrueDesign order. The list of PRESETs can be referenced from Appendix - I.

import {TrueDesign} from 'solar-solution-js-sdk'

const config = {
    clientId: "<clientId>",
    clientSecret: "<clientSecret>",
    refreshToken: "<refresh_token>",
}

const SuccessGetPreset = async (reportId : string, versionID : string) => {
    const td = new TrueDesign(successConfig)
    const res = await td.newContext();
    if (res.responseCode != 200) {
        logger.error("-----------------Error while initializing Context: " + res.message + "-----------------")
        return
    } else {
        logger.info("-----------------Context initialized successfully-----------------")
    }

	const [data1, error1] = await td.getPreset(reportId)
	if (error1 != "") {
		logger.error ("-----------------" + error1 + "-----------------")
        return
    }
    logger.info("-----------------Get Preset returned : " + data1 + "-----------------")

    const [data2, error2] = await td.getPreset(reportId, versionID)
	if (error2 != "") {
		logger.error ("-----------------" + error2 + "-----------------")
        return
    }
    logger.info("-----------------Get Preset returned : " + data2 + "-----------------")
	return
}

Successful execution of this function will get the list of currently applied presets for the report

TrueDesign Update Custom Presets:

This function [updateCustomPreset] allows Customers to update the custom presets in any of the 5 categories for an existing TrueDesign order. The list of PRESETs can be referenced from Appendix - I. This version of SDK has helper functions for each category to form the required json, the details can be referenced from Appendix - I.

Note: For a particular category all the presets should be sent with values within the specified range.

import {TrueDesign} from 'solar-solution-js-sdk'

const config = {
    clientId: "<clientId>",
    clientSecret: "<clientSecret>",
    refreshToken: "<refresh_token>",
}

const SuccessSetCustomPreset = async (reportId : string, versionID : string) => {
    const td = new TrueDesign(successConfig)
    const res = await td.newContext();
    if (res.responseCode != 200) {
        logger.error("-----------------Error while initializing Context: " + res.message + "-----------------")
        return
    } else {
        logger.info("-----------------Context initialized successfully-----------------")
    }


    // Before calling customPreset, must call and get individual preset Body
    // func are : getPanelPresetBody , getSetbackPresetBody , getDesignPresetBody , getSolarTilesPresetBody , getPVWattsPresetBody

    const panelDCRating = "290"
    const panelLength = "65"
    const panelName = "Default"
    const panelWidth = "40"
    const panelPreset = await td.getPanelPresetBody(true, panelDCRating, panelLength, panelName, panelWidth)

    // similarly we can get design preset too, and also others
    const minArraySize = "3"
    const minRoofPitch = "5"
    const panelDistance = "0.5"
    const rowDistance = "0.5"
    const initialAlignment = "Aligned"
    const initialOrientation = "Landscape"
    const designPreset = await td.getDesignPresetBody(true, minArraySize, minRoofPitch, panelDistance, rowDistance, initialAlignment, initialOrientation)

    // order of presets : - panel , setback, design , solarTiles, pvWatts
    // write undefined if you dont want to update that preset 
	const [result1, error1] = await td.customPreset(reportId, versionID, panelPreset, undefined, designPreset, undefined, undefined)
	if (error1 != "") {
		logger.error ("-----------------" + error1 + "-----------------")
        return
    }
    logger.info("-----------------SET CUSTOM PRESET returned : " + result1 + "-----------------")

	return
}

Successful execution of this function will update the custom presets and apply the changes on the TrueDesign page and success response

TrueDesign Monthly AC Production:

This function [getMonthlyProdData] gives the AC Production for for a Report based on the chosen frequency. The currently supported frequencies are Yearly and Monthly

import {TrueDesign} from 'solar-solution-js-sdk'

const config = {
    clientId: "<clientId>",
    clientSecret: "<clientSecret>",
    refreshToken: "<refresh_token>",
}

const SuccessGetMonthlyProdData = async (reportId : string, versionID : string, frequency : string) => {
    const td = new TrueDesign(successConfig)
    const res = await td.newContext();
    if (res.responseCode != 200) {
        logger.error("-----------------Error while initializing Context: " + res.message + "-----------------")
        return
    } else {
        logger.info("-----------------Context initialized successfully-----------------")
    }

	const [result1, error1] = await td.getMonthlyProdData(reportId, undefined, frequency)
	if (error1 != "") {
		logger.error ("-----------------" + error1 + "-----------------")
        return
    }
    logger.info("-----------------Get Periodic Prod Data returned : " + result1 + "-----------------")

    const [result2, error2] = await td.getMonthlyProdData(reportId, versionID, frequency)
	if (error2 != "") {
		logger.error ("-----------------" + error2 + "-----------------")
        return
    }
    logger.info("-----------------Get Periodic Prod Data returned : " + result2 + "-----------------")
	return
}

Successful execution of this function will return the Annual or Monthly AC Production output based on the frequency selected.

TrueDesign Delete Custom Preset:

This function [deletePreset] deletes the custom Preset from given version ID and report ID.

import {TrueDesign} from 'solar-solution-js-sdk'

const config = {
    clientId: "<clientId>",
    clientSecret: "<clientSecret>",
    refreshToken: "<refresh_token>",
}

const SuccessDeletePreset = async (reportId : string, versionID : string) => {
    const td = new TrueDesign(successConfig)
    const res = await td.newContext();
    if (res.responseCode != 200) {
        logger.error("-----------------Error while initializing Context: " + res.message + "-----------------")
        return
    } else {
        logger.info("-----------------Context initialized successfully-----------------")
    }

    // we can provide at least 1 or all 5 preset
    const categories : string[] = [PRESETCATEGORIES.DESIGN, PRESETCATEGORIES.PANEL, PRESETCATEGORIES.SETBACK]
    const [data2, error2] = await td.deletePreset(reportId, versionID, categories)
	if (error2 != "") {
		logger.error ("-----------------" + error2 + "-----------------")
        return
    }
    logger.info("-----------------Delete Preset returned : " + data2 + "-----------------")
	return
}

Successful execution of this function will delete the selected custom preset from given report and version ID.

TrueDesign Update energy generation:

This function [maxLayout] updates the energy based on Report ID, Version ID, Pattern and Structure.

import {TrueDesign} from 'solar-solution-js-sdk'

const config = {
    clientId: "<clientId>",
    clientSecret: "<clientSecret>",
    refreshToken: "<refresh_token>",
}

const SuccessMaxLayout = async (reportId : string, versionID : string) => {
    const td = new TrueDesign(successConfig)
    const res = await td.newContext();
    if (res.responseCode != 200) {
        logger.error("-----------------Error while initializing Context: " + res.message + "-----------------")
        return
    } else {
        logger.info("-----------------Context initialized successfully-----------------")
    }

    const pattern = ""
    const structure = ""
    //without version
    const [data1, error1] = await td.maxLayout(reportId, PATTERNS.PANEL_PORTRAIT, STRUCTURES.ALL)
	if (error1 != "") {
		logger.error ("-----------------" + error1 + "-----------------")
        return
    }
    logger.info("-----------------Max Layout returned : " + data1 + "-----------------")

    //with version
    const [data2, error2] = await td.maxLayout(reportId, PATTERNS.TILES_DIAMOND, STRUCTURES.PRIMARY, versionID)
	if (error2 != "") {
		logger.error ("-----------------" + error2 + "-----------------")
        return
    }
    logger.info("-----------------Max Layout returned : " + data2 + "-----------------")

    //with alignment, Only works for panels
    const [data3, error3] = await td.maxLayout(reportId, PATTERNS.TILES_DIAMOND, STRUCTURES.PRIMARY, versionID, ALIGNMENTS.STAGGERED)
	if (error2 != "") {
		logger.error ("-----------------" + error3 + "-----------------")
        return
    }
    logger.info("-----------------Max Layout returned : " + data3 + "-----------------")
	return
}

Successful execution of this function will updates the energy generation based on given pattern and structure.

Get system Roof details based on report ID.:

This function [getRoofDetails] provides the roof details based on Report ID.

import {TrueDesign} from 'solar-solution-js-sdk'

const config = {
    clientId: "<clientId>",
    clientSecret: "<clientSecret>",
    refreshToken: "<refresh_token>",
}

const SuccessGetRoofDetails = async (reportId : string) => {
    const td = new TrueDesign(successConfig)
    const res = await td.newContext();
    if (res.responseCode != 200) {
        logger.error("-----------------Error while initializing Context: " + res.message + "-----------------")
        return
    } else {
        logger.info("-----------------Context initialized successfully-----------------")
    }

    const [data1, error1] = await td.getRoofDetails(reportId)
	if (error1 != "") {
		logger.error ("-----------------" + error1 + "-----------------")
        return
    }
    logger.info("-----------------Get Roof Details returned : " + data1 + "-----------------")
	return
}

Successful execution of this function will provide the roof details for a report.

Update Roof Details (disable/enable) for given version.:

This function [updateRoofFacets] updates the roof factes (enable/disable) for given version.

import {TrueDesign} from 'solar-solution-js-sdk'

const config = {
    clientId: "<clientId>",
    clientSecret: "<clientSecret>",
    refreshToken: "<refresh_token>",
}

const SuccessUpdateRoofFacets = async (reportId : string, versionId : string) => {
    const td = new TrueDesign(successConfig)
    const res = await td.newContext();
    if (res.responseCode != 200) {
        logger.error("-----------------Error while initializing Context: " + res.message + "-----------------")
        return
    } else {
        logger.info("-----------------Context initialized successfully-----------------")
    }

    // without version ID, that means operation will be on default version
    const facets : string = "B,D,F"
    const [data1, error1] = await td.updateRoofFacets(reportId, facets, ROOFTASK.DISABLE)
	if (error1 != "") {
		logger.error ("-----------------" + error1 + "-----------------")
        return
    }
    logger.info("-----------------Update roof Facets returned : " + data1 + "-----------------")

    // with version ID
    const [data2, error2] = await td.updateRoofFacets(reportId, facets, ROOFTASK.ENABLE, versionId)
	if (error2 != "") {
		logger.error ("-----------------" + error2 + "-----------------")
        return
    }
    logger.info("-----------------Update roof Facets returned : " + data2 + "-----------------")
	return
}

Successful execution of this function will update the roof facets for a version. we can enable or disable a complete facet using this function.

Get Refresh Token using code.:

This function [generateRefreshToken] gives you refresh token using one time code and redirect URL.

import {TrueDesign} from 'solar-solution-js-sdk'

const config = {
    clientId: "<clientId>",
    clientSecret: "<clientSecret>",
}

const SuccessUpdateRoofFacets = async (reportId : string, versionId : string) => {
    const td = new TrueDesign(successConfig)

    const [refreshToken, error] = await td.generateRefreshToken("<code>", "<redirect_url>")
	if (error != "") {
		logger.error ("-----------------" + error + "-----------------")
        return ""
    }
    logger.info("-----------------Get Refresh Token returned : " + refreshToken + "-----------------")
}

Successful execution of this function will give you refresh token which you can use for other functionalities. this refresh token is valid for 90 days.

TrueDesign Copy Existing Version:

This function [copyVersion] creates copy of given existing version.

import {TrueDesign} from 'solar-solution-js-sdk'

const config = {
    clientId: "<clientId>",
    clientSecret: "<clientSecret>",
    refreshToken: "<refresh_token>",
}

const SuccessCopyVersion = async (reportId : string, versionId : string, versionName : string) => {
    const td = new TrueDesign(successConfig)
    const res = await td.newContext();
    if (res.responseCode != 200) {
        logger.error("-----------------Error while initializing Context: " + res.message + "-----------------")
        return
    } else {
        logger.info("-----------------Context initialized successfully-----------------")
    }

    const [data, error] = await td.copyVersion(reportId, versionId, versionName)
	if (error != "") {
		logger.error ("-----------------" + error + "-----------------")
        return
    }
    logger.info("-----------------Copy Version API returned : " + data + "-----------------")
	return
}

Successful execution of this function will create a new version which ll be copy of an existing version.

TrueDesign System Overview API:

This function [systemOverview] gives topview image, system Details and monthly production data.

import {TrueDesign} from 'solar-solution-js-sdk'

const config = {
    clientId: "<clientId>",
    clientSecret: "<clientSecret>",
    refreshToken: "<refresh_token>",
}

const SuccessSystemOverview = async (reportId : string, versionID : string) => {
    const td = new TrueDesign(successConfig)
    const res = await td.newContext();
    if (res.responseCode != 200) {
        logger.error("-----------------Error while initializing Context: " + res.message + "-----------------")
        return
    } else {
        logger.info("-----------------Context initialized successfully-----------------")
    }

	const [result1, error1] = await td.systemOverview(reportId, undefined)
	if (error1 != "") {
		logger.error ("-----------------" + error1 + "-----------------")
        return
    }
    logger.info("-----------------Get System Overview returned : " + result1 + "-----------------")

    const [result2, error2] = await td.systemOverview(reportId, versionID)
	if (error2 != "") {
		logger.error ("-----------------" + error2 + "-----------------")
        return
    }
    logger.info("-----------------Get System Overview returned : " + result2 + "-----------------")
	return
}

Successful execution of this function will give topview image, system Details and monthly production data.

TrueDesign Close Report API:

This function [closeReportApi] closes the report before its completion.

import {TrueDesign} from 'solar-solution-js-sdk'

const config = {
    clientId: "<clientId>",
    clientSecret: "<clientSecret>",
    refreshToken: "<refresh_token>",
}

const SuccessCloseReport = async (reportId : number) => {

    const order = new Order(successConfig)
    const res = await order.newContext();
    if (res.responseCode != 200) {
        logger.error("-----------------Error while initializing Context: " + res.message + "-----------------")
        return
    } else {
        logger.info("-----------------Context initialized successfully-----------------------")
    }

	const [response, errCode, error] = await order.closeReportApi(reportId.toString())
	if (error != "") {
		logger.error ("-----------------" + error + "   errCode: " + errCode + "-----------------")
        return
	}
    logger.info("-----------------Close Report returned resp : " + response + "-----------------")
	return
}

Successful execution of this function will close the given report.

Error Handling:

During initialisation both Authentication and Authorisation are validated and all errors are returned with verbose error message

The SDK functions perform parameter validation before the request is submitted. Any errors during this validation result in the function not being triggered and an error message being returned

Appendix - I

  1. Helper functions: The SDK provides helper functions to create the request:

1a. Set ReportAddress (by address) - Returns[ReportAddress object and error string]

newSetReportByAddress(address: string, city: string, state: string, 
                      zip: string, country: string): [ReportAddresses, string]

1b. Set ReportAddress (by Latlong) - Returns[ReportAddress object and error string]

newSetReportByLatLong = (latitude : number, longitude : number): 
                        [ReportAddresses, string]

1c. Set PresetData - Returns [presetData object and error string]

newSetReportPresetData = (design :number, panel :number, setBack : number, 
                          pvWatts : number): [PresetData, string]

1d. Set Preset Custom Attributes - Returns [Single PresetCustomAttributes object and error string]. For sending this with the request, this function needs to be invoked for all 26 attributes

newSetReportPresetCustomAttributes = (attributeId :number, attributeValue : string) 
                                      : [PresetCustomAttributes, string]

1e. Set Preset Preference - Returns [Preset Preference object and error string]

newSetReportPresetPreferences = (presetCustomAttributes : PresetCustomAttributes[], 
                                presetData : PresetData) : [PresetPreference, string]

1f. Set Placeorder Object - Returns [PlaceOrder object and error string]

newSetReportPlaceOrder = (reportAddresses : ReportAddresses[], 
                          buildingId : string, 
                          primaryproductId : number,
                          deliveryProductId : number, 
                          addOnProductIds : number[]|undefined, 
                          measurementInstructionType : number, 
                          changesInLast4Years : boolean, 
                          comments : string|undefined,
                          upgradeFromReportId : number|undefined, 
                          presetPreference : PresetPreference|undefined,
                          referenceId ?: string) : [PlaceOrder, string]

1g. To get the final json for Panel Preset

getPanelPresetBody = (isDefault : boolean, panelDCRating : string, 
                      panelLength : string, panelName : string, 
                      panelWidth : string) : <panelInfo>

1h. To get the final json for Panel Setback

getSetbackPresetBody = (isDefault : boolean, eave : string, hip : string, 
                      obstruction : string, rake : string, ridge : string, 
                      valley : string) : <setbackInfo>

1i. To get the final json for Panel Design

getDesignPresetBody = (isDefault : boolean, minArraySize : string, 
                    minRoofPitch : string, panelDistance : string, 
                    rowDistance : string, initialAlignment : string, 
                    initialOrientation : string) : <designInfo>

1j. To get the final json for Solar Tiles

 getSolarTilesPresetBody = (isDefault : boolean, tileColumnOverlap : string,
        tileHeight : string, tileName : string,
        tilePattern : string, tileRowOverlap : string, tileWatt : string,
         tileWidth : string) : <solarTilesInfo>

1k. To get the final json for Panel Watt

getPVWattsPresetBody = (isDefault : boolean, ageLoss : string, 
        availabilityLoss : string, connectionLoss : string,
        degradationLoss : string, inverterEfficiency : string, 
        mismatchLoss : string,
        nameplateRating : string, panelType : string, snowLoss : string,
        soilingLoss : string, wiringLoss : string) : <pvWattsInfo>
  1. The Preset Custom Attributes and their range are as below | Attribute ID | Attribute Name | Type | Range | Default Value | 1 | SETTINGS_ROOF_MIN_ROOF_PITCH_DEG | Design | 5-89 | 5 | 2 | SETTINGS_SETBACKS_EAVE_INCH | Setback | 0-120 | 5 | 3 | SETTINGS_SETBACKS_RIDGE_INCH | Setback | 0-120 | 8 | 4 | SETTINGS_SETBACKS_HIP_INCH | Setback | 0-120 | 8 | 5 | SETTINGS_SETBACKS_RAKE_INC | Setback | 0-120 | 5 | 6 | SETTINGS_SETBACKS_VALLEY_INCH | Setback | 0-120 | 3 | 7 | SETTINGS_SETBACKS_OBSTRUCTION_INCH | Setback | 0-120 | 3 | 8 | SETTINGS_PANELS_MINIMUM_ARRAY_SIZE | Design | 1-10 | 2 | 9 | SETTINGS_PANELS_PANEL_DISTANCE_INCH | Design | 0.05-10(set in 0.05 intervals) | 0.5 | 10 | SETTINGS_PANELS_ROW_DISTANCE_INCH | Design | 0.05-10(set in 0.05 intervals) | 0.5 | 11 | SETTINGS_PANELS_PANEL_TYPE | PVWatts | STANDARD/PREMIUM/THIN_FILM | PREMIUM | 12 | SETTINGS_PANELS_PANEL_NAME | Panel | string | Infinite length | 13 | SETTINGS_PANELS_PANEL_WIDTH_INCH | Panel | 6-99.9 | 39 | 14 | SETTINGS_PANELS_PANEL_HEIGHT_INCH | Panel | 6-99.9 | 66 | 15 | SETTINGS_PANELS_PANEL_DC_RATING_WATT | Panel | 1-999 | 300 | 16 | SETTINGS_PANELS_INVERTER_EFFICIENCY_PERCENTAGE | PVWatts | 90-99.5 (set in 0.1 intervals) | 98 | 18 | PVWATTS_SETTINGS_AGE_LOSSES_PERCENTAGE | PVWatts | 0-100 (set in 0.01 intervals) | 0 | 19 | PVWATTS_SETTINGS_AVAILABILITY_LOSSES_PERCENTAGE | PVWatts | 0-100 (set in 0.01 intervals) | 3 | 20 | PVWATTS_SETTINGS_CONNECTIONS_LOSSES_PERCENTAGE | PVWatts | 0-100 (set in 0.01 intervals) | 0.5 | 21 | PVWATTS_SETTINGS_LIGHT_INDUCED_DEGRADATION_LOSSES_PERCENTAGE | PVWatts | 0-100 (set in 0.01 intervals) | 1.5 | 22 | PVWATTS_SETTINGS_MISMATCH_LOSSES_PERCENTAGE | PVWatts | 0-100 (set in 0.01 intervals) | 2 | 23 | PVWATTS_SETTINGS_NAMEPLATE_RATING_PERCENTAGE | PVWatts | 0-100 (set in 0.01 intervals) | 1 | 24 | PVWATTS_SETTINGS_SNOW_LOSSES_PERCENTAGE | PVWatts | 0-100 (set in 0.01 intervals) | 0 | 25 | PVWATTS_SETTINGS_SOILING_LOSSES_PERCENTAGE | PVWatts | 0-100 (set in 0.01 intervals) | 2 | 26 | PVWATTS_SETTINGS_WIRING_LOSSES_PERCENTAGE | PVWatts | 0-100 (set in 0.01 intervals) | 2

Testing

This SDK is thoroughly tested in respective technology Testbed and certified by QA before official release.

Caveats

  • NA

FAQs

Readme

Keywords

Package Sidebar

Install

npm i solar-solution-js-sdk

Weekly Downloads

697

Version

3.3.2

License

ISC

Unpacked Size

329 kB

Total Files

41

Last publish

Collaborators

  • deepthikka-k
  • nikhil-k-ev