Energy Site Management

The service offers a set of site management operations on the EnergySites endpoint. This method allows the client to generate a list of the sites associated with their license, request detailed information about specific solar sites, and set a site’s attributes or specifications. The response to each request depends on the specific operation. The response can be a single EnergySiteId, a list of EnergySiteIds or a full site specification.

EnergySite Operations

Create a solar energy site under your license using the EnergySites service endpoint.

import requests
from requests.auth import HTTPBasicAuth

url = "https://service.solaranywhere.com/api/v1/EnergySites"
userName = "your_username@your_company.com"
password = "your_password"

querystring = {"key":"your_client_key"}

payload = """<EnergySiteCreateRequest xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
  xmlns:xsd="http://www.w3.org/2001/XMLSchema">
 <EnergySite Name="Sample Site" Description="Sample Site">
  <Location Latitude_Degrees="34.65" Longitude_Degrees="-119.1"/>
   <PvSystems>
    <PvSystem Albedo_Percent="17">
     <PvSubsystems>
      <PvSubsystem GeneralDerate_Percent="85.00">
       <Inverters>
        <Inverter Count="1" MaxPowerOutput_kWAC="4.470000" EfficiencyRating_Percent="97.000000"/>
       </Inverters>
       <PvArrays>
        <PvArray>
         <PvModules>  
          <PvModule Count="20" NameplateDCRating_kWDC="0.22000" PtcRating_kWDC="0.19760" 
           PowerTemperatureCoefficient_PercentPerDegreeC="0.4"/>
         </PvModules>
         <ArrayConfiguration Azimuth_Degrees="177.000" Tilt_Degrees="25.000" Tracking="Fixed Array" 
          TrackingRotationLimit_Degrees="90"/>
         <SolarObstructions>
          <SolarObstruction Azimuth_Degrees="90.000" Elevation_Degrees="33.000"/>
          <SolarObstruction Azimuth_Degrees="120.000" Elevation_Degrees="50.000"/>
          <SolarObstruction Azimuth_Degrees="150.000" Elevation_Degrees="22.000"/>
          <SolarObstruction Azimuth_Degrees="180.000" Elevation_Degrees="3.000"/>
          <SolarObstruction Azimuth_Degrees="210.000" Elevation_Degrees="1.000"/>
          <SolarObstruction Azimuth_Degrees="240.000" Elevation_Degrees="2.000"/>
          <SolarObstruction Azimuth_Degrees="270.000" Elevation_Degrees="4.000"/>
         </SolarObstructions>
         <MonthlyShadings>
          <MonthlyShading MonthNumber="1" SolarAccess_Percent="77.0"/>
          <MonthlyShading MonthNumber="2" SolarAccess_Percent="87.0"/>
          <MonthlyShading MonthNumber="3" SolarAccess_Percent="98.0"/>
          <MonthlyShading MonthNumber="4" SolarAccess_Percent="100.0"/>
          <MonthlyShading MonthNumber="5" SolarAccess_Percent="100.0"/>
          <MonthlyShading MonthNumber="6" SolarAccess_Percent="100.0"/>
          <MonthlyShading MonthNumber="7" SolarAccess_Percent="100.0"/>
          <MonthlyShading MonthNumber="8" SolarAccess_Percent="100.0"/>
          <MonthlyShading MonthNumber="9" SolarAccess_Percent="100.0"/>
          <MonthlyShading MonthNumber="10" SolarAccess_Percent="100.0"/>
          <MonthlyShading MonthNumber="11" SolarAccess_Percent="100.0"/>
          <MonthlyShading MonthNumber="12" SolarAccess_Percent="91.0"/>
         </MonthlyShadings>
        </PvArray>
       </PvArrays>
      </PvSubsystem>
     </PvSubsystems>
    </PvSystem>
   </PvSystems>
 </EnergySite>
</EnergySiteCreateRequest>"""

headers = {
    'content-type': "text/xml; charset=utf-8",
    'content-length': "length",
    }

response = requests.post(url,auth = HTTPBasicAuth(userName,password),
           data=payload,headers=headers,params=querystring)

print(response.text)

Update a solar energy site, providing new site specifications.

import requests
from requests.auth import HTTPBasicAuth

url = "https://service.solaranywhere.com/api/v1/EnergySites/"
userName = "your_username@your_company.com"
password = "your password"
EnergySiteId = "your_site_id"

querystring = {"key":"your_client_key"}

