npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@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 the tariff 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
  ]
}