{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://www.calculatorx.com/schemas/electrical.energy_cost.input.json",
  "title": "Energy cost — input",
  "type": "object",
  "oneOf": [
    {
      "title": "watts",
      "type": "object",
      "additionalProperties": false,
      "required": [
        "mode",
        "W",
        "hours",
        "days",
        "rate"
      ],
      "properties": {
        "mode": {
          "const": "watts",
          "description": "Energy from W × hours/day × days / 1000"
        },
        "W": {
          "type": "number",
          "minimum": 0,
          "description": "Power (W)"
        },
        "hours": {
          "type": "number",
          "minimum": 0,
          "maximum": 24,
          "description": "Hours per day (0–24)"
        },
        "days": {
          "type": "number",
          "minimum": 0,
          "description": "Number of days in the billing period"
        },
        "rate": {
          "type": "number",
          "minimum": 0,
          "description": "Unit rate (currency/kWh)"
        }
      }
    },
    {
      "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 (kWh)"
        },
        "rate": {
          "type": "number",
          "minimum": 0,
          "description": "Unit rate (currency/kWh)"
        }
      }
    }
  ],
  "description": "Estimate electricity cost from watts/hours or kWh and a unit rate. (calculation_version 1.4.2)"
}