payload = """<EnergySiteUpdateRequest xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
  xmlns:xsd="http://www.w3.org/2001/XMLSchema">
 <EnergySite Name="Sample Site" Description="Sample Site">
  <Location Latitude_Degrees="34.65" Longitude_Degrees="-119.1"/>
   <PvSystems>
    <PvSystem Albedo_Percent="17">
     <PvSubsystems>
      <PvSubsystem GeneralDerate_Percent="85.00">
       <Inverters>
        <Inverter Count="1" MaxPowerOutput_kWAC="4.470000" EfficiencyRating_Percent="97.000000"/>
       </Inverters>
       <PvArrays>
        <PvArray>
         <PvModules>
          <PvModule Count="20" NameplateDCRating_kWDC="0.22000" PtcRating_kWDC="0.19760" 
           PowerTemperatureCoefficient_PercentPerDegreeC="0.4"/>
         </PvModules>
         <ArrayConfiguration Azimuth_Degrees="177.000" Tilt_Degrees="25.000" Tracking="Fixed Array" 
          TrackingRotationLimit_Degrees="90"/>
         <SolarObstructions>
          <SolarObstruction Azimuth_Degrees="90.000" Elevation_Degrees="33.000"/>
          <SolarObstruction Azimuth_Degrees="120.000" Elevation_Degrees="50.000"/>
          <SolarObstruction Azimuth_Degrees="150.000" Elevation_Degrees="22.000"/>
          <SolarObstruction Azimuth_Degrees="180.000" Elevation_Degrees="3.000"/>
          <SolarObstruction Azimuth_Degrees="210.000" Elevation_Degrees="1.000"/>
          <SolarObstruction Azimuth_Degrees="240.000" Elevation_Degrees="2.000"/>
          <SolarObstruction Azimuth_Degrees="270.000" Elevation_Degrees="4.000"/>
         </SolarObstructions>
         <MonthlyShadings>
          <MonthlyShading MonthNumber="1" SolarAccess_Percent="77.0"/>
          <MonthlyShading MonthNumber="2" SolarAccess_Percent="87.0"/>
          <MonthlyShading MonthNumber="3" SolarAccess_Percent="98.0"/>
          <MonthlyShading MonthNumber="4" SolarAccess_Percent="100.0"/>
          <MonthlyShading MonthNumber="5" SolarAccess_Percent="100.0"/>
          <MonthlyShading MonthNumber="6" SolarAccess_Percent="100.0"/>
          <MonthlyShading MonthNumber="7" SolarAccess_Percent="100.0"/>
          <MonthlyShading MonthNumber="8" SolarAccess_Percent="100.0"/>
          <MonthlyShading MonthNumber="9" SolarAccess_Percent="100.0"/>
          <MonthlyShading MonthNumber="10" SolarAccess_Percent="100.0"/>
          <MonthlyShading MonthNumber="11" SolarAccess_Percent="100.0"/>
          <MonthlyShading MonthNumber="12" SolarAccess_Percent="91.0"/>
         </MonthlyShadings>
        </PvArray>
       </PvArrays>
      </PvSubsystem>
     </PvSubsystems>
    </PvSystem>
   </PvSystems>
 </EnergySite>
</EnergySiteUpdateRequest>"""

headers = {
    'content-type': "text/xml; charset=utf-8",
    'content-length': "length",
    }

response = requests.post(url + EnergySiteId, auth = HTTPBasicAuth(userName,password),
           data=payload,headers=headers,params=querystring)

print(response.text)

Request the list of solar energy sites assigned to your username.

import requests
from requests.auth import HTTPBasicAuth

url = "https://service.solaranywhere.com/api/v1/EnergySites"
userName = "your_username@your_company.com"
password = "your_password"

querystring = {"key":"your_client_key"}

response = requests.get(url, auth=HTTPBasicAuth(userName,password), params=querystring)

print(response.text)

Request the specifications for an existing solar site.

import requests
from requests.auth import HTTPBasicAuth

url = "https://service.solaranywhere.com/api/v1/EnergySites/"
userName = "your_username@your_company.com"
password = "your_password"
EnergySiteId = "your_site_id"

querystring = {"key":"your_client_key"}

response = requests.get(url + EnergySiteId,auth = HTTPBasicAuth(userName,password),
           params=querystring)

print(response.text)
EnergySiteCreateRequest

