{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://www.calculatorx.com/schemas/electrical.electricity_bill.input.json",
  "title": "Electricity bill — input",
  "type": "object",
  "oneOf": [
    {
      "title": "kwh",
      "type": "object",
      "additionalProperties": false,
      "required": [
        "mode",
        "kWh",
        "rate"
      ],
      "properties": {
        "mode": {
          "const": "kwh",
          "description": "Direct energy in kWh"
        },
        "kWh": {
          "type": "number",
          "minimum": 0,
          "description": "Energy used (kWh)"
        },
        "rate": {
          "type": "number",
          "minimum": 0,
          "description": "Unit rate (currency/kWh)"
        },
        "standing": {
          "type": "number",
          "minimum": 0,
          "description": "Daily standing charge (lump-sum currency/day)"
        },
        "days": {
          "type": "number",
          "minimum": 0,
          "description": "Billing days for standing charge"
        },
        "fee": {
          "type": "number",
          "minimum": 0,
          "description": "Other fixed charges already calculated as a lump sum (not a tax rate)"
        }
      }
    },
    {
      "title": "meter",
      "type": "object",
      "additionalProperties": false,
      "required": [
        "mode",
        "prev",
        "curr",
        "rate"
      ],
      "properties": {
        "mode": {
          "const": "meter",
          "description": "Energy from meter delta curr−prev"
        },
        "prev": {
          "type": "number",
          "minimum": 0,
          "description": "Previous meter reading (kWh)"
        },
        "curr": {
          "type": "number",
          "minimum": 0,
          "description": "Current meter reading (kWh); must be ≥ prev or the engine returns METER_READING_DECREASED"
        },
        "rate": {
          "type": "number",
          "minimum": 0,
          "description": "Unit rate (currency/kWh)"
        },
        "standing": {
          "type": "number",
          "minimum": 0,
          "description": "Daily standing charge (lump-sum currency/day)"
        },
        "days": {
          "type": "number",
          "minimum": 0,
          "description": "Billing days for standing charge"
        },
        "fee": {
          "type": "number",
          "minimum": 0,
          "description": "Other fixed charges already calculated as a lump sum (not a tax rate)"
        }
      }
    }
  ],
  "description": "Estimate a simple electricity bill from kWh or meter readings plus rates and fees. (calculation_version 1.3.1)"
}
