Skip to main content

Formula inputs

The BOM Automator app allows you to create an automation rule using a formula to either define a condition or quantity of SKUs required. These formulas use the following inputs:

  • Operators
  • Functions
  • Keywords
  • Subcategories
Case sensitivity

All functions and keywords are case sensitive and must be entered into the formula exactly as shown in the rule helper.

Operators

An operator is a sign or symbol that specifies the type of calculation to perform within an formula. Currently you can use:

  • Arithmetic operators: to calculate a value from two or more numbers
  • Comparison operators: to compare values and return a result that is True or False.
OperatorDescriptionExample
+Sum two numbers.Subtotal+``Margin`
-Find the difference between two numbers.Price-Discount
*Multiple two numbers.Quantity*Price
/Divide the first number by the second number.Total/ItemCount
()Applies an order of operation for the formula, based on BODMAS.Margin* (Quantity*Price)

Functions

Functions are predefined formulas that perform calculations by using specific values in a particular structure.

FunctionSyntaxDescriptionExample
CEILCEIL(number)Returns number rounded up to the nearest integer.CEIL(1.5) returns 2
FLOORFLOOR(number)Returns number rounded down to the nearest integer.FLOOR(1.5) returns 1
ROUNDROUND(number)Returns number rounded to the nearest integer.ROUND(1.5) returns 2

Keywords

Keywords are defined inputs that have a corresponding value based on the Site or Quote. Keywords can be used to:

  • Define the condition in condition-based rules
  • Define the formula used to calculate quantity of a SKU to add to the BOM

Site keywords

KeywordDescriptionAvailable inputs
site.nmiThe National Meter Identifier for the Site, used to uniquely identify the electricity connection.N/A
site.latitudeDegThe latitude coordinate of the site in decimal degrees, indicating its distance north or south of the equator.N/A
site.longitudeDegThe longitude coordinate of the site in decimal degrees, indicating its distance east or west of the Prime Meridian.N/A
site.timezoneThe timezone in which the Site is located.N/A
site.addressLine1The primary address line of the Site, typically including the street number and name.N/A
site.addressLine2The secondary address line of the Site, which may include additional address information such as unit number.N/A
site.suburbThe suburb or locality of the Site.N/A
site.stateThe state or province of the Site.ACT, NT, NSW, QLD, SA,TAS, VIC, WA
site.postCodeThe postal code of the Site.N/A
site.phaseNumThe number of electrical phases at the Site.1, 3
site.dnsp.codeThe code of the Distribution Network Service Provider (DNSP) for the Site.actewagl, ausnetmetro, ausgrid, citipower, endeavour, energex, ergon, essential, evo, horizon, jemena, pwc, sapn, tasnet, united, unknown, western
site.dnsp.nameThe name of the Distribution Network Service Provider (DNSP) for the Site.ActewAGL, AusNet Metro, Ausgrid, CitiPower Powercor, Endeavour, Energex, Ergon, Essential, EvoEnergy, Horizon Power, Jemena, Power and Water Corporation, SA Power Networks, TasNetworks, United Energy, Unknown, Western Power
site.exportLimitWThe export limit or maximum amount of power that can be exported to the grid based on the DNSP, in watts.N/A
site.maxSystemSizeWThe maximum system size in watts, that can be installed at the Site, based on the DNSP and number of phases.N/A

System design keywords

KeywordDescriptionAvailable inputs
design.hasSolarDetermined based on whether the system design contains solar panels.true, false
design.hasBatteryDetermined based on whether the system design contains batteries.true, false
design.hasEvChargerDetermined based on whether the system design contains EV chargers.true, false

Solar design keywords

KeywordDescription
design.solarDesign.numStoreysThe number of storeys of the Site.
design.solarDesign.roofTypeThe roof type selected in the system design. If more than one exists, the roof type for the majority of surfaces is applied.
design.solarDesign.panelSkuIdThe ID of the solar panel used in the system design, as stored in the Hardware Model Manager.
design.solarDesign.panelNameThe display name of the solar panel used in the system design, as stored in the Hardware Model Manager.
design.solarDesign.panelModelThe model of the solar panel used in the system design, as stored in the Hardware Model Manager.
design.solarDesign.panelBrandThe brand of the solar panel used in the system design, as stored in the Hardware Model Manager.
design.solarDesign.panelCountThe total number of solar panels in the system design.
design.solarDesign.panelRowCountThe total number of rows of solar panels in the system design. A row is indicated in the string summary by a "_".
design.solarDesign.panelSplitCountThe total number of splits or gaps in a row of solar panels in the system design. A split is indicated in the string summary by a "*".
design.solarDesign.stringCountThe total number of solar panels strings in the system design.
design.solarDesign.panelOnTiltCountThe total number of solar panels on a roof surface that requires tilt frames.
design.solarDesign.stringOnTiltCountThe total number of solar panel strings on a roof surface that requires tilt frames.
design.solarDesign.panelRatedPowerWThe rated power of the solar panel used in the system design, in watts.
design.solarDesign.inverterSkuIdThe ID of the inverter used in the system design, as stored in the Hardware Model Manager.
design.solarDesign.inverterNameThe display name of the inverter used in the system design, as stored in the Hardware Model Manager.
design.solarDesign.inverterModelThe model of the inverter used in the system design, as stored in the Hardware Model Manager.
design.solarDesign.inverterBrandThe brand of the inverter used in the system design, as stored in the Hardware Model Manager.
design.solarDesign.inverterRatedPowerWThe rated power of the inverter, in watts.

Battery design keywords

KeywordDescription
design.batteryDesign.batterySkuIdThe ID of the battery used in the system design, as stored in the Hardware Model Manager.
design.batteryDesign.batteryNameThe display name of the battery used in the system design, as stored in the Hardware Model Manager.
design.batteryDesign.batteryBrandThe brand of the inverter used in the system design, as stored in the Hardware Model Manager.
design.batteryDesign.batteryCountThe total number of batteries in the system design.
design.batteryDesign.batteryTotalPowerKwThe total rated power of the batteries in the system design, in kilowatts.
design.batteryDesign.batteryTotalUsableCapacityKwhThe total usable capacity of the batteries in the system design, in kilowatt-hours.
design.batteryDesign.efficiencyThe efficiency rating of the battery used in the system design.

EV Charger design keywords

KeywordDescription
design.evChargerDesign.evChargerSkuIdThe ID of the EV charger used in the system design, as stored in the Hardware Model Manager.
design.evChargerDesign.evChargerCountThe total number of EV chargers in the system design.
design.evChargerDesign.evChargerTotalPowerKwThe total rated power of the EV charger in the system design, in kilowatts.

Fixed rule keywords

warning

Since these keywords depend on other line items in the BOM, they can only be used within Fixed rules.

KeywordDescription
totalHardwareCostCentThe total cost of all SKU items with the category of hardware.
totalInstallationCostCentsThe total cost of all SKU items with the category of installation.

Price book keywords

SKU information available in Pricing Manager can be used as a formula input, using the following format:

pricebook["SKU CODE"].metadata

For example, if we want to use the rail length of Clenergy PVezRack ECO-Rail in a formula:

pricebook["CLENERGY-ECORAIL-4400"].rail_length

Some common use cases are tabled below.

SubcategoryMetadataUnits
railrail_lengthmm
acisolatorrated_currentA
solarbatterybattery_install_costcents

Subcategories

All rule types allow a SKU subcategory to be added to the BOM. The specific SKU added to the BOM is resolved through a SKU lookup that's created in the Pricing Manager.

For example, when an Operator selects a specified variation and we want to add a specific AC isolator SKU based on the solar inverter in the system design:

For every Remote AC Isolator variation included in the system design, then add subcategory acisolator.

A default SKU per subcategory will be added to the BOM if there is no defined SKU lookup.

Examples

Setting a condition

To define a condition using a keyword with available inputs, quotations must be used around the static comparator. For example:

If site.dnsp.code = "ausgrid", then...

To compare to multiple values:

If site.state in ["NSW", "VIC"], then...

Setting a SKU quantity formula

To define the required quantity of a SKU using a calculated formula, you can only use numbers and available inputs: operators, functions and keywords. All inputs are case-sensitive and must match exactly to apply correctly.

For example, when calculating the number of universal clamps required, we can set up a conditional rule:

If the system contains solar panels, then add 2*(design.solarDesign.panelCount + design.solarDesign.panelRowCount) universal clips.

Setting the margin

To determine a percentage margin, we must use a fixed rule keyword. For example, if we want a 20% margin on all hardware costs, we can set up a fixed rule:

Always add: 0.2 * totalHardwareCostCent service units.