Within the set of EnergySite operations, the client can perform a number of tasks related to defining and reporting on their solar energy sites. Each solar site is defined by a specification tied to that site, according to input fields outlined in the Complete Schema. The energy system structure allows client applications to specify multiple subsystems, each with separate lists of inverters and arrays of PV modules with separate system losses. Each array can have its own module performance specifications, array orientation and solar obstructions. All of these factors are taken into account during the energy simulation.

 

Here are a few sample EnergySiteCreateRequest payloads using different types of site configurations.

<EnergySiteCreateRequest xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
 xmlns:xsd="http://www.w3.org/2001/XMLSchema">
 <EnergySite Name="Sample Site" Description="Single PV System">
  <Location Latitude_Degrees="34.65" Longitude_Degrees="-119.1"/>
   <PvSystems>
    <PvSystem Albedo_Percent="17">
     <PvSubsystems>
      <PvSubsystem GeneralDerate_Percent="85.00">
       <Inverters>
        <Inverter Count="1" MaxPowerOutput_kWAC="4.470000" EfficiencyRating_Percent="97.000000"/>
       </Inverters>
       <PvArrays>
        <PvArray>
         <PvModules>
          <PvModule Count="20" NameplateDCRating_kWDC="0.22000" PtcRating_kWDC="0.19760" 
           PowerTemperatureCoefficient_PercentPerDegreeC="0.4"/>
         </PvModules>
         <ArrayConfiguration Azimuth_Degrees="177.000" Tilt_Degrees="25.000" 
          Tracking="Fixed Array" TrackingRotationLimit_Degrees="90"/>
        </PvArray>
       </PvArrays>
      </PvSubsystem>
     </PvSubsystems>
    </PvSystem>
   </PvSystems>
 </EnergySite>
</EnergySiteCreateRequest>

 

<EnergySiteCreateRequest xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
 xmlns:xsd="http://www.w3.org/2001/XMLSchema">
 <EnergySite Name="Sample Site" Description="Multiple PV Sub Systems">
  <Location Latitude_Degrees="34.65" Longitude_Degrees="-119.1"/>
   <PvSystems>
    <PvSystem Albedo_Percent="17">
     <PvSubsystems>
      <PvSubsystem GeneralDerate_Percent="85.00">
       <Inverters>
        <Inverter Count="1" MaxPowerOutput_kWAC="4.470000" EfficiencyRating_Percent="97.000000"/>
       </Inverters>
       <PvArrays>
        <PvArray>
         <PvModules>
          <PvModule Count="20" NameplateDCRating_kWDC="0.22000" PtcRating_kWDC="0.19760" 
           PowerTemperatureCoefficient_PercentPerDegreeC="0.4"/>
         </PvModules>
         <ArrayConfiguration Azimuth_Degrees="177.000" Tilt_Degrees="25.000" 
          Tracking="Fixed Array" TrackingRotationLimit_Degrees="90"/>
        </PvArray>
       </PvArrays>
      </PvSubsystem>
     </PvSubsystems>
    </PvSystem>
   <PvSystem Albedo_Percent="20">
     <PvSubsystems>
      <PvSubsystem GeneralDerate_Percent="87.50">
       <Inverters>
        <Inverter Count="2" MaxPowerOutput_kWAC="4.470000" EfficiencyRating_Percent="97.000000"/>
       </Inverters>
       <PvArrays>
        <PvArray>
         <PvModules>
          <PvModule Count="40" NameplateDCRating_kWDC="0.22000" PtcRating_kWDC="0.19760" 
           PowerTemperatureCoefficient_PercentPerDegreeC="0.4"/>
         </PvModules>
         <ArrayConfiguration Azimuth_Degrees="255.000" Tilt_Degrees="30.000" 
          Tracking="Fixed Array" TrackingRotationLimit_Degrees="90"/>
        </PvArray>
       </PvArrays>
      </PvSubsystem>
     </PvSubsystems>
    </PvSystem>
   </PvSystems>
 </EnergySite>
