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
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.
| Operator | Description | Example |
|---|---|---|
| + | 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.
| Function | Syntax | Description | Example |
|---|---|---|---|
| CEIL | CEIL(number) | Returns number rounded up to the nearest integer. | CEIL(1.5) returns 2 |
| FLOOR | FLOOR(number) | Returns number rounded down to the nearest integer. | FLOOR(1.5) returns 1 |
| ROUND | ROUND(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
| Keyword | Description | Available inputs |
|---|---|---|
| site.nmi | The National Meter Identifier for the Site, used to uniquely identify the electricity connection. | N/A |
| site.latitudeDeg | The latitude coordinate of the site in decimal degrees, indicating its distance north or south of the equator. | N/A |
| site.longitudeDeg | The longitude coordinate of the site in decimal degrees, indicating its distance east or west of the Prime Meridian. | N/A |
| site.timezone | The timezone in which the Site is located. | N/A |
| site.addressLine1 | The primary address line of the Site, typically including the street number and name. | N/A |
| site.addressLine2 | The secondary address line of the Site, which may include additional address information such as unit number. | N/A |
| site.suburb | The suburb or locality of the Site. | N/A |
| site.state | The state or province of the Site. | ACT, NT, NSW, QLD, SA,TAS, VIC, WA |
| site.postCode | The postal code of the Site. | N/A |
| site.phaseNum | The number of electrical phases at the Site. | 1, 3 |
| site.dnsp.code | The 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.name | The 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.exportLimitW | The export limit or maximum amount of power that can be exported to the grid based on the DNSP, in watts. | N/A |
| site.maxSystemSizeW | The 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
| Keyword | Description | Available inputs |
|---|---|---|
| design.hasSolar | Determined based on whether the system design contains solar panels. | true, false |
| design.hasBattery | Determined based on whether the system design contains batteries. | true, false |
| design.hasEvCharger | Determined based on whether the system design contains EV chargers. | true, false |
Solar design keywords
| Keyword | Description |
|---|---|
| design.solarDesign.numStoreys | The number of storeys of the Site. |
| design.solarDesign.roofType | The roof type selected in the system design. If more than one exists, the roof type for the majority of surfaces is applied. |
| design.solarDesign.panelSkuId | The ID of the solar panel used in the system design, as stored in the Hardware Model Manager. |
| design.solarDesign.panelName | The display name of the solar panel used in the system design, as stored in the Hardware Model Manager. |
| design.solarDesign.panelModel | The model of the solar panel used in the system design, as stored in the Hardware Model Manager. |
| design.solarDesign.panelBrand | The brand of the solar panel used in the system design, as stored in the Hardware Model Manager. |
| design.solarDesign.panelCount | The total number of solar panels in the system design. |
| design.solarDesign.panelRowCount | The total number of rows of solar panels in the system design. A row is indicated in the string summary by a "_". |
| design.solarDesign.panelSplitCount | The 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.stringCount | The total number of solar panels strings in the system design. |
| design.solarDesign.panelOnTiltCount | The total number of solar panels on a roof surface that requires tilt frames. |
| design.solarDesign.stringOnTiltCount | The total number of solar panel strings on a roof surface that requires tilt frames. |
| design.solarDesign.panelRatedPowerW | The rated power of the solar panel used in the system design, in watts. |
| design.solarDesign.inverterSkuId | The ID of the inverter used in the system design, as stored in the Hardware Model Manager. |
| design.solarDesign.inverterName | The display name of the inverter used in the system design, as stored in the Hardware Model Manager. |
| design.solarDesign.inverterModel | The model of the inverter used in the system design, as stored in the Hardware Model Manager. |
| design.solarDesign.inverterBrand | The brand of the inverter used in the system design, as stored in the Hardware Model Manager. |
| design.solarDesign.inverterRatedPowerW | The rated power of the inverter, in watts. |
Battery design keywords
| Keyword | Description |
|---|---|
| design.batteryDesign.batterySkuId | The ID of the battery used in the system design, as stored in the Hardware Model Manager. |
| design.batteryDesign.batteryName | The display name of the battery used in the system design, as stored in the Hardware Model Manager. |
| design.batteryDesign.batteryBrand | The brand of the inverter used in the system design, as stored in the Hardware Model Manager. |
| design.batteryDesign.batteryCount | The total number of batteries in the system design. |
| design.batteryDesign.batteryTotalPowerKw | The total rated power of the batteries in the system design, in kilowatts. |
| design.batteryDesign.batteryTotalUsableCapacityKwh | The total usable capacity of the batteries in the system design, in kilowatt-hours. |
| design.batteryDesign.efficiency | The efficiency rating of the battery used in the system design. |
EV Charger design keywords
| Keyword | Description |
|---|---|
| design.evChargerDesign.evChargerSkuId | The ID of the EV charger used in the system design, as stored in the Hardware Model Manager. |
| design.evChargerDesign.evChargerCount | The total number of EV chargers in the system design. |
| design.evChargerDesign.evChargerTotalPowerKw | The total rated power of the EV charger in the system design, in kilowatts. |
Fixed rule keywords
Since these keywords depend on other line items in the BOM, they can only be used within Fixed rules.
| Keyword | Description |
|---|---|
| totalHardwareCostCent | The total cost of all SKU items with the category of hardware. |
| totalInstallationCostCents | The 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.
| Subcategory | Metadata | Units |
|---|---|---|
| rail | rail_length | mm |
| acisolator | rated_current | A |
| solarbattery | battery_install_cost | cents |
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 Isolatorvariation included in the system design, then add subcategoryacisolator.
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 *
totalHardwareCostCentservice units.