@socialenergy/tariffs
v2.12.4
Published
This library is provided by Social Energy as a simple way to retrieve tariffs and compute savings. It is intended for our partners, installers, and internal use only.
Downloads
35
Readme
tariffs
This library is provided by Social Energy as a simple way to retrieve tariffs and compute savings. It is intended for our partners, installers, and internal use only.
This library is written in TypeScript so full type support is provided when using TS, and autocomplete should behave nicely when importing in a standard JavaScript project too.
Notes on usage
The current quarterly / monthly bill field can be omitted, though the resulting
totalBenefit
data should be ignored. This is a useful way to just retrieve thetariff
data object without attempting to calculate their savings.The export tariff is calculated by taking the expected exported kWh after the battery is installed, then multiplying the amount before the kWh cap by the higher export unit rate, and any amount after the kWh cap by the standard export unit rate.
The savings outputted are in a yearly format from the current year onwards. The first array element is year 1 of the customer owning the system, the second array element is year 2, so on and so forth. To calculate their total benefit, sum all of the array elements together.
Simple usage examples
The following is a quick "getting started" guide.
Install
npm install @socialenergy/tariffs # or
yarn add @socialenergy/tariffs
Import into project
const { au, gb } = require("@socialenergy/tariffs");
Australia new solar
const res = await au.calculate({
currentQuarterlyBill: 500,
postcode: 2117,
retrofit: false,
});
Output
{
"tariff": {
"regionCode": "NSW",
"operatorName": "Endeavour",
"importUnitRate": 24,
"dailyCharge": 150,
"exportUnitRate": 6,
"higherExportUnitRate": 40,
"quarterlyExportCapKwh": 300,
"controlledLoadUnitRate": 18,
"controlledLoadDailyCharge": 0,
"referencePriceDifferencePercentage": -7.0,
"estimatedAnnualCost": 1733.29,
"estimatedAnnualCostCL": 2190.93,
"tariffPlanLinks": {
"withControlledLoad": "https://www.energymadeeasy.gov.au/plan?id=SEA460020MRE&utm_source=Social+Energy&utm_campaign=bpi-retailer&utm_medium=retailer",
"withoutControlledLoad": "https://www.energymadeeasy.gov.au/plan?id=SEA460024MRE&utm_source=Social+Energy&utm_campaign=bpi-retailer&utm_medium=retailer"
}
},
"totalBenefit": [
2810.3519, 2896.455092, 2984.4157553600003, 3074.682779427201,
3166.3358490412165, 3260.472887706614, 3356.451272292811,
3453.0466041334157, 3548.786210472957, 3645.170179933667
]
}
Australia retrofit
const res = await au.calculate({
currentQuarterlyBill: 500,
postcode: 2117,
retrofit: true,
});
Output
{
"tariff": {
"regionCode": "NSW",
"operatorName": "Endeavour",
"importUnitRate": 24,
"dailyCharge": 150,
"exportUnitRate": 6,
"higherExportUnitRate": 40,
"quarterlyExportCapKwh": 300,
"controlledLoadUnitRate": 18,
"controlledLoadDailyCharge": 0,
"referencePriceDifferencePercentage": -7.0,
"estimatedAnnualCost": 1733.29,
"estimatedAnnualCostCL": 2190.93,
"tariffPlanLinks": {
"withControlledLoad": "https://www.energymadeeasy.gov.au/plan?id=SEA460020MRE&utm_source=Social+Energy&utm_campaign=bpi-retailer&utm_medium=retailer",
"withoutControlledLoad": "https://www.energymadeeasy.gov.au/plan?id=SEA460024MRE&utm_source=Social+Energy&utm_campaign=bpi-retailer&utm_medium=retailer"
}
},
"totalBenefit": [
2356.4599000000007, 2425.561780000001, 2499.41902864, 2575.2937459456007,
2651.405990636993, 2733.5464577501252, 2816.500614134424,
2903.9945035462933, 2994.6722119358815, 3086.8170155786856
]
}
UK new solar
const res = await gb.calculate({
currentMonthlyBill: 50,
postcode: "pl13fh",
retrofit: false,
});
Output
{
"tariff": {
"operatorId": 22,
"elecImportUnitRate": 17.9,
"elecStandingCharge": 21.6,
"gasImportUnitRate": 2.88,
"gasStandingCharge": 25.82,
"higherExportUnitRate": 20,
"exportUnitRate": 6,
"yearlyExportCapKwh": 1000
},
"totalBenefit": [
493.299, 504.61760000000004, 518.4939808, 536.0407225280001,
555.0914722432001, 573.6424958741632, 592.0240908917791, 608.7716633030329,
636.8021608867887, 665.5678353044013
]
}
UK retrofit
const res = await gb.calculate({
currentMonthlyBill: 50,
postcode: "pl13fh",
retrofit: true,
});
Output
{
"tariff": {
"operatorId": 23,
"elecImportUnitRate": 16.63,
"elecStandingCharge": 21.6,
"gasImportUnitRate": 3.13,
"gasStandingCharge": 25.82,
"higherExportUnitRate": 14,
"exportUnitRate": 0,
"yearlyExportCapKwh": 1000
},
"totalBenefit": [
400.4258, 409.837888, 426.61306496000003, 462.4309121792001,
473.64153594841605, 485.98940266810115, 497.6012977617117,
505.2692954629117, 521.580968312763, 532.7727484095135
]
}