</EnergySiteCreateRequest>
<EnergySiteCreateRequest xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
 xmlns:xsd="http://www.w3.org/2001/XMLSchema">
 <EnergySite Name="Sample Site" Description="Azimuthal Shading">
  <Location Latitude_Degrees="34.65" Longitude_Degrees="-119.1"/>
   <PvSystems>
    <PvSystem Albedo_Percent="17">
     <PvSubsystems>
      <PvSubsystem GeneralDerate_Percent="85.00">
       <Inverters>
        <Inverter Count="1" MaxPowerOutput_kWAC="4.470000" EfficiencyRating_Percent="97.000000"/>
       </Inverters>
       <PvArrays>
        <PvArray>
         <PvModules>
          <PvModule Count="20" NameplateDCRating_kWDC="0.22000" PtcRating_kWDC="0.19760" 
           PowerTemperatureCoefficient_PercentPerDegreeC="0.4"/>
         </PvModules>
         <ArrayConfiguration Azimuth_Degrees="177.000" Tilt_Degrees="25.000" 
          Tracking="Fixed Array" TrackingRotationLimit_Degrees="90"/>
         <SolarObstructions>
          <SolarObstruction Azimuth_Degrees="90.000" Elevation_Degrees="33.000"/>
          <SolarObstruction Azimuth_Degrees="120.000" Elevation_Degrees="50.000"/>
          <SolarObstruction Azimuth_Degrees="150.000" Elevation_Degrees="22.000"/>
          <SolarObstruction Azimuth_Degrees="180.000" Elevation_Degrees="3.000"/>
          <SolarObstruction Azimuth_Degrees="210.000" Elevation_Degrees="1.000"/>
          <SolarObstruction Azimuth_Degrees="240.000" Elevation_Degrees="2.000"/>
          <SolarObstruction Azimuth_Degrees="270.000" Elevation_Degrees="4.000"/>
         </SolarObstructions>
        </PvArray>
       </PvArrays>
      </PvSubsystem>
     </PvSubsystems>
    </PvSystem>
   </PvSystems>
 </EnergySite>
</EnergySiteCreateRequest>
<EnergySiteCreateRequest xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
 xmlns:xsd="http://www.w3.org/2001/XMLSchema">
 <EnergySite Name="Sample Site" Description="Monthly Solar Resource">
  <Location Latitude_Degrees="34.65" Longitude_Degrees="-119.1"/>
   <PvSystems>
    <PvSystem Albedo_Percent="17">
     <PvSubsystems>
      <PvSubsystem GeneralDerate_Percent="85.00">
       <Inverters>
        <Inverter Count="1" MaxPowerOutput_kWAC="4.470000" EfficiencyRating_Percent="97.000000"/>
       </Inverters>
       <PvArrays>
        <PvArray>
         <PvModules>
          <PvModule Count="20" NameplateDCRating_kWDC="0.22000" PtcRating_kWDC="0.19760" 
           PowerTemperatureCoefficient_PercentPerDegreeC="0.4"/>
         </PvModules>
         <ArrayConfiguration Azimuth_Degrees="177.000" Tilt_Degrees="25.000" 
          Tracking="Fixed Array" TrackingRotationLimit_Degrees="90"/>
         <MonthlyShadings>
          <MonthlyShading MonthNumber="1" SolarAccess_Percent="77.0"/>
          <MonthlyShading MonthNumber="2" SolarAccess_Percent="87.0"/>
          <MonthlyShading MonthNumber="3" SolarAccess_Percent="98.0"/>
          <MonthlyShading MonthNumber="4" SolarAccess_Percent="100.0"/>
          <MonthlyShading MonthNumber="5" SolarAccess_Percent="100.0"/>
          <MonthlyShading MonthNumber="6" SolarAccess_Percent="100.0"/>
          <MonthlyShading MonthNumber="7" SolarAccess_Percent="100.0"/>
          <MonthlyShading MonthNumber="8" SolarAccess_Percent="100.0"/>
          <MonthlyShading MonthNumber="9" SolarAccess_Percent="100.0"/>
          <MonthlyShading MonthNumber="10" SolarAccess_Percent="100.0"/>
          <MonthlyShading MonthNumber="11" SolarAccess_Percent="100.0"/>
          <MonthlyShading MonthNumber="12" SolarAccess_Percent="91.0"/>
         </MonthlyShadings>
        </PvArray>
       </PvArrays>
      </PvSubsystem>
     </PvSubsystems>
    </PvSystem>
   </PvSystems>
 </EnergySite>
</EnergySiteCreateRequest>
EnergySiteCreateResponse

The response will contain a unique EnergySiteId that the client can then use to reference the specific site when calling simulated PV output.

<EnergySiteCreateResponse xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
 xmlns:xsd="http://www.w3.org/2001/XMLSchema"
 RequestURL="/SolarAnywhereToolkit/Services/Services.svc/v1/EnergySites?key=****EY" 
 EnergySiteId="HIAm3LLKV0eB29vPlM-rXw" />

What’s Next?