{
  "$schema": "http://json-schema.org/draft-07/schema",
  "build_version": "v10.06.005",
  "title": "MHEA Input",
  "description": "Manufactured Energy Audit Tool audit data input",
  "type": "object",
  "additionalProperties": true,

  "required": [
    "audit",
    "walls",
    "windows",
    "doors",
    "ceiling",
    "floor",
    "hvac",
    "ducts_and_infiltration",
    "weather_station",

    "fuel_costs",
    "measure_active_flags",
    "measure_costs",
    "key_parameters"
  ],

  "allOf": [{

    "oneOf": [
      {"required": ["fuel_escalation_rates_by_reference"]},
      {"required": ["fuel_escalation_rates"]}
    ]

  }],

  "properties": {

    "audit": {
      "$ref": "#/definitions/audit"
    },    
   
    "weather_station": {
      "$ref": "#/definitions/weather_station"
    },

    "walls": {
      "$ref": "#/definitions/walls"
    },
    "windows": {
      "$ref": "#/definitions/windows"
    },
    "doors": {
      "$ref": "#/definitions/doors"
    },
    "ceiling": {
      "$ref": "#/definitions/ceiling"
    },
    "floor": {
      "$ref": "#/definitions/floor"
    },

    "walls_addition": {
      "$ref": "#/definitions/walls_addition"
    },
    "windows_addition": {
      "$ref": "#/definitions/windows_addition"
    },
    "doors_addition": {
      "$ref": "#/definitions/doors_addition"
    },
    "ceiling_addition": {
      "$ref": "#/definitions/ceiling_addition"
    },
    "floor_addition": {
      "$ref": "#/definitions/floor_addition"
    },

    "hvac": {
      "$ref": "#/definitions/hvac"
    },
    "duct": {
      "$ref": "#/definitions/duct"
    },


    "ducts_and_infiltration": {
      "$ref": "#/definitions/ducts_and_infiltration"
    },

    "water_heating": {
      "$ref": "#/definitions/water_heating"
    },
    "refrigerators": {
      "$ref": "#/definitions/refrigerators"
    },
    "lighting": {
      "$ref": "#/definitions/lighting"
    },
    "itemized_costs": {
      "$ref": "#/definitions/itemized_costs"
    },

    "utility_bills_pre_retrofit_heating": {
      "$ref": "#/definitions/utility_bills_pre_retrofit_heating"
    },
    "utility_bills_pre_retrofit_heating_data": {
      "$ref": "#/definitions/utility_bills_pre_retrofit_heating_data"
    },
    "utility_bills_pre_retrofit_cooling": {
      "$ref": "#/definitions/utility_bills_pre_retrofit_cooling"
    },
    "utility_bills_pre_retrofit_cooling_data": {
      "$ref": "#/definitions/utility_bills_pre_retrofit_cooling_data"
    },

    "fuel_costs": {
      "$ref": "#/definitions/fuel_costs"
    },
    "fuel_escalation_rates_by_reference": {
      "$ref": "#/definitions/fuel_escalation_rates_by_reference"
    },
    "fuel_escalation_rates": {
      "$ref": "#/definitions/fuel_escalation_rates"
    },
    "measure_active_flags": {
      "$ref": "#/definitions/measure_active_flags"
    },
    "measure_costs": {
      "$ref": "#/definitions/measure_costs"
    },
    "key_parameters": {
      "$ref": "#/definitions/key_parameters"
    }
  },
  "if": {
    "properties": {
      "ducts_and_infiltration": {
        "properties": {
         "evaluate_duct_sealing":
         {"const": true}
        }
      }
    }
  },
  "then": {
      "required": [
        "duct"
      ]
  },
  "definitions": 
  {

    "audit": {
      "type": "object",
      "title": "Audit Information",
      "description": "General top level audit information.",
      "additionalProperties": true,
      "$comment": "The additionalProperties setting should limit any personally identifying information (PII) from the API",
      "properties": {
        "audit_type": {
          "type": "string",
          "title": "The audit type",
          "description": "Should say MHEA",
          "examples": ["MHEA"],
          "pattern": "^MHEA$"
        },
        "audit_id": {
          "type": "integer",
          "minimum": 1,
          "title": "Audit ID",
          "description": "Required integer numeric identifier for the audit, mirrored in output, but otherwise unused in analysis",
          "examples": [2344561]
        },
        "audit_number": {
          "type": "integer",
          "minimum": 1,
          "title": "Audit Number",
          "description": "An optional supplemental integer numeric identifier requried for the audit record, also mirrored in output but otherwise not used in analysis",
          "examples": [123456789]
        },
        "audit_date": {
          "type": "string",
          "title": "Audit Date",
          "description": "The audit date in ISO 6801 javascript Date.toJSON output, see MAX_APPLICABLE_YEAR in wa_engine",
          "examples": ["2012-04-23T18:25:43.511Z"]
        },
        "avg_no_occupants": {
          "type": "integer",
          "minimum": 1,
          "maximum": 9,
          "title": "The average number of occupants",
          "description": "The average number of occupants in the dwelling",
          "examples": [3]
        },
        "length": {
          "type": "number",
          "minimum": 30,
          "maximum": 100,
          "title": "Length (ft)",
          "description": "The long dimension of the home in (ft)"
        },
        "width": {
          "type": "number",
          "minimum": 8,
          "maximum": 50,
          "title": "Width (ft)",
          "description": "The short dimension of the home in (ft)"
        },
        "height": {
          "type": "number",
          "minimum": 6,
          "maximum": 10,
          "title": "Exterior Wall Height (ft)",
          "description": "The height of the home, assumed single story in  (ft)"
        },
        "wind_shielding_id": {
          "$id": "#/audit/wind_shielding",
          "type": ["integer", "string"],
          "enum": [
            1, "Well Shielded",
            2, "Normal Shielding",
            3, "Exposed"
          ],
          "title": "Wind Shielding ",
          "description": "How well is the home shielded from prevailing winds"
        },
        "wsf": {
          "type": "number",
          "minimum": 0.2,
          "maximum": 1.4,
          "title": "Wind Shielding Factor",
          "description": "The factor (weather/wind) used for ASHRAE 62.2 calculations (1/hr)",
          "examples": [0.55]
        },
        "leakiness": {
          "$id": "#/audit/leakiness",
          "type": ["integer", "string"],
          "enum": [
            1, "Tight",
            2, "Medium",
            3, "Loose"
          ],
          "title": "Home Leakiness",
          "description": "General home leakiness estimate"
        },
        "water_heater_closet": {
          "type": "boolean",
          "title": "Outdoor Water Heater Closet",
          "description": "Does the door to the water heater closet open to the outdoors",
          "examples": [true, false]
        },
        "do_billing_adjust": {
          "type": "boolean",
          "title": "Billing Adjustment",
          "description": "Should run include utility billing adjustment",
          "examples": [true, false]
        },
        "screens_removed_for_winter": {
          "type": "boolean",
          "title": "Window Sreens Removed for Winter",
          "description": "Does the occupant normally remove screens and/or open louvers for winter (default = NO)",
          "examples": [true, false]
        },
        "zipcode": {
          "type": "string",
          "title": "Zip code",
          "description": "Zip code",
          "pattern": "^[0-9]{5}-[0-9]{4}$"
        },
        "infiltration_height":{
          "type": "number",
          "minimum": 7,
          "maximum": 50,
          "title": "Inflitration Height (ft)",
          "description": "Inflitration Height (ft)"
        },
        "num_bedrooms":{
          "type": "integer",
          "minimum": 1,
          "maximum": 10,
          "title": "Number of bedrooms",
          "description": "The  number of bedrooms in the dwelling",
          "examples": [3]
        }
      },
      "required": [
        "audit_type",
        "audit_id",
        "audit_date",
        "avg_no_occupants",
        "length",
        "width",
        "height",
        "wind_shielding_id",
        "wsf",
        "leakiness",
        "zipcode"
      ]
    },

    "weather_station": {
      "type": "object",
      "title": "Weather Station Selection",
      "description": "Information on the weather station file to use.  This is the selection from the 1011 stations available for v10 weather",
      "properties": {
        "state": {
          "type": "string",
          "minLength": 2,
          "maxLength": 2,
          "title": "State Code",
          "description": "The two letter code for the state"
        },
        "city": {
          "type": "string",
          "minLength": 1,
          "maxLength": 80,
          "title": "City",
          "description": "The name of the city"
        },
        "station_id": {
          "type": "integer",
          "description": "The WMO station identifier, 6 digit"
        },
        "file": {
          "type": "string",
          "minLength": 1,
          "maxLength": 80,
          "title": "File Name",
          "description": "Name of the weather file with .JSON extension.  MUST exist in the sys/weather/v10 folder (case sensitive)",
          "examples": ["AK_Adak_AP_704540_WA.JSON"]
        },
        "wsf": {
          "type": "number",
          "minimum": 0.2,
          "maximum": 1.4,
          "title": "Wind Shielding Factor",
          "description": "The factor (weather/wind) used for ASHRAE 62.2 calculations (1/hr)",
          "examples": [0.55]
        }
      },
      "required": [
        "state",
        "city",
        "station_id",
        "file"
      ]
    },

    "walls": {
      "type": "object",
      "title": "walls",
      "description": "The wall characteristics of the manufactured/mobile home",
      "properties": {
        "stud_size": {
          "type": ["integer", "string"],
          "enum": [
            1, "2x2",
            2, "2x3",
            3, "2x4",
            4, "2x6"
          ],
          "title": "Stud Size",
          "description": "The size of the studs used in the Wall construction"
        },
        "home_orientation": {
          "$id": "#/wall/home_orientation",
          "type": ["integer", "string"],
          "enum": [
            1, "North",
            2, "South",
            3, "East",
            4, "West"
          ],
          "title": "Orientation",
          "description": "The orientation of the line perpendicular to the long wall of the home"
        },
        "wall_vent": {
          "$id": "#/walls/wall_vent",
          "type": ["integer", "string"],
          "enum": [
            1, "Vented",
            2, "Not Vented"
          ],
          "title": "Wall Ventilation",
          "description": "The type of wall ventilation"
        },
        "batt_insl": {
          "type": "number",
          "minimum": 0,
          "maximum": 10,
          "title": "Existing Insulation Batt/Blanket (in)",
          "description": "The thickness of existing batt or blanket insulation in (in)"
        },
        "loose_insl": {
          "type": "number",
          "minimum": 0,
          "maximum": 10,
          "title": "Existing Insulation Loose Fill (in)",
          "description": "The thickness of existing loose insulation in (in)"
        },
        "foam_insl": {
          "type": "number",
          "minimum": 0,
          "maximum": 10,
          "title": "Existing Insulation Foam Core (in)",
          "description": "The thickness of existing foam core insulation in (in)"
        },
        "uninsulatable_area": {
          "type": "number",
          "minimum": 0,
          "maximum": 5000,
          "title": "Uninsulatable Wall Area (sqft)",
          "description": "The area of the wall that can not be insulated (sqft)"
        },
        "porch_length": {
          "type": "number",
          "minimum": 0,
          "maximum": 100,
          "title": "Carport or Porch Roof Length (ft)",
          "description": "The length of the carport or porch roof (ft). Zero if no porch or carport.",
          "$comment": "This property should appear before porch_orientation in the JSON object."
        },
        "porch_width": {
          "type": "number",
          "minimum": 0,
          "maximum": 100,
          "title": "Carport or Porch Roof Width (ft)",
          "description": "The width of the carport or porch roof (ft). Zero if no porch or carport.",
          "$comment": "This property should appear before porch_orientation in the JSON object."
        },
        "porch_orientation": {
          "$id": "#/wall/porch_orientation",
          "type": ["integer", "string"],
          "enum": [
            1, "North",
            2, "South",
            3, "East",
            4, "West"
          ],
          "title": "Carport or Porch Orientation",
          "description": "The orientation of the line perpendicular to the long side of the carport or porch"
        },
        "add_cost": {
          "type": "number",
          "minimum": -2000,
          "maximum": 5000,
          "title": "Added Insulation Cost ($)",
          "description": "Additional cost of adding insulation to the walls"
        }
      },

      "required": [
        "stud_size",
        "home_orientation",
        "wall_vent",
        "batt_insl",
        "loose_insl",
        "foam_insl",
        "porch_length",
        "porch_width"
      ],

      "allOf": [{
        "if": {
          "not": {
            "anyOf": [
              {"properties": {"porch_length": {"const": 0 }}},
              {"properties": {"porch_width": {"const": 0 }}}
            ]
          }
        },
        "then": {
          "required": ["porch_orientation"]
        }
      }]
    },

    "windows": {
      "type": "array",
      "title": "Windows",
      "description": "The list of windows in the building shell",
      "minItems": 0,
      "maxItems": 18,
      "uniqueItems": true,
      "additionalItems": false,
      "additionalProperties": true,
      "items": {
        "type": "object",
        "properties": {
          "code": {
            "type": "string",
            "minLength": 1,
            "maxLength": 20,
            "title": "Window Code",
            "description": "The short code for this window (must be unique for windows on each wall), no commas",
            "examples": ["WD1"],
            "pattern": "^[^,]+$",
            "$comment": "The maxLength should match CODE_LEN"
          },
          "window_type": {
            "$id": "#/windows/window_type",
            "type": ["integer", "string"],
            "enum": [
              1, "Jalousie",
              2, "Awning",
              3, "Slider",
              4, "Fixed",
              5, "Door Window",
              6, "Sliding Glass Door",
              7, "Skylight"
            ],
            "title": "Window Type",
            "description": "The window type"
          },
          "frame_type": {
            "$id": "#/windows/frame_type",
            "type": ["integer", "string"],
            "enum": [
              1, "Wood",
              2, "Metal",
              3, "Improved Metal",
              4, "Vinyl",
              5, "Fiberglass"
            ],
            "title": "Frame Type",
            "description": "The window frame type",
            "$comment": "Item 1 was (Wood, Vinyl, or Fiberglass) changed to just Wood at v10.04.001 for E+ disambiguation"
          },
          "glazing_type": {
            "$id": "#/windows/glazing_type",
            "type": ["integer", "string"],
            "enum": [
              1, "Single Pane",
              2, "Double Pane",
              3, "Double Pane Low-e"
            ],
            "title": "Glazing Type",
            "description": "The window glazing type,  Storm window info now separate as of v10.04.01",
            "$comment": "Modified at v10.04.001 replacing the old glazing_type etable values. NOT a positive delta!"
          },
          "storm_type": {
            "$id": "#/windows/storm_type",
            "type": ["integer", "string"],
            "enum": [
              1, "None",
              2, "Clear",
              3, "Low-e"
            ],
            "title": "Storm Window Type",
            "description": "The existing storm window type"
          },
          "int_shading": {
            "$id": "#/windows/int_shading",
            "type": ["integer", "string"],
            "enum": [
              1, "Drapes",
              2, "Blinds or Shades",
              3, "Drapes with Blinds or Shades",
              4, "None"
            ],
            "title": "Interior Shading",
            "description": "The type of interior shading for the window"
          },
          "ext_shading": {
            "$id": "#/windows/ext_shading",
            "type": ["integer", "string"],
            "enum": [
              1, "None",
              2, "Overhang or Awning",
              3, "Carport or Porch",
              4, "Low-e Film",
              5, "Sun Screen Fabric",
              6, "Sun Screen Louvered"
            ],
            "title": "Exterior Shading",
            "description": "The type of exterior shading for the window. Added v10.04.001. The variable (shade) has been removed."
          },
          "overhang_projection": {
            "type": "number",
            "minimum": 0,
            "maximum": 50,
            "title": "Overhang projection (in)",
            "description": "Existing overhang horizontal projection. Added v10.04.001. Only for ext_shading = Overhang or Awning"
          },
          "overhang_offset": {
            "type": "number",
            "minimum": 0,
            "maximum": 50,
            "title": "Overhang offset (in)",
            "description": "Vertical distance from window lintel (top) to bottom of overhang. Horizontal overhang assumed. Added v10.04.001. Only for ext_shading = Overhang or Awning"
          },
          "leak": {
            "$id": "#/windows/leak",
            "type": ["integer", "string"],
            "enum": [
              1, "Very Tight",
              2, "Tight",
              3, "Medium",
              4, "Loose",
              5, "Very Loose"
            ],
            "title": "Leakiness",
            "description": "General window and frame leakiness estimate"
          },
          "width": {
            "type": "number",
            "minimum": 4,
            "maximum": 90,
            "title": "Width (in)",
            "description": "Width in inches"
          },
          "height": {
            "type": "number",
            "minimum": 4,
            "maximum": 90,
            "title": "Height (in)",
            "description": "Height in inches"
          },

          "num_n": {
            "type": "number",
            "minimum": 0,
            "maximum": 9,
            "title": "Number Facing North",
            "description": "Number of identical windows of this type facing North"
          },
          "num_s": {
            "type": "number",
            "minimum": 0,
            "maximum": 9,
            "title": "Number Facing South",
            "description": "Number of identical windows of this type facing South"
          },
          "num_e": {
            "type": "number",
            "minimum": 0,
            "maximum": 9,
            "title": "Number Facing East",
            "description": "Number of identical windows of this type facing East"
          },
          "num_w": {
            "type": "number",
            "minimum": 0,
            "maximum": 9,
            "title": "Number Facing West",
            "description": "Number of identical windows of this type facing West"
          },
          "num_roof": {
            "type": "number",
            "minimum": 0,
            "maximum": 9,
            "title": "Number of skylights on roof",
            "description": "Number of identical skylights on roof"
          },

          "weatherize_evaluate": {
            "type": "boolean",
            "title": "Evaluate Weatherize Window",
            "description": "Consider window weatherizaton and sort in package by SIR"
          },
          "weatherize_required": {
            "type": "boolean",
            "title": "Weatherize Window Required",
            "description": "Require the window weatherization as H&S or Repair regardless of SIR"
          },
          "weatherize_inc_sir": {
            "type": "boolean",
            "title": "Weatherize Window Required Include in SIR",
            "description": "The required window weatherization SIR should be included in the package SIR"
          },
          "weatherize_additional_cost": {
            "type": "number",
            "minimum": -200,
            "maximum": 200,
            "title": "Weatherization added cost ($/window)",
            "description": "Additional per window cost to seal/weatherize"
          },

          "replace_evaluate": {
            "type": "boolean",
            "title": "Evaluate Window Replacement",
            "description": "Consider window replacement and sort in package by SIR"
          },
          "replace_required": {
            "type": "boolean",
            "title": "Window Replacement Required",
            "description": "Require the window replacement as H&S or Repair regardless of SIR"
          },
          "replace_inc_sir": {
            "type": "boolean",
            "title": "The Window Required Replacement Include in SIR",
            "description": "The required window replacement SIR should be included in the package SIR"
          },
          "replace_additional_cost": {
            "type": "number",
            "minimum": -200,
            "maximum": 2000,
            "title": "Replacement added cost ($/window)",
            "description": "Additional per window cost to replace"
          },
          "replace_glaze_type": {
            "$id": "#/windows/replace_glaze_type",
            "type": ["integer", "string"],
            "enum": [
              2, "Double Pane",
              3, "Double Pane Low-e"
            ],
            "title": "Replacement Glazing Type",
            "description": "The replacment window glazing type"
          },
          "replace_u_value": {
            "type": "number",
            "minimum": 0.01,
            "maximum": 20,
            "title": "Replacement window U-Value",
            "description": "The nominal U-Value for the replacement window"
          },
          "replace_shgc": {
            "type": "number",
            "minimum": 0.01,
            "maximum": 1.0,
            "title": "Replacement window Solar Heat Gain Coefficient (SHGC)",
            "description": "The nominal SHGC for the replacement window"
          },

          "add_storm_evaluate": {
            "type": "boolean",
            "title": "Evaluate Adding Storm Window",
            "description": "Consider adding storm and sort in package by SIR"
          },
          "add_storm_required": {
            "type": "boolean",
            "title": "Adding Storm Required",
            "description": "Require the addition of storm windows as H&S or Repair regardless of SIR"
          },
          "add_storm_inc_sir": {
            "type": "boolean",
            "title": "The Window Required Replacement Include in SIR",
            "description": "The required window replacement SIR should be included in the package SIR"
          },
          "add_storm_additional_cost": {
            "type": "number",
            "minimum": -200,
            "maximum": 200,
            "title": "Replacement added cost ($/window)",
            "description": "Additional per window cost to replace"
          },
          "add_storm_type": {
            "$id": "#/windows/add_storm_type",
            "type": ["integer", "string"],
            "enum": [
              2, "Clear",
              3, "Low-e High Gain",
              4, "Low-e Low Gain"
            ],
            "title": "Retrofit Storm Window Type",
            "description": "The existing storm window type"
          },

          "add_awning_evaluate": {
            "type": "boolean",
            "title": "Evaluate Adding Awning",
            "description": "Consider adding awning and sort in package by SIR"
          },
          "add_awning_additional_cost": {
            "type": "number",
            "minimum": -200,
            "maximum": 200,
            "title": "Replacement added cost ($/window)",
            "description": "Additional per window cost to replace"
          },
          "add_awning_overhang_projection": {
            "type": "number",
            "minimum": 0,
            "maximum": 50,
            "title": "Horizontal Projection (inches)",
            "description": "Distance from wall to end of overhang (horizontal inches)"
          },
          "add_awning_overhang_offset": {
            "type": "number",
            "minimum": 0,
            "maximum": 50,
            "title": "Distance from Lintel(inches)",
            "description": "Distance from lintel (top) to bottom of overhang (vertial inches)"
          },

          "add_ext_shading_evaluate": {
            "type": "boolean",
            "title": "Evaluate Adding Exterior Shading",
            "description": "Should addtion of external shading device be evaluated for inclusion by SIR"
          },
          "add_ext_shading_additional_cost": {
            "type": "number",
            "minimum": -200,
            "maximum": 200,
            "title": "External Shading Added Cost ($/window)",
            "description": "Additional per window cost for external shading"
          },
          "add_ext_shading_type": {
            "$id": "#/windows/add_ext_shading_type",
            "type": ["integer", "string"],
            "enum": [
              4, "Low-e Film",
              5, "Sun Screen Fabric",
              6, "Sun Screen Louvered"
            ],
            "title": "Added Exterior Shading",
            "description": "The type of exterior shading to add to the window."
          }
        },

        "required": [
          "code",
          "window_type",
          "frame_type",
          "glazing_type",
          "storm_type",
          "int_shading",
          "ext_shading",
          "leak",
          "width",
          "height",
          "weatherize_evaluate",
          "replace_evaluate",
          "add_storm_evaluate",
          "add_awning_evaluate",
          "add_ext_shading_evaluate"
        ],

        "allOf": [{

          "if": {
            "anyOf": [
              {"properties": {"ext_shading": {"const": 2 }}},
              {"properties": {"ext_shading": {"const": "Overhang or Awning" }}}
            ]
          },
            "then": {
              "required": ["overhang_projection", "overhang_offset"]
          }

        },{

          "if": {
            "anyOf": [
              {"properties": {"window_type": {"const": 7 }}},
              {"properties": {"window_type": {"const": "Skylight" }}}
            ]
          },
            "then": {
              "required": ["num_roof"]
          },
          "else": {
            "required": ["num_n", "num_s", "num_e", "num_w"]
          }

        },{

          "if": {
            "properties": {"weatherize_evaluate": {"const": true }}
          },
          "then": {
            "required": ["weatherize_required", "weatherize_additional_cost"],
            "if": {
              "properties": {"weatherize_required": {"const": true }}
            },
              "then": {
                "required": ["weatherize_inc_sir"]
            }
          }

        },{

          "if": {
            "properties": {"replace_evaluate": {"const": true }}
          },
          "then": {
            "required": [
              "replace_required", 
              "replace_additional_cost", 
              "replace_glaze_type", 
              "replace_u_value", 
              "replace_shgc"],
            "if": {
              "properties": {"replace_required": {"const": true }}
            },
              "then": {
                "required": ["replace_inc_sir"]
            }
          }

        },{

          "if": {
            "properties": {"add_storm_evaluate": {"const": true }}
          },
          "then": {
            "required": [
              "add_storm_required", 
              "add_storm_additional_cost", 
              "add_storm_type"],
            "if": {
              "properties": {"add_storm_required": {"const": true }}
            },
              "then": {
                "required": ["add_storm_inc_sir"]
            }
          }

        },{

          "if": {
            "properties": {"add_awning_evaluate": {"const": true }}
          },
          "then": {
            "required": [
              "add_awning_additional_cost", 
              "add_awning_overhang_projection", 
              "add_awning_overhang_offset"]
          }

        },{

          "if": {
            "properties": {"add_ext_shading_evaluate": {"const": true }}
          },
          "then": {
            "required": ["add_ext_shading_additional_cost", "add_ext_shading_type"]
          }
        }]

      }
    },

    "doors": {
      "type": "array",
      "title": "Doors",
      "description": "The list of doors in the building shell",
      "minItems": 0,
      "maxItems": 10,
      "uniqueItems": true,
      "items": {
        "type": "object",
        "properties": {
          "code": {
            "type": "string",
            "minLength": 1,
            "maxLength": 20,
            "title": "Door Code",
            "description": "The short unique code for this door, no commas",
            "examples": ["DR1"],
            "pattern": "^[^,]+$"
          },
          "door_type": {
            "$id": "#/doors/door_type",
            "type": ["integer", "string"],
            "enum": [
              2, "Hollow Core Wood",
              1, "Solid Core Wood",
              3, "Standard Manufactured Home Door",
              4, "Insulated Steel"
            ],
            "title": "Door Type",
            "description": "Type of door"
          },
          "leakiness": {
            "$id": "#/doors/leakiness",
            "type": ["integer", "string"],
            "enum": [
              1, "Tight",
              2, "Medium",
              3, "Loose"
            ],
            "title": "Leakiness",
            "description": "Leakiness of door in manufactured home"
          },
          "storm": {
            "type": "boolean",
            "title": "Storm Door Present",
            "description": "Is there a storm door present",
            "examples": [true, false]
          },
          "width": {
            "type": "number",
            "minimum": 18,
            "maximum": 100,
            "title": "Width (in)",
            "description": "Width of door (in)"
          },
          "height": {
            "type": "number",
            "minimum": 18,
            "maximum": 100,
            "title": "Height)",
            "description": "Height of door (in)"
          },
          "num_n": {
            "type": "number",
            "minimum": 0,
            "maximum": 9,
            "title": "Number Facing North",
            "description": "Number of identical doors of this type facing North"
          },
          "num_s": {
            "type": "number",
            "minimum": 0,
            "maximum": 9,
            "title": "Number Facing South",
            "description": "Number of identical doors of this type facing South"
          },
          "num_e": {
            "type": "number",
            "minimum": 0,
            "maximum": 9,
            "title": "Number Facing East",
            "description": "Number of identical doors of this type facing East"
          },
          "num_w": {
            "type": "number",
            "minimum": 0,
            "maximum": 9,
            "title": "Number Facing West",
            "description": "Number of identical doors of this type facing West"
          },
          "replace": {
            "type": "boolean",
            "title": "Replacement Door Required",
            "description": "Require replacement door measure",
            "examples": [true, false]
          },
          "inc_sir": {
            "type": "boolean",
            "title": "Include in SIR",
            "description": "Include this door replacement in overall SIR",
            "examples": [true, false]
          },
          "cost_replace": {
            "type": "number",
            "minimum": -500,
            "maximum": 500,
            "title": "Additional Cost ($/door)",
            "description": "Additional replacement cost per door"
          }
        },
        "required": [
          "code",
          "door_type",
          "leakiness",
          "width",
          "height",
          "num_n",
          "num_s",
          "num_e",
          "num_w"
        ]
      }
    },

    "ceiling": {
      "type": "object",
      "title": "Ceiling and Roof",
      "description": "The ceiling/roof information for the home",
      "properties": {
        "roof_type": {
          "$id": "#/ceiling/roof_type",
          "type": ["integer", "string"],
          "enum": [
            1, "Flat",
            2, "Bowstring",
            3, "Pitched"
          ],
          "title": "Roof Type",
          "description": "The type of roof/ceiling construction",
          "$comment": "This property should appear first in the JSON object."
        },
        "roof_color": {
          "$id": "#/ceiling/roof_color",
          "type": ["integer", "string"],
          "enum": [
            1, "White, Reflective, or Shaded",
            2, "Normal or Weathered"
          ],
          "title": "Roof Color",
          "description": "The color of the roof"
        },
        "joist_size": {
          "$id": "#/ceiling/joist_size",
          "type": ["integer", "string"],
          "enum": [
            1, "2 x 4",
            2, "2 x 6",
            3, "2 x 8"
          ],
          "title": "Joist Size",
          "description": "Roof/ceiling joist size"
        },
        "ceiling_height": {
          "type": "number",
          "minimum": 5,
          "maximum": 30,
          "title": "Height of Bowstring Roof at Center (in)",
          "description": "The height of the pitched or bowstring roof measured from the ceiling to the peak of the roof (in)"
        },
        "pitch_add_insl": {
          "type": "number",
          "minimum": 0,
          "maximum": 20,
          "title": "Insulation to Add at Center (in)",
          "description": "The amount of insulation to add to Pitched Roof attic space (in)"
        },
        "mineral_insl": {
          "type": "number",
          "minimum": 0,
          "maximum": 20,
          "title": "Existing Insulation Batt/Blanket (in)",
          "description": "Thickness of batt or blanket ceiling insulation (in)"
        },
        "loose_insl": {
          "type": "number",
          "minimum": 0,
          "maximum": 20,
          "title": "Existing Insulation Loose Fill (in)",
          "description": "Thickness of loose or fill insulation (in)"
        },
        "rigid_insl": {
          "type": "number",
          "minimum": 0,
          "maximum": 20,
          "title": "Existing Insulation Foam Core (in)",
          "description": "Thickness of foam core insulation (in)"
        },
        "cathedral_ceiling": {
          "type": "number",
          "minimum": 0,
          "maximum": 100,
          "title": "Cathedral Ceiling (%)",
          "description": "Percent of the ceiling area that is cathedral/vaulted (%)",
          "$comment": "This property should appear before the step_wall property in the JSON object"
        },
        "step_wall": {
          "$id": "#/ceiling/step_wall",
          "type": ["integer", "string"],
          "enum": [ 0,
            1, "North",
            2, "South",
            3, "East",
            4, "West",
            5, "No Step Wall"
          ],
          "title": "Step Wall Orientation",
          "description": "The orientation of cathedral ceiling step wall"
        },
        "add_cost": {
          "type": "number",
          "minimum": -2000,
          "maximum": 5000,
          "title": "Additional Cost ($)",
          "description": "Additional cost of added Insulation"
        }
      },
      "required": [
        "roof_type",
        "roof_color",
        "cathedral_ceiling"
      ],

      "allOf": [{

        "if": {
          "anyOf": [
            {"properties": {"roof_type": {"const": 1 }}},
            {"properties": {"roof_type": {"const": "Flat" }}}
          ]
        },
        "then": {
          "required": ["joist_size"],
          "if": {
            "not": {
              "properties": {"cathedral_ceiling": {"const": 0 }}
            }
          },
          "then": {
            "required": ["step_wall"]
          }
        }

      },{

        "if": {
          "anyOf": [
            {"properties": {"roof_type": {"const": 2 }}},
            {"properties": {"roof_type": {"const": "Bowstring" }}}
          ]
        },
        "then": {
          "required": ["ceiling_height"]
        }

      },{

        "if": {
          "anyOf": [
            {"properties": {"roof_type": {"const": 3 }}},
            {"properties": {"roof_type": {"const": "Pitched" }}}
          ]
        },
        "then": {
          "required": ["pitch_add_insl"],
          "if": {
            "not": {
              "properties": {"cathedral_ceiling": {"const": 0 }}
            }
          },
          "then": {
            "required": ["step_wall"]
          }
        }

      }]
    },

   "floor": {
      "type": "object",
      "title": "Floor information",
      "description": "The floor and belly information for the home",
      "properties": {
        "skirt": {
          "type": "boolean",
          "title": "Skirt Present",
          "description": "Does the home have a skirt",
          "examples": [true, false]
        },
        "wing_joist_size": {
          "$id": "#/floor/wing_joist_size",
          "type": ["integer", "string"],
          "enum": [
            1, "2 x 4",
            2, "2 x 6",
            3, "2 x 8"
          ],
          "title": "Floor Wing Joist Size",
          "description": "Size of the wing floor joists"
        },
        "wing_loose_insl": {
          "type": "number",
          "minimum": 0,
          "maximum": 20,
          "title": "Loose Insulation Thickness (in)",
          "description": "Thickness of loose insulation in the wing (in)"
        },
        "wing_insl_location": {
          "$id": "#/floor/wing_insl_location",
          "type": ["integer", "string"],
          "enum": [
            1, "Attached to Flooring",
            2, "Between Joists",
            3, "Attached Under Joists",
            5, "None"
          ],
          "title": "Wing Batt/Blanket Insulation Location",
          "description": "Location of the insulation in the wing"
        },
        "wing_mineral_insl": {
          "type": "number",
          "minimum": 0,
          "maximum": 20,
          "title": "Batt/Blanket Thickness (in)",
          "description": "Thickness of the batt or blanket insulation in the wing (in)"
        },
        "belly_joist_size": {
          "$id": "#/floor/belly_joist_size",
          "type": ["integer", "string"],
          "enum": [
            1, "2 x 4",
            2, "2 x 6",
            3, "2 x 8"
          ],
          "title": "Floor Belly Joist Size",
          "description": "Size of the belly floor joists"
        },
        "belly_cavity": {
          "$id": "#/floor/belly_cavity",
          "type": ["integer", "string"],
          "enum": [
            1, "Square",
            2, "Rounded",
            3, "Flat"
          ],
          "title": "Belly Cavity Configuration",
          "description": "Belly cavity configuration"
        },
        "belly_condition": {
          "$id": "#/floor/belly_condition",
          "type": ["integer", "string"],
          "enum": [
            1, "Good",
            2, "Average",
            3, "Poor"
          ],
          "title": "Condition of Belly",
          "description": "Belly condition"
        },
        "belly_depth": {
          "type": "number",
          "minimum": 0,
          "maximum": 48,
          "title": "Maximum Depth of Belly Cavity (in)",
          "description": "Depth of belly cavity (in)"
        },
        "belly_loose_insl": {
          "type": "number",
          "minimum": 0,
          "maximum": 20,
          "title": "Loose Insulation Thickness (in)",
          "description": "Thickness of loose insulation in the belly (in)"
        },
        "belly_insl_location": {
          "$id": "#/floor/belly_insl_location",
          "type": ["integer", "string"],
          "enum": [
            1, "Attached to Flooring",
            2, "Between Joists",
            3, "Attached Under Joists",
            4, "Draped Below Joists",
            5, "None"
          ],
          "title": "Belly Batt/Blanket Insulation Location",
          "description": "Location of the insulation in the wing"
        },
        "belly_mineral_insl": {
          "type": "number",
          "minimum": 0,
          "maximum": 20,
          "title": "Batt/Blanket Thickness (in)",
          "description": "Thickness of the batt or blanket insulation in the belly (in)"
        },
        "add_cost": {
          "type": "number",
          "minimum": -2000,
          "maximum": 5000,
          "title": "Floor Additional Cost ($)",
          "description": "Additional cost for adding insulation (exclusive of actual insulation material and labor costs)"
        }
      },
      "required": [
        "wing_joist_size",
        "wing_insl_location",
        "wing_loose_insl",
        "belly_joist_size",
        "belly_cavity",
        "belly_condition",
        "belly_depth",
        "belly_insl_location",
        "belly_loose_insl"
      ],

      "allOf": [{

        "if": {
          "not": {
            "anyOf": [
              {"properties": {"wing_insl_location": {"const": 5 }}},
              {"properties": {"wing_insl_location": {"const": "None" }}}
            ]
          }
        },
        "then": {
          "required":[
            "wing_mineral_insl"
          ]
        }

      },{

        "if": {
          "not": {
            "anyOf": [
              {"properties": {"belly_insl_location": {"const": 5 }}},
              {"properties": {"belly_insl_location": {"const": "None" }}}
            ]
          }
        },
        "then": {
          "required":[
            "belly_mineral_insl"
          ]
        }

      }]
    },


    "walls_addition": {
      "type": "object",
      "title": "walls",
      "description": "The wall characteristics of the manufactured/mobile home",
      "properties": {
        "stud_size": {
          "$id": "#/walls_addition/stud_size",
          "type": ["integer", "string"],
          "enum": [
            1, "2x2",
            2, "2x3",
            3, "2x4",
            4, "2x6"
          ],
          "title": "Stud Size",
          "description": "The size of the studs used in the Wall construction"
        },
        "orientation": {
          "$id": "#/walls_addition/orientation",
          "type": ["integer", "string"],
          "enum": [
            1, "North",
            2, "South",
            3, "East",
            4, "West"
          ],
          "title": "Addition Orientation",
          "description": "The orientation of the line perpendicular one long wall of the addition"
        },
        "wall_vent": {
          "$id": "#/walls_addition/wall_vent",
          "type": ["integer", "string"],
          "enum": [
            1, "Vented",
            2, "Not Vented"
          ],
          "title": "Wall Ventilation",
          "description": "The type of wall ventilation"
        },
        "batt_insl": {
          "type": "number",
          "minimum": 0,
          "maximum": 10,
          "title": "Existing Insulation Batt/Blanket (in)",
          "description": "The thickness of existing batt or blanket insulation in (in)"
        },
        "loose_insl": {
          "type": "number",
          "minimum": 0,
          "maximum": 10,
          "title": "Existing Insulation Loose Fill (in)",
          "description": "The thickness of existing loose insulation in (in)"
        },
        "foam_insl": {
          "type": "number",
          "minimum": 0,
          "maximum": 10,
          "title": "Existing Insulation Foam Core (in)",
          "description": "The thickness of existing foam core insulation in (in)"
        },
        "wall_config": {
          "$id": "#/walls_addition/wall_config",
          "type": ["integer", "string"],
          "enum": [
          1, "Maximum Wall Height at Interior Wall",
          2, "Maximum Wall Height in Center of Addition",
          3, "All Addition Walls the Same Height"
          ],
          "title": "Wall Configuration",
          "description": "Configuration of the addition walls"
        },
        "height_max": {
          "type": "number",
          "minimum": 6,
          "maximum": 10,
          "title": "Max Height (ft)",
          "description": "The maximum interior wall height (ft)"
        },
        "height_min": {
          "type": "number",
          "minimum": 6,
          "maximum": 10,
          "title": "Min Height (ft)",
          "description": "The minimum interior wall height (ft)"
        },
        "add_cost": {
          "type": "number",
          "minimum": -2000,
          "maximum": 5000,
          "title": "Added Insulation Cost ($)",
          "description": "Additional cost of adding insulation to the walls"
        }
      },
      "required": [
        "stud_size",
        "orientation",
        "wall_vent",
        "batt_insl",
        "loose_insl",
        "foam_insl",
        "wall_config",
        "height_max",
        "height_min"
      ]
    },

    "windows_addition": {
      "type": "array",
      "title": "Windows",
      "description": "The list of windows in the building shell",
      "minItems": 0,
      "maxItems": 18,
      "uniqueItems": true,
      "additionalItems": false,
      "additionalProperties": true,
      "items": {
        "type": "object",
        "properties": {
          "code": {
            "type": "string",
            "minLength": 1,
            "maxLength": 20,
            "title": "Window Code",
            "description": "The short code for this window (must be unique for windows on each wall), no commas",
            "examples": ["WD1"],
            "pattern": "^[^,]+$",
            "$comment": "The maxLength should match CODE_LEN"
          },
          "window_type": {
            "$id": "#/windows_addition/window_type",
            "type": ["integer", "string"],
            "enum": [
              1, "Jalousie",
              2, "Awning",
              3, "Slider",
              4, "Fixed",
              5, "Door Window",
              6, "Sliding Glass Door",
              7, "Skylight"
            ],
            "title": "Window Type",
            "description": "The window type"
          },
          "frame_type": {
            "$id": "#/windows_addition/frame_type",
            "type": ["integer", "string"],
            "enum": [
              1, "Wood",
              2, "Metal",
              3, "Improved Metal",
              4, "Vinyl",
              5, "Fiberglass"
            ],
            "title": "Frame Type",
            "description": "The window frame type",
            "$comment": "Item 1 was (Wood, Vinyl, or Fiberglass) changed to just Wood at v10.04.001 for E+ disambiguation"
          },
          "glazing_type": {
            "$id": "#/windows_addition/glazing_type",
            "type": ["integer", "string"],
            "enum": [
              1, "Single Pane",
              2, "Double Pane",
              3, "Double Pane Low-e"
            ],
            "title": "Glazing Type",
            "description": "The window glazing type,  Storm window info now separate as of v10.04.01",
            "$comment": "Modified at v10.04.001 replacing the old glazing_type etable values. NOT a positive delta!"
          },
          "storm_type": {
            "$id": "#/windows_addition/storm_type",
            "type": ["integer", "string"],
            "enum": [
              1, "None",
              2, "Clear",
              3, "Low-e"
            ],
            "title": "Storm Window Type",
            "description": "The existing storm window type"
          },
          "int_shading": {
            "$id": "#/windows_addition/int_shading",
            "type": ["integer", "string"],
            "enum": [
              1, "Drapes",
              2, "Blinds or Shades",
              3, "Drapes with Blinds or Shades",
              4, "None"
            ],
            "title": "Interior Shading",
            "description": "The type of interior shading for the window"
          },
          "ext_shading": {
            "$id": "#/windows_addition/ext_shading",
            "type": ["integer", "string"],
            "enum": [
              1, "None",
              2, "Overhang or Awning",
              3, "Carport or Porch",
              4, "Low-e Film",
              5, "Sun Screen Fabric",
              6, "Sun Screen Louvered"
            ],
            "title": "Exterior Shading",
            "description": "The type of exterior shading for the window. Added v10.04.001. The variable (shade) has been removed."
          },
          "overhang_projection": {
            "type": "number",
            "minimum": 0,
            "maximum": 50,
            "title": "Overhang projection (in)",
            "description": "Existing overhang horizontal projection. Added v10.04.001. Only for ext_shading = Overhang or Awning"
          },
          "overhang_offset": {
            "type": "number",
            "minimum": 0,
            "maximum": 50,
            "title": "Overhang offset (in)",
            "description": "Vertical distance from window lintel (top) to bottom of overhang. Horizontal overhang assumed. Added v10.04.001. Only for ext_shading = Overhang or Awning"
          },
          "leak": {
            "$id": "#/windows_addition/leak",
            "type": ["integer", "string"],
            "enum": [
              1, "Very Tight",
              2, "Tight",
              3, "Medium",
              4, "Loose",
              5, "Very Loose"
            ],
            "title": "Leakiness",
            "description": "General window and frame leakiness estimate"
          },
          "width": {
            "type": "number",
            "minimum": 4,
            "maximum": 90,
            "title": "Width (in)",
            "description": "Width in inches"
          },
          "height": {
            "type": "number",
            "minimum": 4,
            "maximum": 90,
            "title": "Height (in)",
            "description": "Height in inches"
          },

          "num_n": {
            "type": "number",
            "minimum": 0,
            "maximum": 9,
            "title": "Number Facing North",
            "description": "Number of identical windows of this type facing North"
          },
          "num_s": {
            "type": "number",
            "minimum": 0,
            "maximum": 9,
            "title": "Number Facing South",
            "description": "Number of identical windows of this type facing South"
          },
          "num_e": {
            "type": "number",
            "minimum": 0,
            "maximum": 9,
            "title": "Number Facing East",
            "description": "Number of identical windows of this type facing East"
          },
          "num_w": {
            "type": "number",
            "minimum": 0,
            "maximum": 9,
            "title": "Number Facing West",
            "description": "Number of identical windows of this type facing West"
          },
          "num_roof": {
            "type": "number",
            "minimum": 0,
            "maximum": 9,
            "title": "Number of skylights on roof",
            "description": "Number of identical skylights on roof"
          },

          "weatherize_evaluate": {
            "type": "boolean",
            "title": "Evaluate Weatherize Window",
            "description": "Consider window weatherizaton and sort in package by SIR"
          },
          "weatherize_required": {
            "type": "boolean",
            "title": "Weatherize Window Required",
            "description": "Require the window weatherization as H&S or Repair regardless of SIR"
          },
          "weatherize_inc_sir": {
            "type": "boolean",
            "title": "Weatherize Window Required Include in SIR",
            "description": "The required window weatherization SIR should be included in the package SIR"
          },
          "weatherize_additional_cost": {
            "type": "number",
            "minimum": -200,
            "maximum": 200,
            "title": "Weatherization added cost ($/window)",
            "description": "Additional per window cost to seal/weatherize"
          },

          "replace_evaluate": {
            "type": "boolean",
            "title": "Evaluate Window Replacement",
            "description": "Consider window replacement and sort in package by SIR"
          },
          "replace_required": {
            "type": "boolean",
            "title": "Window Replacement Required",
            "description": "Require the window replacement as H&S or Repair regardless of SIR"
          },
          "replace_inc_sir": {
            "type": "boolean",
            "title": "The Window Required Replacement Include in SIR",
            "description": "The required window replacement SIR should be included in the package SIR"
          },
          "replace_additional_cost": {
            "type": "number",
            "minimum": -200,
            "maximum": 2000,
            "title": "Replacement added cost ($/window)",
            "description": "Additional per window cost to replace"
          },
          "replace_glaze_type": {
            "$id": "#/windows_addition/replace_glaze_type",
            "type": ["integer", "string"],
            "enum": [
              2, "Double Pane",
              3, "Double Pane Low-e"
            ],
            "title": "Replacement Glazing Type",
            "description": "The replacment window glazing type"
          },
          "replace_u_value": {
            "type": "number",
            "minimum": 0.01,
            "maximum": 20,
            "title": "Replacement window U-Value",
            "description": "The nominal U-Value for the replacement window"
          },
          "replace_shgc": {
            "type": "number",
            "minimum": 0.01,
            "maximum": 1.0,
            "title": "Replacement window Solar Heat Gain Coefficient (SHGC)",
            "description": "The nominal SHGC for the replacement window"
          },

          "add_storm_evaluate": {
            "type": "boolean",
            "title": "Evaluate Adding Storm Window",
            "description": "Consider adding storm and sort in package by SIR"
          },
          "add_storm_required": {
            "type": "boolean",
            "title": "Adding Storm Required",
            "description": "Require the addition of storm windows as H&S or Repair regardless of SIR"
          },
          "add_storm_inc_sir": {
            "type": "boolean",
            "title": "The Window Required Replacement Include in SIR",
            "description": "The required window replacement SIR should be included in the package SIR"
          },
          "add_storm_additional_cost": {
            "type": "number",
            "minimum": -200,
            "maximum": 200,
            "title": "Replacement added cost ($/window)",
            "description": "Additional per window cost to replace"
          },
          "add_storm_type": {
            "$id": "#/windows_addition/add_storm_type",
            "type": ["integer", "string"],
            "enum": [
              2, "Clear",
              3, "Low-e High Gain",
              4, "Low-e Low Gain"
            ],
            "title": "Retrofit Storm Window Type",
            "description": "The existing storm window type"
          },

          "add_awning_evaluate": {
            "type": "boolean",
            "title": "Evaluate Adding Awning",
            "description": "Consider adding awning and sort in package by SIR"
          },
          "add_awning_additional_cost": {
            "type": "number",
            "minimum": -200,
            "maximum": 200,
            "title": "Replacement added cost ($/window)",
            "description": "Additional per window cost to replace"
          },
          "add_awning_overhang_projection": {
            "type": "number",
            "minimum": 0,
            "maximum": 50,
            "title": "Horizontal Projection (inches)",
            "description": "Distance from wall to end of overhang (horizontal inches)"
          },
          "add_awning_overhang_offset": {
            "type": "number",
            "minimum": 0,
            "maximum": 50,
            "title": "Distance from Lintel(inches)",
            "description": "Distance from lintel (top) to bottom of overhang (vertial inches)"
          },

          "add_ext_shading_evaluate": {
            "type": "boolean",
            "title": "Evaluate Adding Exterior Shading",
            "description": "Should addtion of external shading device be evaluated for inclusion by SIR"
          },
          "add_ext_shading_additional_cost": {
            "type": "number",
            "minimum": -200,
            "maximum": 200,
            "title": "External Shading Added Cost ($/window)",
            "description": "Additional per window cost for external shading"
          },
          "add_ext_shading_type": {
            "$id": "#/windows_addition/add_ext_shading_type",
            "type": ["integer", "string"],
            "enum": [
              4, "Low-e Film",
              5, "Sun Screen Fabric",
              6, "Sun Screen Louvered"
            ],
            "title": "Added Exterior Shading",
            "description": "The type of exterior shading to add to the window."
          }
        },

        "required": [
          "code",
          "window_type",
          "frame_type",
          "glazing_type",
          "storm_type",
          "int_shading",
          "ext_shading",
          "leak",
          "width",
          "height",
          "weatherize_evaluate",
          "replace_evaluate",
          "add_storm_evaluate",
          "add_awning_evaluate",
          "add_ext_shading_evaluate"
        ],

        "allOf": [{

          "if": {
            "anyOf": [
              {"properties": {"ext_shading": {"const": 2 }}},
              {"properties": {"ext_shading": {"const": "Overhang or Awning" }}}
            ]
          },
            "then": {
              "required": ["overhang_projection", "overhang_offset"]
          }

        },{

          "if": {
            "anyOf": [
              {"properties": {"window_type": {"const": 7 }}},
              {"properties": {"window_type": {"const": "Skylight" }}}
            ]
          },
            "then": {
              "required": ["num_roof"]
          },
          "else": {
            "required": ["num_n", "num_s", "num_e", "num_w"]
          }

        },{

          "if": {
            "properties": {"weatherize_evaluate": {"const": true }}
          },
          "then": {
            "required": ["weatherize_required", "weatherize_additional_cost"],
            "if": {
              "properties": {"weatherize_required": {"const": true }}
            },
              "then": {
                "required": ["weatherize_inc_sir"]
            }
          }

        },{

          "if": {
            "properties": {"replace_evaluate": {"const": true }}
          },
          "then": {
            "required": [
              "replace_required", 
              "replace_additional_cost", 
              "replace_glaze_type", 
              "replace_u_value", 
              "replace_shgc"],
            "if": {
              "properties": {"replace_required": {"const": true }}
            },
              "then": {
                "required": ["replace_inc_sir"]
            }
          }

        },{

          "if": {
            "properties": {"add_storm_evaluate": {"const": true }}
          },
          "then": {
            "required": [
              "add_storm_required", 
              "add_storm_additional_cost", 
              "add_storm_type"],
            "if": {
              "properties": {"add_storm_required": {"const": true }}
            },
              "then": {
                "required": ["add_storm_inc_sir"]
            }
          }

        },{

          "if": {
            "properties": {"add_awning_evaluate": {"const": true }}
          },
          "then": {
            "required": [
              "add_awning_additional_cost", 
              "add_awning_overhang_projection", 
              "add_awning_overhang_offset"]
          }

        },{

          "if": {
            "properties": {"add_ext_shading_evaluate": {"const": true }}
          },
          "then": {
            "required": ["add_ext_shading_additional_cost", "add_ext_shading_type"]
          }
        }]

      }
    },

    "doors_addition": {
      "type": "array",
      "title": "Doors",
      "description": "The list of doors in any home additions",
      "minItems": 0,
      "maxItems": 10,
      "uniqueItems": true,
      "items": {
        "type": "object",
        "properties": {
          "code": {
            "type": "string",
            "minLength": 1,
            "maxLength": 20,
            "title": "Door Code",
            "description": "The short unique code for this door, no commas",
            "examples": ["DR1"],
            "pattern": "^[^,]+$"
          },
          "door_type": {
            "$id": "#/doors_addition/door_type",
            "type": ["integer", "string"],
            "enum": [
              2, "Hollow Core Wood",
              1, "Solid Core Wood",
              3, "Standard Manufactured Home Door",
              4, "Insulated Steel"
            ],
            "title": "Door Type",
            "description": "Type of door"
          },
          "leakiness": {
            "$id": "#/doors_addition/leakiness",
            "type": ["integer", "string"],
            "enum": [
              1, "Tight",
              2, "Medium",
              3, "Loose"
            ],
            "title": "Leakiness",
            "description": "Leakiness of door in the home addition"
          },
          "storm": {
            "type": "boolean",
            "title": "Storm Door Present",
            "description": "Is there a storm door present",
            "examples": [true, false]
          },
          "width": {
            "type": "number",
            "minimum": 18,
            "maximum": 100,
            "title": "Width (in)",
            "description": "Width of door (in)"
          },
          "height": {
            "type": "number",
            "minimum": 18,
            "maximum": 100,
            "title": "Height)",
            "description": "Height of door (in)"
          },
          "num_n": {
            "type": "number",
            "minimum": 0,
            "maximum": 9,
            "title": "Number Facing North",
            "description": "Number of identical doors of this type facing North"
          },
          "num_s": {
            "type": "number",
            "minimum": 0,
            "maximum": 9,
            "title": "Number Facing South",
            "description": "Number of identical doors of this type facing South"
          },
          "num_e": {
            "type": "number",
            "minimum": 0,
            "maximum": 9,
            "title": "Number Facing East",
            "description": "Number of identical doors of this type facing East"
          },
          "num_w": {
            "type": "number",
            "minimum": 0,
            "maximum": 9,
            "title": "Number Facing West",
            "description": "Number of identical doors of this type facing West"
          },
          "cost_replace": {
            "type": "number",
            "minimum": -500,
            "maximum": 500,
            "title": "Additional Cost ($/door)",
            "description": "Additional replacement cost per door"
          },
          "inc_sir": {
            "type": "boolean",
            "title": "Include in SIR",
            "description": "The door measures should be included in the package SIR"
          },
          "replace": {
            "type": "boolean",
            "title": "Replace the door",
            "description": "Replace the door"
          }
        },
        "required": [
          "code",
          "door_type",
          "leakiness",
          "width",
          "height",
          "num_n",
          "num_s",
          "num_e",
          "num_w"
        ]
      }
    },

    "ceiling_addition": {
      "type": "object",
      "title": "Ceiling and Roof",
      "description": "The ceiling/roof information for the home",
      "items": {
        "type": "object",
        "properties": {
          "joist_size": {
            "$id": "#/ceiling_addition/joist_size",
            "type": ["integer", "string"],
            "enum": [
              1, "2 x 4",
              2, "2 x 6",
              3, "2 x 8"
            ],
            "title": "Joist Size",
            "description": "Roof/ceiling joist size"
          },
          "roof_color": {
            "$id": "#/ceiling_addition/roof_color",
            "type": ["integer", "string"],
            "enum": [
              1, "White, Reflective, or Shaded",
              2, "Normal or Weathered"
            ],
            "title": "Roof Color",
            "description": "The color of the roof"
          },
          "mineral_insl": {
            "type": "number",
            "minimum": 0,
            "maximum": 20,
            "title": "Existing Insulation Batt/Blanket (in)",
            "description": "Thickness of batt or blanket ceiling insulation (in)"
          },
          "loose_insl": {
            "type": "number",
            "minimum": 0,
            "maximum": 20,
            "title": "Existing Insulation Loose Fill (in)",
            "description": "Thickness of loose or fill insulation (in)"
          },
          "rigid_insl": {
            "type": "number",
            "minimum": 0,
            "maximum": 20,
            "title": "Existing Insulation Foam Core (in)",
            "description": "Thickness of foam core insulation (in)"
          },
          "add_cost": {
            "type": "number",
            "minimum": -2000,
            "maximum": 5000,
            "title": "Additional Cost ($)",
            "description": "Additional cost of added Insulation"
          }
        },
        "required": [
          "joist_size",
          "roof_color"
        ]
      }
    },

    "floor_addition": {
      "type": "object",
      "title": "Floor information",
      "description": "The floor and belly information for the home",
      "items": {
        "type": "object",
        "properties": {
          "add_floor_type": {
            "$id": "#/floor_addition/add_floor_type",
            "type": ["integer", "string"],
            "enum": [
              1, "Crawl Space",
              2, "Slab on Grade",
              3, "Exposed Floor"
            ],
            "title": "Floor Type",
            "description": "Type of addition floor"
          },
          "joist_size": {
            "$id": "#/floor_addition/joist_size",
            "type": ["integer", "string"],
            "enum": [
              1, "2 x 4",
              2, "2 x 6",
              3, "2 x 8"
            ],
            "title": "Joist Size",
            "description": "Roof/ceiling joist size"
          },
          "insl_location": {
            "$id": "#/floor_addition/insl_location",
            "type": ["integer", "string"],
            "enum": [
              1, "Attached to Flooring",
              2, "Between Joists",
              3, "Attached Under Joists",
              5, "None"
            ],
            "title": "Batt/Blanket Insulation Location",
            "description": "Location of the insulation in the addition"
          },
          "length": {
            "type": "number",
            "minimum": 4,
            "maximum": 100,
            "title": "Length (ft)",
            "description": "Length of the long wall of the addition"
          },
          "width": {
            "type": "number",
            "minimum": 4,
            "maximum": 25,
            "title": "Width (ft)",
            "description": "Width of the addition"
          },
          "mineral_insl": {
            "type": "number",
            "minimum": 0,
            "maximum": 20,
            "title": "Existing Insulation Batt/Blanket (in)",
            "description": "Thickness of batt or blanket floor insulation (in)"
          },
          "loose_insl": {
            "type": "number",
            "minimum": 0,
            "maximum": 20,
            "title": "Existing Insulation Loose Fill (in)",
            "description": "Thickness of loose or fill insulation in addition floor(in)"
          },
          "avail_insl": {
            "type": "number",
            "minimum": 0,
            "maximum": 12,
            "title": "Depth Available for Added Insulation(in)",
            "description": "Space available for added insulation (in)"
          }
        },
        "required": [
          "add_floor_type",
          "joist_size",
          "insl_location",
          "length",
          "width",
          "loose_insl",
          "avail_insl"
        ],

        "if": {
          "not": {
            "anyOf": [
              {"properties": {"insl_location": {"const": 5 }}},
              {"properties": {"insl_location": {"const": "None" }}}
            ]
          }
        },
        "then": {
          "required":[
            "mineral_insl"
          ]
        }
      }
    },



    "hvac": {
      "type": "array",
      "title": "HVAC Systems",
      "description": "The list of heating and cooling systems",
      "minItems": 1,
      "maxItems": 10,
      "uniqueItems": true,
      "additionalProperties": true,
      "items": {
        "type": "object",
        "properties": {
          "code": {
            "type": "string",
            "minLength": 1,
            "maxLength": 20,
            "title": "HVAC System Code",
            "description": "The short code for this HVAC system (must be unique for this audit), no commas",
            "examples": ["HV1"],
            "pattern": "^[^,]+$"
          },
          "id": {
            "type": "number",
            "minimum": 1,
            "maximum": 2147483647,
            "title": "Primary Key",
            "description": "Normalize incrementing primary key of HVAC system"
          }, 
          "system_type": {
            "$id": "#/hvac/system_type",
            "type": ["integer", "string"],
            "enum": [
              1, "Furnace - Forced Air",
              2, "Furnace - Gravity",
              3, "Boiler - Hot Water",
              4, "Boiler - Steam",
              5, "Space Heater",
              6, "Heat Pump - Central",
              7, "Heat Pump - Room/Window",
              13, "Heat Pump - PTHP",
              8, "Heat Pump - Ductless Mini-Split",
              9, "Air Conditioner - Central",
              10, "Air Conditioner - Room",
              14, "Air Conditioner - PTAC",
              11, "Air Conditioner - Mini-Split",
              12, "Evaporative Cooler"
            ],
            "title": "Equipment Type",
            "description": "Type of heating or cooling system"
          },
          "location": {
            "$id": "#/hvac/location",
            "type": ["integer", "string"],
            "enum": [
              1, "Conditioned Space",
              2, "Unconditioned Attic/Ceiling",
              3, "Unconditioned Garage",
              4, "Unconditioned Basement",
              5, "Unconditioned Crawlspace/Belly"
            ],
            "title": "Location",
            "description": "Location of the HVAC system"
          },
          "fuel": {
            "$id": "#/hvac/fuel",
            "type": ["integer", "string"],
            "enum": [
              1, "Natural Gas",
              2, "Fuel Oil",
              3, "Electricity",
              4, "Propane/LPG",
              5, "Wood",
              6, "Coal",
              7, "Kerosene",
              8, "Other"
            ],
            "title": "Primary Fuel",
            "description": "Type of primary fuel for the HVAC system"
          },
          "heat_pump_backup_fuel": {
            "$id": "#/hvac/heat_pump_backup_fuel",
            "type": ["integer", "string"],
            "enum": [
              0, "None",
              1, "Natural Gas",
              2, "Fuel Oil",
              3, "Electricity",
              4, "Propane/LPG",
              7, "Kerosene",
              13, "Also None"
            ],
            "title": "Backup Fuel",
            "description": "Type of backup fuel if the system type is heat pump"
          },
          "efficiency_method": {
            "$id": "#/hvac/efficiency_method",
            "type": ["integer", "string"],
            "enum": [
              1, "Year Manufactured",
              2, "Name Plate Efficiency",
              3, "Site Measured"
            ],
            "title": "Efficiency Input Method",
            "description": "How is the efficiency of the equipment enterted.  Available choiced based on system type and fuel"
          },
          "year_manufactured": {
            "type": "number",
            "minimum": 1969,
            "maximum": 2050,
            "title": "Year Manufactured",
            "description": "If efficiency_method = Year Manufactured. < today and <= year_installed"
          },

          "heat_efficiency": {
            "type": "number",
            "minimum": 1,
            "maximum": 100,
            "title": "Heating Efficiency",
            "description": "The heating efficiecny expressed in heat_efficiency_units"
          },          
          "heat_efficiency_units": {
            "$id": "#/hvac/heat_efficiency_units",
            "type": ["integer", "string"],
            "enum": [
              1, "AFUE",
              2, "COP",
              3, "%",
              4, "HSPF",
              5, "HSPF2"
            ],
            "title": "Heating Efficiency Units",
            "description": "The units for the heat_efficiency numeric input"
          },
          "heat_output_capacity": {
            "type": "number",
            "minimum": 0.01,
            "maximum": 1000000,
            "title": "Output Capacity",
            "description": "Output capacity in the units specified for heat_output_capacity_units",
            "$comment": "The min/max range is expanded for all the different heat_output_capacity_units"
          },
          "heat_output_capacity_units": {
            "$id": "#/heating/heat_output_capacity_units",
            "type": ["integer", "string"],
            "enum": [
              1, "kBtu/hr",
              2, "Btu/hr",
              3, "kW",
              4, "gal/hr",
              5, "Tons"
            ],
            "title": "Output Capacity Units",
            "description": "The units for the heat_output_capacity value. Note expanded range to handle Btu/hr"
          },
          "heat_fraction": {
            "type": "number",
            "minimum": 0.01,
            "maximum": 1.02,
            "title": "Fraction of Load Served",
            "description": "What fraction of the heating load is served. Sum of all HVAC records < 1.0"
          },

          "cool_efficiency": {
            "type": "number",
            "minimum": 1,
            "maximum": 100,
            "title": "Cooling Efficiency",
            "description": "The cooling efficiecny expressed in cool_efficiency_units"
          },          
          "cool_efficiency_units": {
            "$id": "#/hvac/cool_efficiency_units",
            "type": ["integer", "string"],
            "enum": [
              1, "SEER",
              2, "EER",
              3, "COP",
              4, "CEER",
              5, "SEER2"              
            ],
            "title": "Cooling Efficiency Units",
            "description": "The units for the cool_efficiency numeric input"
          },
          "cool_output_capacity": {
            "type": "number",
            "minimum": 0.01,
            "maximum": 1000000,
            "title": "Output Capacity",
            "description": "Output capacity in the units specified for cool_output_capacity_units",
            "$comment": "The min/max range is expanded for all the different cool_output_capacity_units"
          },
          "cool_output_capacity_units": {
            "$id": "#/heating/cool_output_capacity_units",
            "type": ["integer", "string"],
            "enum": [
              1, "kBtu/hr",
              2, "Tons",
              3, "Btu/hr"
            ],
            "title": "Output Capacity Units",
            "description": "The units for the cool_output_capacity value. Note expanded range to handle Btu/hr"
          },
          "cool_fraction": {
            "type": "number",
            "minimum": 0.01,
            "maximum": 1.02,
            "title": "Fraction of Load Served",
            "description": "What fraction of the cooling load is served. Sum of all HVAC records < 1.0"
          },

          "atmospheric_combustion": {
            "type": "boolean",
            "title": "Atmoshperic Burner",
            "description": "Is there a burner running at atmospheric pressure"
          },
          "vent_damper": {
            "type": "boolean",
            "title": "Automatic Vent Damper",
            "description": "Is a vent damper present (if combustion fuel and not sealed/condensing)"
          },
          "iid": {
            "type": "boolean",
            "title": "IID",
            "description": "Is there an intermittent ignition device rather than pilot light"
          },
          "pilot_light": {
            "type": "boolean",
            "title": "Pilot Light",
            "description": "Is there a pilot light rather than intermittent ignition device"
          },
          "pilot_light_summer": {
            "type": "boolean",
            "title": "Pilot Light On in Summer",
            "description": "if pilot_light is true, is the pilot light on during the summer months"
          },

          "year_installed": {
            "type": "number",
            "minimum": 1969,
            "maximum": 2050,
            "title": "Year Installed",
            "description": "The year the equipment was installed. Should be >= year_manufactured"
          },
          "equip_maintenance": {
            "$id": "#/heating/equip_maintenance",
            "type": ["integer", "string"],
            "enum": [
              1, "Annual Professional Maintenance",
              2, "Seldom or Never Maintained",
              3, "Not Working"
            ],
            "title": "Maintenance Status",
            "description": "How is the system maintained"
          },
          "heat_setback_used": {
            "type": "boolean",
            "title": "Heating Setback Used",
            "description": "The existing system uses a night setback strategy"
          },

          "smart_thermostat_evaluate": {
            "type": "boolean",
            "title": "Install Smart Thermostat",
            "description": "Add a smart thermostat. Applies to only one/primary heating system"
          },
          "smart_thermostat_required": {
            "type": "boolean",
            "title": "Install Smart Thermostat Required",
            "description": "Adding a smart thermostat is required"
          },
          "smart_thermostat_inc_sir": {
            "type": "boolean",
            "title": "Install Smart Thermostat Include in SIR",
            "description": "Adding a smart thermostat is required AND should be included in the package SIR"
          },
          "smart_thermostat_setback": {
            "type": "number",
            "minimum": 1,
            "maximum": 10,
            "title": "Heating Nighttime Setback (F)",
            "description": "The setback amount in (F) to subtract from the heating setpoint (in key parameters)"
          },
          "smart_thermostat_setback_hours_per_day": {
            "type": "number",
            "minimum": 1,
            "maximum": 12,
            "title": "Daily Setbak Hours",
            "description": "How many hours per night to apply the set back (hr)"
          },
          "smart_thermostat_additional_cost": {
            "type": "number",
            "minimum": -500,
            "maximum": 500,
            "title": "Additional Cost ($)",
            "description": "How much cost to add/discount for the smart thermostat in addition to the material and labor cost from the library"
          },

          "tuneup_evaluate": {
            "type": "boolean",
            "title": "Tune Up",
            "description": "Evaluate a system tune up to improve efficiecny of existing system"
          },
          "tuneup_required": {
            "type": "boolean",
            "title": "Install Smart Thermostat Required",
            "description": "Tune Up is required"
          },
          "tuneup_inc_sir": {
            "type": "boolean",
            "title": "Install Smart Thermostat Include in SIR",
            "description": "Tune Up is required AND should be included in the package SIR"
          },
          "tuneup_heating_percent_improvement": {
            "type": "number",
            "minimum": 0.01,
            "maximum": 25,
            "title": "Efficiency Improvements (%) heating",
            "description": "The improvement in heating thermal efficiency in delta percent from tune up"
          },
          "tuneup_cooling_percent_improvement": {
            "type": "number",
            "minimum": 0.01,
            "maximum": 25,
            "title": "Efficiency Improvements (%) cooling",
            "description": "The improvement in cooling thermal efficiency in delta percent from tune up"
          },
          "tuneup_additional_cost": {
            "type": "number",
            "minimum": -500,
            "maximum": 500,
            "title": "Additional Cost ($)",
            "description": "How much cost to add/discount for the tune up in addition to the material and labor cost from the library"
          },

          "replace_evaluate": {
            "type": "boolean",
            "title": "Replace the Equipment",
            "description": "Replace the HVAC system with a new system"
          },
          "replace_required": {
            "type": "boolean",
            "title": "Replace the Equipment Required",
            "description": "Replacement is required"
          },
          "replace_inc_sir": {
            "type": "boolean",
            "title": "Replace the Equipment Include in SIR",
            "description": "Replacing equipment is required AND should be included in the package SIR"
          },
          "replace_material_cost": {
            "type": "number",
            "minimum": 0,
            "maximum": 10000,
            "title": "Material Cost ($)",
            "description": "Replace equipment material costs in ($)"
          },
          "replace_labor_cost": {
            "type": "number",
            "minimum": 0,
            "maximum": 10000,
            "title": "Labor Cost ($)",
            "description": "Replace equipment labor costs in ($)"
          },
          "replace_other_cost": {
            "type": "number",
            "minimum": 0,
            "maximum": 10000,
            "title": "Other Cost ($)",
            "description": "Replace equipment other costs in ($)"
          },
          "replace_system_type": {
            "$id": "#/hvac/replace_system_type",
            "type": ["integer", "string"],
            "enum": [
              1, "Furnace - Forced Air",
              2, "Furnace - Gravity",
              3, "Boiler - Hot Water",
              4, "Boiler - Steam",
              5, "Space Heater",
              6, "Heat Pump - Central",
              7, "Heat Pump - Room/Window",
              13, "Heat Pump - PTHP",
              8, "Heat Pump - Ductless Mini-Split",
              9, "Air Conditioner - Central",
              10, "Air Conditioner - Room",
              14, "Air Conditioner - PTAC",
              11, "Air Conditioner - Mini-Split",
              12, "Evaporative Cooler"
            ],
            "title": "Replacement Equipment Type",
            "description": "Type of heating or cooling system for replacment"
          },
          "replace_fuel": {
            "$id": "#/hvac/replace_fuel",
            "type": ["integer", "string"],
            "enum": [
              1, "Natural Gas",
              2, "Fuel Oil",
              3, "Electricity",
              4, "Propane/LPG",
              5, "Wood",
              6, "Coal",
              7, "Kerosene",
              8, "Other"
            ],
            "title": "Replacement Primary Fuel",
            "description": "Type of primary fuel for the HVAC replacement system"
          },
          "replace_heat_pump_backup_fuel": {
            "$id": "#/hvac/replace_heat_pump_backup_fuel",
            "type": ["integer", "string"],
            "enum": [
              0, "None",
              1, "Natural Gas",
              2, "Fuel Oil",
              3, "Electricity",
              4, "Propane/LPG",
              7, "Kerosene",
              13, "Also None"
            ],
            "title": "Replacement Backup Fuel",
            "description": "Type of backup fuel if the replacement system type is heat pump"
          },
          "replace_heat_efficiency": {
            "type": "number",
            "minimum": 1,
            "maximum": 100,
            "title": "Heating Efficiency",
            "description": "The heating efficiency expressed in heat_efficiency_units for replacement"
          },          
          "replace_heat_efficiency_units": {
            "$id": "#/hvac/replace_heat_efficiency_units",
            "type": ["integer", "string"],
            "enum": [
              1, "AFUE",
              2, "COP",
              3, "%",
              4, "HSPF",
              5, "HSPF2"              
            ],
            "title": "Heating Efficiency Units",
            "description": "The units for the heat_efficiency numeric input for replacement"
          },
          "replace_heat_output_capacity": {
            "type": "number",
            "minimum": 0.01,
            "maximum": 1000000,
            "title": "Output Capacity",
            "description": "Output capacity in the units specified for heat_output_capacity_units",
            "$comment": "The min/max range is expanded for all the different heat_output_capacity_units for replacement"
          },
          "replace_heat_output_capacity_units": {
            "$id": "#/heating/replace_heat_output_capacity_units",
            "type": ["integer", "string"],
            "enum": [
              1, "kBtu/hr",
              2, "Btu/hr",
              3, "kW",
              4, "gal/hr",
              5, "Tons"
            ],
            "title": "Output Capacity Units",
            "description": "The units for the heat_output_capacity value. Note expanded range to handle Btu/hr for replacement"
          },
          "replace_heat_fraction": {
            "type": "number",
            "minimum": 0.01,
            "maximum": 1.02,
            "title": "Fraction of Load Served",
            "description": "What fraction of the heating load is served. Sum of all HVAC records < 1.0 for replacement"
          },
          "replace_cool_efficiency": {
            "type": "number",
            "minimum": 1,
            "maximum": 100,
            "title": "Cooling Efficiency",
            "description": "The cooling efficiecny expressed in cool_efficiency_units for replacement"
          },          
          "replace_cool_efficiency_units": {
            "$id": "#/hvac/replace_cool_efficiency_units",
            "type": ["integer", "string"],
            "enum": [
              1, "SEER",
              2, "EER",
              3, "COP",
              4, "CEER",
              5, "SEER2"
            ],
            "title": "Cooling Efficiency Units",
            "description": "The units for the cool_efficiency numeric input for replacement"
          },
          "replace_cool_output_capacity": {
            "type": "number",
            "minimum": 0.01,
            "maximum": 1000000,
            "title": "Output Capacity",
            "description": "Output capacity in the units specified for cool_output_capacity_units",
            "$comment": "The min/max range is expanded for all the different cool_output_capacity_units for replacement"
          },
          "replace_cool_output_capacity_units": {
            "$id": "#/heating/replace_cool_output_capacity_units",
            "type": ["integer", "string"],
            "enum": [
              1, "kBtu/hr",
              2, "Tons",
              3, "Btu/hr"
            ],
            "title": "Output Capacity Units",
            "description": "The units for the cool_output_capacity value. Note expanded range to handle Btu/hr for replacement"
          },
          "replace_cool_fraction": {
            "type": "number",
            "minimum": 0.01,
            "maximum": 1.02,
            "title": "Fraction of Load Served",
            "description": "What fraction of the cooling load is served. Sum of all HVAC records < 1.0 for replacement"
          },
          "replace_life": {
            "type": "number",
            "minimum": 1,
            "maximum": 30,
            "title": "Replacement Lifetime (yr)",
            "description": "Lifetime of the replacement hvac system (yr)"
          },
          "also_replaces_hvac_ids": {
            "type": "string",
            "minLength": 0,
            "maxLength": 150,
            "title": "Also Replaces",
            "description": "A comma separated list of HVAC.id values as strings for systems this replacement also replaces",
            "examples": ["12,13"]
          }
        },
        "required": [
          "code",        
          "id",          
          "system_type", 
          "fuel",
          "smart_thermostat_evaluate",
          "tuneup_evaluate",
          "replace_evaluate"       
        ]
      }
    },

    "duct": {
      "type": "array",
      "title": "Duct details associated with HVAC systems",
      "description": "Construction details for HVAC systems with ducts",
      "minItems": 1,
      "maxItems": 20,
      "uniqueItems": true,
      "additionalProperties": true,
      "items": {
        "type": "object",
        "properties": {
          "code": {
            "type": "string",
            "minLength": 1,
            "maxLength": 20,
            "title": "Duct Code",
            "description": "The short code for this Duct (must be unique for this audit), no commas",
            "examples": ["DU1"],
            "pattern": "^[^,]+$"
          },
          "id": {
            "type": "number",
            "minimum": 1,
            "maximum": 2147483647,
            "title": "Primary Key",
            "description": "Normalize incrementing primary key of this Duct"
          }, 
          "duct_type": {
            "$id": "#/duct/duct_type",
            "type": ["integer", "string"],
            "enum": [
              1, "Supply",
              2, "Return"
            ],
            "title": "Duct Type",
            "description": "Which type of duct, supply or return air"
          },
          "hvac_heating_id_served": {
            "type": "number",
            "minimum": 0,
            "maximum": 2147483647,
            "title": "Heating System Served",
            "description": "Reference to the PK of the HVAC heating system served by this duct. Zero means none served"
          },
          "hvac_cooling_id_served": {
            "type": "number",
            "minimum": 0,
            "maximum": 2147483647,
            "title": "Cooling System Served",
            "description": "Reference to the PK of the HVAC cooling system served by this duct.  Zero means none served"
          },
          "location": {
            "$id": "#/duct/location",
            "type": ["integer", "string"],
            "enum": [
              1, "Conditioned Space",
              2, "Unconditioned Attic/Ceiling",
              3, "Unconditioned Garage",
              4, "Unconditioned Basement",
              5, "Unconditioned Crawlspace/Belly"
            ],
            "title": "Location",
            "description": "Location of the ducts for the HVAC system"
          },
          "fill_in_defaults": {
            "type": "boolean",
            "title": "Use Defaults",
            "description": "The surface_area and r value fields were assigned using default values"
          },
          "surface_area": {
            "type": "number",
            "minimum": 1,
            "maximum": 1500,
            "title": "Duct surface area (sqft)",
            "description": "The duct surface area in sq ft."
          },
          "duct_r_value": {
            "type": "number",
            "minimum": 0,
            "maximum": 20,
            "title": "Insulation R-value",
            "description": "The insulation level of existing duct as R-value"
          },
          "number_of_registers": {
            "type": "number",
            "minimum": 1,
            "maximum": 20,
            "title": "Number of Return Registers",
            "description": "Only required for return duct_type"
          },
          "measure_number": {
            "type": "integer",
            "minimum": 1,
            "maximum": 10,
            "title": "Measure #",
            "description": "Select the duct insulation measure number to use"
          },
          "add_duct_r_value": {
            "type": "number",
            "minimum": 0,
            "maximum": 20,
            "title": "Added R-value",
            "description": "The insulation level to be added to the duct as a conservation measure"
          },
          "insulation_add_cost": {
            "type": "number",
            "minimum": -500,
            "maximum": 500,
            "title": "Additional Cost ($)",
            "description": "How much cost to add/discount for the duct insulation measure"
          }
        },
        "required": [
          "code",        
          "id",          
          "duct_type", 
          "location",
          "surface_area"      
        ]
      }
    },

    "ducts_and_infiltration": {
      "type": "object",
      "title": "Air and Duct Leakage",
      "description": "Overall house leakage and duct leakage information",

      "properties": {
        "evaluate_duct_sealing": {
          "type": "boolean",
          "title": "Evaluate Duct Sealing",
          "description": "Use one of the three methods to evaluate the effects of duct sealing"
        },
        "duct_seal_method": {
          "$id": "#/ducts_and_infiltration/duct_seal_method",
          "type": ["integer", "string"],
          "enum": [
            0, 5, "None",
            1, "Whole House Blower Door Measurements",
            2, "Blower Door Subtraction Measurements",
            3, "Duct Blower Measurements",
            4, "Presure Pan Measurements"
          ],
          "title": "Duct Leakage Method",
          "description": "Infiltration/Duct Leakage Reduction Method"
        },
        "pre_inf_cfm": {
          "type": "number",
          "minimum": 300,
          "maximum": 15000,
          "title": "Existing Air Leakage Rate (cfm)",
          "description": "Air Leakage Rate (cfm) Before Weatherization (Existing)"
        },
        "pre_inf_pa": {
          "type": "number",
          "minimum": 20,
          "maximum": 70,
          "title": "Existing Air Leakage Pressure (pa)",
          "description": "at House Pressure Difference (Pa) Before Weatherization (Existing)"
        },
        "post_duct_seal_cfm": {
          "type": "number",
          "minimum": 300,
          "maximum": 15000,
          "title": "Existing, Post Duct Sealing Air Leakage Rate (cfm)",
          "description": "Air Leakage Rate (cfm) After Duct Sealing and Before Other Weatherization (Target or Actual)"
        },
        "post_duct_seal_pa": {
          "type": "number",
          "minimum": 20,
          "maximum": 70,
          "title": "Existing, Post Duct Sealing Air Leakage Pressure (pa)",
          "description": "at House Pressure Difference (Pa) After Duct Sealing and Before Other Weatherization (Target or Actual)"
        },
        "post_inf_cfm": {
          "type": "number",
          "minimum": 300,
          "maximum": 15000,
          "default": 2500,
          "title": "Post Reduction Air Leakage Rate (cfm)",
          "description": "Air Leakage Rate (cfm) After Weatherization (Target or Actual)"
        },
        "post_inf_pa": {
          "type": "number",
          "minimum": 20,
          "maximum": 70,
          "title": "Post Reduction Air Leakage Pressure (pa)",
          "description": "at House Pressure Difference (Pa) After Weatherization (Target or Actual)"
        },
        "pre_duct_seal_supply_pa": {
          "type": "number",
          "minimum": 5,
          "maximum": 90,
          "title": "Pre Duct Sealing Supply Duct Pressure (pa)",
          "description": "Supply (Pa) Before Duct Sealing"
        },
        "post_duct_seal_supply_pa": {
          "type": "number",
          "minimum": 5,
          "maximum": 90,
          "title": "Post Duct Sealing Supply Duct Pressure (pa)",
          "description": "Supply (Pa) After Duct Sealing"
        },
        "pre_duct_seal_close_cfm": {
          "type": "number",
          "minimum": 300,
          "maximum": 15000,
          "title": "Existing, Grills Sealed, Pre Duct Sealing Air Leakage Rate (cfm)",
          "description": "Air Leakage Rate (cfm) With Registers/Grills Sealed Before Weatherization (Existing)"
        },
        "pre_duct_seal_close_pa": {
          "type": "number",
          "minimum": 20,
          "maximum": 70,
          "title": "Existing, Grills Sealed, Pre Duct Sealing Air Leakage Pressure (pa)",
          "description": "at House Pressure Difference (Pa) With Registers/Grills Sealed Before Weatherization (Existing)"
        },
        "pre_duct_seal_close_diff_pa": {
          "type": "number",
          "minimum": 5,
          "maximum": 70,
          "title": "Existing, Grills Sealed, Pre Duct Sealing Duct to House Differential Pressure (pa)",
          "description": "Duct to House Pressure Difference (Pa) With Registers/Grills Sealed Before Weatherization (Existing)"
        },
        "post_duct_seal_close_cfm": {
          "type": "number",
          "minimum": 300,
          "maximum": 15000,
          "title": "Existing, Grills Sealed, Post Duct Sealing Air Leakage Rate (cfm)",
          "description": "Air Leakage Rate (cfm) With Registers/Grills Sealed After Duct Sealing and Before Other Weatherization (Target or Actual)"
        },
        "post_duct_seal_close_pa": {
          "type": "number",
          "minimum": 20,
          "maximum": 70,
          "title": "Existing, Grills Sealed, Post Duct Sealing Air Leakage Pressure (pa)",
          "description": "at House Pressure Difference (Pa) With Registers/Grills Sealed After Duct Sealing and Before Other Weatherization (Target or Actual)"
        },
        "post_duct_seal_close_diff_pa": {
          "type": "number",
          "minimum": 5,
          "maximum": 70,
          "title": "Existing, Grills Sealed, Post Duct Sealing Duct to House Differential Pressure (pa)",
          "description": "Duct to House Pressure Difference (Pa) With Registers/Grills Sealed After Duct Sealing and Before Other Weatherization (Target or Actual)"
        },
        "pre_duct_seal_tot_cfm": {
          "type": "number",
          "minimum": 10,
          "maximum": 1000,
          "title": "Pre Duct Sealing Duct Blower Total Rate (cfm)",
          "description": "Fan Flow (cfm) Before Duct Sealing (Existing) Total"
        },
        "pre_duct_seal_tot_duct_pa": {
          "type": "number",
          "minimum": 5,
          "maximum": 60,
          "title": "Pre Duct Sealing Duct Blower Pressure (pa)",
          "description": "at Duct Pressure (Pa) Before Duct Sealing (Existing) Total"
        },
        "pre_duct_seal_out_cfm": {
          "type": "number",
          "minimum": 10,
          "maximum": 1000,
          "title": "Pre Duct Sealing Duct Blower Outside Rate (cfm)",
          "description": "Fan Flow (cfm) Before Duct Sealing (Existing) Outside *"
        },
        "pre_duct_seal_out_duct_pa": {
          "type": "number",
          "minimum": 0.1,
          "maximum": 150,
          "title": "Pre Duct Sealing Duct Blower Outside Pressure (pa)",
          "description": "at Duct Pressure (Pa) Before Duct Sealing (Existing) Outside * / (MHEA) Sum of Pressure Pan Measurements (Pa)"
        },
        "post_duct_seal_tot_cfm": {
          "type": "number",
          "minimum": 10 ,
          "maximum": 1000,
          "title": "Post Duct Sealing Duct Blower Total Rate (cfm)",
          "description": "Fan Flow (cfm) After Duct Sealing (Target or Actual) Total"
        },
        "post_duct_seal_tot_duct_pa": {
          "type": "number",
          "minimum": 5,
          "maximum": 60,
          "title": "Post Duct Sealing Duct Blower Pressure (pa)",
          "description": "at Duct Pressure (Pa) After Duct Sealing (Target or Actual) Total"
        },
        "post_duct_seal_out_cfm": {
          "type": "number",
          "minimum": 10,
          "maximum": 1000,
          "title": "Post Duct Sealing Duct Blower Outside Rate (cfm)",
          "description": "Fan Flow (cfm) After Duct Sealing (Target or Actual) Outside *"
        },
        "post_duct_seal_out_duct_pa": {
          "type": "number",
          "minimum": 0.1,
          "maximum": 150,
          "title": "Post Duct Sealing Duct Blower Outside Pressure (pa)",
          "description": "at Duct Pressure (Pa) After Duct Sealing (Target or Actual) Outside * / (MHEA) Sum of Pressure Pan Measurements (Pa)"
        },
        "air_leak_red_cost": {
          "type": "number",
          "minimum": 10,
          "maximum": 10000,
          "title": "Infiltration Reduction Cost ($)",
          "description": "Infiltration Reduction ($)"
        },
        "duct_seal_cost": {
          "type": "number",
          "minimum": 10,
          "maximum": 10000,
          "title": "Duct Sealing Cost ($)",
          "description": "Duct Sealing ($)"
        }

      },
      "required": [
        "evaluate_duct_sealing",
        "post_inf_cfm",
        "post_inf_pa"
      ],

      "if": {
        "properties": {"evaluate_duct_sealing": {"const": true }}
      },
      "then": {
        "required": ["duct_seal_method"],

        "allOf": [{

          "if": {
            "anyOf": [
              {"properties": {"duct_seal_method": {"const": 1 }}},
              {"properties": {"duct_seal_method": {"const": "Whole House Blower Door Measurements"}}}
            ]
          },
          "then": {
            "required": [
              "pre_inf_cfm",
              "pre_inf_pa",
              "post_duct_seal_cfm",
              "post_duct_seal_pa",
              "post_inf_cfm",
              "post_inf_pa",
              "pre_duct_seal_supply_pa",
              "post_duct_seal_supply_pa",
              "air_leak_red_cost",
              "duct_seal_cost"
            ]
          }

        },{

          "if": {
            "anyOf": [
              {"properties": {"duct_seal_method": {"const": 2 }}},
              {"properties": {"duct_seal_method": {"const": "Blower Door Subtraction Measurements"}}}
            ]
          },
          "then": {
            "required": [
              "pre_inf_cfm",
              "pre_inf_pa",
              "post_duct_seal_cfm",
              "post_duct_seal_pa",
              "post_inf_cfm",
              "post_inf_pa",
              "pre_duct_seal_supply_pa",
              "post_duct_seal_supply_pa",
              "pre_duct_seal_close_cfm",
              "pre_duct_seal_close_pa",
              "pre_duct_seal_close_diff_pa",
              "post_duct_seal_close_cfm",
              "post_duct_seal_close_pa",
              "post_duct_seal_close_diff_pa",
              "air_leak_red_cost",
              "duct_seal_cost"
            ]
          }

        },{

          "if": {
            "anyOf": [
              {"properties": {"duct_seal_method": {"const": 3 }}},
              {"properties": {"duct_seal_method": {"const": "Duct Blower Measurements"}}}
            ]
          },
          "then": {
            "required": [
              "pre_inf_cfm",
              "pre_inf_pa",
              "post_inf_cfm",
              "post_inf_pa",
              "pre_duct_seal_supply_pa",
              "post_duct_seal_supply_pa",
              "pre_duct_seal_close_pa",
              "post_duct_seal_close_pa",
              "pre_duct_seal_tot_cfm",
              "pre_duct_seal_tot_duct_pa",
              "pre_duct_seal_out_cfm",
              "pre_duct_seal_out_duct_pa",
              "post_duct_seal_tot_cfm",
              "post_duct_seal_tot_duct_pa",
              "post_duct_seal_out_cfm",
              "post_duct_seal_out_duct_pa",
              "air_leak_red_cost",
              "duct_seal_cost"
           ]
          }

        },{

          "if": {
            "anyOf": [
              {"properties": {"duct_seal_method": {"const": 4 }}},
              {"properties": {"duct_seal_method": {"const": "Presure Pan Measurements"}}}
            ]
          },
          "then": {
            "required": [
              "pre_inf_cfm",
              "pre_inf_pa",
              "post_inf_cfm",
              "post_inf_pa",
              "pre_duct_seal_supply_pa",
              "post_duct_seal_supply_pa",
              "pre_duct_seal_out_duct_pa",
              "post_duct_seal_out_duct_pa",
              "air_leak_red_cost",
              "duct_seal_cost"
            ]
          }

        }]
      }
    },


    "water_heating": {
      "type": "object",
      "title": "Water Heating",
      "description": "Domestic water heating information",
      "properties": {
        "exist_fuel_type_id": {
          "$id": "#/water_heating/exist_fuel_type_id",
          "type": ["integer", "string"],
          "enum": [
            1, "Natural Gas",
            2, "Fuel Oil",           
            3, "Electricity",
            4, "Propane"
          ],
          "title": "Existing Water Heater Fuel Type",
          "description": "Type of fuel for the existing water heater"
        },
        "exist_tank_location_id": {
          "$id": "#/water_heating/exist_tank_location_id",
          "type": ["integer", "string"],
          "enum": [
            1, "Heated Space",
            2, "Unconditioned Space",
            3, "Unintentionally Heated Space"
          ],
          "title": "Existing Water Heater Location",
          "description": "Location for the existing water heater"
        },
        "exist_type": {
          "$id": "#/water_heating/exist_type",
          "type": ["integer", "string"],
          "enum": [
            1, "Storage",
            2, "Heat Pump",
            3, "Tankless/Instantaneous"
          ],
          "title": "Existing Water Heater Type",
          "description": "What is the basic type of water heater"
        },
        "exist_gal": {
          "type": "number",
          "minimum": 20,
          "maximum": 100,
          "title": "Size (gal)",
          "description": "Capacity of existing water heater (gal)"
        },
        "exist_energy_factor": {
          "type": "number",
          "minimum": 0.4,
          "maximum": 4,
          "title": "Energy Factor",
          "description": "Energy Factor (EF) of existing water heater"
        },
        "exist_uniform_energy_factor": {
          "type": "number",
          "minimum": 0.4,
          "maximum": 5,
          "title": "Uniform Energy Factor",
          "description": "The Uniform Energy Factor (UEF) of existing water heater"
        },
        "exist_recovery_efficiency": {
          "type": "number",
          "minimum": 0.4,
          "maximum": 4,
          "title": "Recovery Efficiency (%)",
          "description": "Recovery Efficiency (RE) of existing water heater (%)"
        },
        "exist_input_units_id": {
          "$id": "#/water_heating/exist_input_units_id",
          "type": ["integer", "string"],
          "enum": [
            1, "kBTU",
            2, "kW"
          ],
          "title": "Existing Water Heater Input Units",
          "description": "Input rating units for the existing water heater"
        },
        "exist_input": {
          "type": "number",
          "minimum": 1,
          "maximum": 150,
          "title": "Input Rating (kW or kBtu)",
          "description": "Input Rating of existing water heater (kW or kBtu)"
        },
        "exist_tank_wrap": {
          "type": "boolean",
          "title": "Water Heater Tank Wrap Present",
          "description": "Does the existing tank have an insulating wrap"
        },
        "exist_rvalue": {
          "type": "number",
          "minimum": 1,
          "maximum": 25,
          "title": "Existing Water Heater R-Value",
          "description": "The R-value of the existing water heater tank"
        },
        "exist_insul_thick": {
          "type": "number",
          "minimum": 0.1,
          "maximum": 6,
          "title": "Existing Water Heater Insulation Thickness (in)",
          "description": "The thickness of the existing water heater tank Insulation (in)"
        },
        "exist_insul_type_id": {
          "$id": "#/water_heating/exist_insul_type_id",
          "type": ["integer", "string"],
          "enum": [
            1, "Fiberglass",
            2, "Polyurethane"
          ],
          "title": "Existing Water Heater Insulation Type",
          "description": "Insulation type for the existing water heater"
        },
        "exist_pipe_insul": {
          "type": "boolean",
          "title": "Water Heater Pipe Wrap Present",
          "description": "Is the first 5' of hot water supply pipe insulated?"
        },
        "shower_heads": {
          "type": "number",
          "minimum": 1,
          "maximum": 5,
          "title": "Number of Shower Heads",
          "description": "The number of shower heads in the home"
        },
        "shower_usage_per_day": {
          "type": "number",
          "minimum": 1,
          "maximum": 90,
          "title": "Shower Usage (min/day)",
          "description": "Minutes of shower usage per day"
        },
        "shower_gpm": {
          "type": "number",
          "minimum": 1,
          "maximum": 9,
          "title": "Average Shower Head Flow (gpm per shower head)",
          "description": "The average flow for all shower heads (gpm per shower head)"
        },

        "replace": {
          "type": "boolean",
          "title": "Water Heater Replacement Required",
          "description": "Replacement of the existing water heater is required"
        },
        "inc_sir": {
          "type": "boolean",
          "title": "Include in SIR",
          "description": "The replacement should be included in the cumulative SIR"
        },
        "replace_manufacturer": {
          "type": "string",
          "minLength": 0,
          "maxLength": 60,
          "title": "Replacement Water Heater Manufacturer",
          "description": "The name of the water heater replacement manufacturer"
        },
        "replace_model": {
          "type": "string",
          "minLength": 0,
          "maxLength": 60,
          "title": "Replacement Water Heater Model",
          "description": "The model number of the water heater replacement"
        },
        "replace_fuel_type_id": {
          "$id": "#/water_heating/replace_fuel_type_id",
          "type": ["integer", "string"],
          "enum": [
            1, "Natural Gas",
            3, "Electricity",
            4, "Propane"
          ],
          "title": "Replacement Water Heater Fuel Type",
          "description": "Type of fuel for the replacement water heater"
        },
        "replace_type": {
          "$id": "#/water_heating/replace_type",
          "type": ["integer", "string"],
          "enum": [
            0, "None",
            1, "Storage",
            2, "Heat Pump",
            3, "Tankless/Instantaneous"
          ],
          "title": "Replacement Water Heater Type",
          "description": "What is the basic type of water heater to use as a replacement"
        },
        "replace_gal": {
          "type": "number",
          "minimum": 20,
          "maximum": 100,
          "title": "Size (gal)",
          "description": "Capacity of replacement water heater (gal)"
        },
        "replace_energy_factor": {
          "type": "number",
          "minimum": 0.4,
          "maximum": 4,
          "title": "Energy Factor",
          "description": "Energy Factor (EF) of replacement water heater"
        },
        "replace_uniform_energy_factor": {
          "type": "number",
          "minimum": 0.4,
          "maximum": 5,
          "title": "Energy Factor",
          "description": "Uniform Energy Factor (UEF) of replacement water heater"
        },
        "replace_recovery_efficiency": {
          "type": "number",
          "minimum": 0.4,
          "maximum": 4,
          "title": "Recovery Efficiency (%)",
          "description": "Recovery Efficiency (RE) of replacement water heater (%)"
        },
        "replace_input_units_id": {
          "$id": "#/water_heating/replace_input_units_id",
          "type": ["integer", "string"],
          "enum": [
            1, "kBTU",
            2, "kW"
          ],
          "title": "Replacement Water Heater Input Units",
          "description": "Input rating units for the replacement water heater"
        },
        "replace_input": {
          "type": "number",
          "minimum": 1,
          "maximum": 150,
          "title": "Input Rating (kW or kBtu)",
          "description": "Input Rating of replacement water heater (kW or kBtu)"
        },
        "replace_life": {
          "type": "number",
          "minimum": 1,
          "maximum": 30,
          "title": "Replacement Lifetime (yr)",
          "description": "Lifetime of the replacement water heater (yr)"
        },
        "replace_install_cost": {
          "type": "number",
          "minimum": 1,
          "maximum": 10000,
          "title": "Replacement Installation Cost ($)",
          "description": "Cost of the replacement water heater (material only) ($)"
        },
        "replace_added_cost": {
          "type": "number",
          "minimum": -500,
          "maximum": 500,
          "title": "Replacement Additional Cost ($)",
          "description": "Labor, recycling, and other costs ($)"
        },
        "replace_first_hour_rating": {
          "type": "number",
          "minimum": 0,
          "maximum": 300,
          "title": "The amount of hot water the heater can supply (gal/hour)",
          "description": "The amount of hot water the heater can supply (gal/hour)"
        }
      },
      "required": [
        "exist_type",
        "exist_fuel_type_id",
        "exist_tank_location_id"
      ],

      "allOf": [{

        "if": {
          "not": {
            "anyOf": [
              {"properties": {"exist_type": {"const": 3 }}},
              {"properties": {"exist_type": {"const": "Tankless/Instantaneous"}}}
            ]
          }
        },
        "then": {
          "required": ["exist_tank_wrap"],
          "if": {
            "properties": {"exist_tank_wrap": {"const": false }}
          },
          "then": {
            "oneOf": [
              {"required": ["exist_rvalue"] },
              {"required": ["exist_insul_thick", "exist_insul_type_id"] }
            ]
          }
        }

      },{

        "if": {
          "not": {
            "anyOf": [
              {"properties": {"replace_type": {"const": 0 }}},
              {"properties": {"replace_type": {"const": 3 }}},
              {"properties": {"replace_type": {"const": "Tankless/Instantaneous"}}}
            ]
          }
        },
        "then": {
          "required": [ "replace_gal" ]
        }

      }]

    },

   "refrigerators": {
      "type": "object",
      "title": "Refrigeration",
      "description": "Refrigerator information",
      "properties": {
        "location_id": {
          "$id": "#/refrigerators/location_id",
          "type": ["integer", "string"],
          "enum": [
            1, "Heated Space",
            2, "Unconditioned Space",
            3, "Unintentionally Heated Space"
          ],
          "title": "Location of the Refrigerator",
          "description": "Location of the refrigerator"
        },
        "label_kwh_per_year": {
          "type": "number",
          "minimum": 100,
          "maximum": 3000,
          "title": "Label Annual Consumption (kWh/yr)",
          "description": "The consumption of the existing refrigerator (kWh/yr)"
        },
        "label_year_id": {
          "$id": "#/refrigerators/label_year_id",
          "type": ["integer", "string"],
          "enum": [
            1, "Less than 5 years",
            2, "5 to 9 years",
            3, "10 to 14 years",
            4, "15 or  more years"
          ],
          "title": "Age of Existing Refrigerator",
          "description": "Select the age range for the existing refrigerator"
        },
        "door_seal_condition_id": {
          "$id": "#/refrigerators/door_seal_condition_id",
          "type": ["integer", "string"],
          "enum": [
            1, "Good",
            2, "Fair - Some Wear",
            3, "Poor - Gaps Visible"
          ],
          "title": "Door Seal Condition",
          "description": "What is the condition of the Refrigerator Door Seal"
        },
        "meter_energy_reading": {
          "type": "number",
          "minimum": 0.01,
          "maximum": 10,
          "title": "Metered Energy Consumption (kWh)",
          "description": "The energy consumed by the existing refrigerator over the metering interval (kWh)"
        },
        "meter_energy_interval": {
          "type": "number",
          "minimum": 30,
          "maximum": 1440,
          "title": "Metering Interval (min)",
          "description": "The number of minutes in the metering interval (min)"
        },
        "meter_temperature": {
          "type": "number",
          "minimum": 10,
          "maximum": 120,
          "title": "Metering Ambient Temperature (F)",
          "description": "The temperature near the refrigerator if located in unconditioned space (F)"
        },
        "meter_manual_defrost": {
          "type": "boolean",
          "title": "Meter Interval Includes Manual Defrost",
          "description": "Does the metering interval include a manual defrost cycle"
        },
        "meter_includes_defrost": {
          "type": "boolean",
          "title": "Meter Interval Includes Defrost",
          "description": "Does the metering interval include a defrost cycle.  Warning: metering accuracty is likely low if true"
        },
        "replace_manufacturer": {
          "type": "string",
          "minLength": 0,
          "maxLength": 60,
          "title": "Replacement Refrigerator Manufacturer",
          "description": "The name of the refrigerator replacement manufacturer"
        },
        "replace_model": {
          "type": "string",
          "minLength": 0,
          "maxLength": 60,
          "title": "Replacement Refrigerator Model",
          "description": "The model number of the refrigerator replacement"
        },
        "replace_kwh_per_year": {
          "type": "number",
          "minimum": 10,
          "maximum": 3000,
          "title": "Label Annual Consumption for Replacement (kWh/yr)",
          "description": "The consumption of the new refrigerator (kWh/yr)"
        },
        "replace_life": {
          "type": "number",
          "minimum": 1,
          "maximum": 30,
          "title": "Replacement Lifetime (yr)",
          "description": "Lifetime of the new refrigerator (yr)"
        },
        "replace_install_cost": {
          "type": "number",
          "minimum": 10,
          "maximum": 3000,
          "title": "Replacement Installation Cost ($)",
          "description": "Cost of the new refrigerator (material only) ($)"
        },
        "replace_added_cost": {
          "type": "number",
          "minimum": -500,
          "maximum": 500,
          "title": "Replacement Additional Cost ($)",
          "description": "Labor, recycling, and other costs ($)"
        }

      },
      "required": [
        "location_id",
        "replace_kwh_per_year",
        "replace_life",
        "replace_install_cost"
      ],

      "oneOf": [{
        "required": [
          "label_kwh_per_year",
          "label_year_id",
          "door_seal_condition_id"
        ]
      },{
        "required": [
          "meter_energy_reading",
          "meter_energy_interval",
          "meter_manual_defrost",
          "meter_includes_defrost"
        ],
        "if": {
          "not": {
            "anyOf": [
              {"properties": {"location_id": {"const": 1 }}},
              {"properties": {"location_id": {"const": "Heated Space"}}}
            ]
          }
        },
        "then": {
          "required": [ "meter_temperature" ]
        }
      }]
    },

    "lighting": {
      "type": "array",
      "title": "Lighting Systems",
      "description": "The list of lighting systems in the home",
      "minItems": 0,
      "maxItems": 20,
      "uniqueItems": true,
      "items": {
        "type": "object",
        "properties": {
          "code": {
            "type": "string",
            "minLength": 1,
            "maxLength": 20,
            "title": "Lighting System Code",
            "description": "The short unique code for this lighting system, no commas",
            "examples": ["LT1"],
            "pattern": "^[^,]+$"
          },
          "exist_lamp_type": {
            "$id": "#/lighting/exist_lamp_type",
            "type": ["integer", "string"],
            "enum": [
              1, "Incandescent",
              2, "Halogen",
              3, "Fluorescent",
              4, "CFL",
              5, "LED",
              100, "Other"
            ],
            "title": "Existing Lighting System Lamp Type",
            "description": "Type of existing lamps"
          },
          "exist_lamp_count": {
            "type": "number",
            "minimum": 1,
            "maximum": 100,
            "title": "Number of Existing Lamps",
            "description": "Number of existing lamps of this type in the home"
          },
          "exist_lamp_watts": {
            "type": "number",
            "minimum": 1,
            "maximum": 250,
            "title": "Size (watts)",
            "description": "Wattage of existing lamps (watts/lamp)"
          },  
          "exist_hours_per_day": {
            "type": "number",
            "minimum": 0.1,
            "maximum": 24,
            "title": "Usage (hrs/day)",
            "description": "Number hours per day the existing lamp is in use"
          },
          "new_lamp_type": {
            "$id": "#/lighting/new_lamp_type",
            "type": ["integer", "string"],
            "enum": [
              1, "Incandescent",
              2, "Halogen",
              3, "Fluorescent",
              4, "CFL",
              5, "LED",
              100, "Other"
            ],
            "title": "Existing Lighting System Lamp Type",
            "description": "Type of new lamps"
          },
          "new_lamp_count": {
            "type": "number",
            "minimum": 1,
            "maximum": 100,
            "title": "Number of Existing Lamps",
            "description": "Number of new lamps of this type in the home"
          },
          "new_lamp_watts": {
            "type": "number",
            "minimum": 1,
            "maximum": 250,
            "title": "Size (watts)",
            "description": "Wattage of new lamps (watts/lamp)"
          },  
          "new_hours_per_day": {
            "type": "number",
            "minimum": 0.1,
            "maximum": 24,
            "title": "Usage (hrs/day)",
            "description": "Number hours per day the new lamp is in use"
          },
          "new_lifetime_hrs": {
            "type": "number",
            "minimum": 500,
            "maximum": 100000,
            "title": "Lifetime (hrs)",
            "description": "The expected lifetime of the new lamp (hrs)"
          },
          "install_cost_per_lamp": {
            "type": "number",
            "minimum": 0.1,
            "maximum": 200,
            "title": "Installation Cost ($/lamp)",
            "description": "Cost to install the new lamp ($/lamp)"
          },
          "added_cost_per_lamp": {
            "type": "number",
            "minimum": -100,
            "maximum": 100,
            "title": "Added Cost ($/lamp)",
            "description": "Added Cost to install the new lamp ($/lamp)"
          },
          "added_cost": {
            "type": "number",
            "minimum": -500,
            "maximum": 500,
            "title": "Added Cost ($)",
            "description": "Added Cost to install the new lamps ($)"
          }
        },
        "required": [
          "exist_lamp_type", 
          "exist_lamp_count",
          "exist_lamp_watts",
          "exist_hours_per_day",
          "new_lamp_type", 
          "new_lamp_count",
          "new_lamp_watts",
          "new_hours_per_day",
          "install_cost_per_lamp"
          ] 
      }
    },

    "itemized_costs": {
      "type": "array",
      "title": "Itemized Costs",
      "description": "The list of itemized costs for the retrofit",
      "minItems": 0,
      "maxItems": 60,
      "uniqueItems": true,
      "items": {
        "type": "object",
        "properties": {
          "measure": {
            "type": "string",
            "minLength": 1,
            "maxLength": 80,
            "title": "The Itemized Cost Measure",
            "description": "The name of the itemized cost measure (must be unique for this job)"
          },
          "component_id": {
            "type": "number",
            "minimum": 1,
            "maximum": 2147483647,
            "title": "Itemized Cost Record ID",
            "description": "An optional identifier to reference for this itemized measure. Pass through. 32 bit integer"
          },  
          "cost": {
            "type": "number",
            "minimum": 0.01,
            "maximum": 10000,
            "title": "Cost ($)",
            "description": "The cost of the itemized measure"
          },
          "inc_sir": {
            "type": "boolean",
            "title": "Include in SIR",
            "description": "Should this measure cost be included in the cumulative SIR" 
          },
          "material": {
            "type": "string",
            "minLength": 0,
            "maxLength": 80,
            "title": "The Itemized Measure Material",
            "description": "Additional description of materials and costs involved"
          },
          "units": {
            "$id": "#/itemized_costs/units",
            "type": ["integer", "string"],
            "enum": [
              3, "kWh",
              2, "MMBtu",
              1, "Therms"
            ],
            "title": "Energy Savings Units",
            "description": "The units for energy savings"
          },
          "savings": {
            "type": "number",
            "minimum": 0,
            "maximum": 10000,
            "title": "Annual Energy Savings in stated units",
            "description": "The annual energy savings in the units specified"
          },
          "fuel": {
            "$id": "#/itemized_costs/fuel",
            "type": ["integer", "string"],
            "enum": [
              1, "Natural Gas",
              2, "Fuel Oil",
              3, "Electricity",
              4, "Propane",
              5, "Wood",
              6, "Coal",
              7, "Kerosene",
              8, "Other",
              9, "Primary Heating Fuel",
              10, "Water Heating Fuel"
            ],
            "title": "Fuel Saved",
            "description": "Type of fuel saved in this itemized measure"
          },
          "life": {
            "type": "number",
            "minimum": 1,
            "maximum": 30,
            "title": "Lifetime (yr)",
            "description": "Lifetime of the itemized cost measure"
          }
        },

        "required": [
          "measure",
          "cost",
          "inc_sir",
          "savings"
        ],

        "if": {
          "not": {"properties": {"savings": {"const": 0}}}
        },
        "then": {
          "required": [
            "fuel",
            "life"
          ]
        }

      }
    },


    "utility_bills_pre_retrofit_heating": {
      "type": "object",
      "title": "Utility Bills for Heating",
      "description": "Pre-retrofit heating utility billing information",
      "properties": {
        "usage_units": {
          "$id": "#/utility_bills_pre_retrofit_heating/usage_units",
          "type": ["integer", "string"],
          "enum": [
            1, "Therms",
            2, "kWh"
          ],
          "title": "Units",
          "description": "The units for heating bills"
        },
        "period_days": {
          "type": "integer",
          "minimum": 1,
          "maximum": 365,
          "title": "Days in First Period",
          "description": "The number of days in the first billing period"
        },
        "base_temp": {
          "type": "number",
          "minimum": 55,
          "maximum": 75,
          "title": "Degree Days Base Temperature (F)",
          "description": "Degree day base temperature to use in calculations (F)"
        },
        "base_load": {
          "type": "number",
          "minimum": 0,
          "maximum": 1000,
          "title": "Base Load",
          "description": "Base load in the selected units"
        }
      },
      "required": [
        "usage_units",
        "period_days",
        "base_temp",
        "base_load"
      ]
    },

    "utility_bills_pre_retrofit_heating_data": {
      "type": "array",
      "title": "Heating Bill Records",
      "description": "The list of pre-retrofit heating bills",
      "minItems": 0,
      "maxItems": 12,
      "uniqueItems": true,
      "items": {
        "type": "object",
        "properties": {
          "year": {
            "type": "integer",
            "minimum": 1999,
            "maximum": 2030,
            "title": "Billing Year",
            "description": "The year for the heating bill"
          },
          "month": {
            "type": "integer",
            "minimum": 1,
            "maximum": 12,
            "title": "Billing Month",
            "description": "The month for the heating bill"
          },
          "day": {
            "type": "integer",
            "minimum": 1,
            "maximum": 31,
            "title": "Billing Day",
            "description": "The day of the month for the heating bill"
          },
          "usage": {
            "type": "number",
            "minimum": 0,
            "maximum": 5000,
            "title": "Usage",
            "description": "The billing usage in selected units"
          },
          "degree_days": {
            "type": "number",
            "minimum": 0,
            "maximum": 15000,
            "title": "Degree Days",
            "description": "The degree days in the selected base temperature"
          }
        },
        "required": [
          "year",
          "month",
          "day",
          "usage"
        ]
      }
    },

    "utility_bills_pre_retrofit_cooling": {
      "type": "object",
      "title": "Utility Bills for Cooling",
      "description": "Pre-retrofit cooling utility billing information",
      "properties": {
        "period_days": {
          "type": "integer",
          "minimum": 1,
          "maximum": 365,
          "title": "Days in First Period",
          "description": "The number of days in the first billing period"
        },
        "base_temp": {
          "type": "number",
          "minimum": 55,
          "maximum": 75,
          "title": "Degree Days Base Temperature (F)",
          "description": "Degree day base temperature to use in calculations (F)"
        },
        "base_load": {
          "type": "number",
          "minimum": 0,
          "maximum": 1000,
          "title": "Base Load",
          "description": "Base load in the selected units"
        }
      },
      "required": [
        "period_days",
        "base_temp",
        "base_load"
      ]
    },

    "utility_bills_pre_retrofit_cooling_data": {
      "type": "array",
      "title": "Cooling Bill Records",
      "description": "The list of pre-retrofit cooling bills",
      "minItems": 0,
      "maxItems": 12,
      "uniqueItems": true,
      "items": {
        "type": "object",
        "properties": {
          "year": {
            "type": "integer",
            "minimum": 1999,
            "maximum": 2030,
            "title": "Billing Year",
            "description": "The year for the heating bill"
          },
          "month": {
            "type": "integer",
            "minimum": 1,
            "maximum": 12,
            "title": "Billing Month",
            "description": "The month for the cooling bill"
          },
          "day": {
            "type": "integer",
            "minimum": 1,
            "maximum": 31,
            "title": "Billing Day",
            "description": "The day of the month for the cooling bill"
          },
          "usage": {
            "type": "number",
            "minimum": 0,
            "maximum": 5000,
            "title": "Usage",
            "description": "The billing usage in kWh"
          },
          "degree_days": {
            "type": "number",
            "minimum": 0,
            "maximum": 15000,
            "title": "Degree Days",
            "description": "The degree days in the selected base temperature"
          }
        },
        "required": [
          "year",
          "month",
          "day",
          "usage"
        ]
      }
    },

    "fuel_costs": {
      "type": "object",
      "title": "Fuel Cost and Heat Content",
      "description": "Fuel costs and heat content of each fuel",
      "additionalItems": false,
      "properties": {
        "natural_gas": {
          "type": "number",
          "minimum": 5,
          "maximum": 30,
          "title": "Natural Gas ($/1000 cuft)",
          "description": "The cost of natural gas in dollars per 1000 cubic feet"
        },
        "oil": {
          "type": "number",
          "minimum": 0.50,
          "maximum": 10,
          "title": "Fuel Oil ($/gal)",
          "description": "The cost of fuel oil in dollars per gallon"
        },
        "electric": {
          "type": "number",
          "minimum": 0.02,
          "maximum": 2.0,
          "title": "Electricity ($/kWh)",
          "description": "The cost of electricty in dollars per kWn"
        },
        "propane": {
          "type": "number",
          "minimum": 0.50,
          "maximum": 8,
          "title": "Propane ($/gal)",
          "description": "The cost of propane in dollars per gallon"
        },
        "wood": {
          "type": "number",
          "minimum": 10,
          "maximum": 800,
          "title": "Cord Wood ($/chord)",
          "description": "The cost of wood in dollars per 4x4x8 chord"
        },
        "coal": {
          "type": "number",
          "minimum": 20,
          "maximum": 400,
          "title": "Coal ($/ton)",
          "description": "The cost of coal in dollars per ton"
        },
        "kerosene": {
          "type": "number",
          "minimum": 0.50,
          "maximum": 10,
          "title": "Kerosene ($/gal)",
          "description": "The cost of kerosene in dollars per gallon"
        },
        "other": {
          "type": "number",
          "minimum": 0.01,
          "maximum": 50,
          "title": "Other ($/MMBtu)",
          "description": "The cost of other fuel in dollars per million Btu"
        },
        "natural_gas_heat": {
          "type": "number",
          "minimum": 0.8,
          "maximum": 1.5,
          "title": "Natural Gas Heat Content (MMBtu/1000 cuft)",
          "description": "The heat content of natural gas in MMBtu per 1000 cubic feet"
        },
        "oil_heat": {
          "type": "number",
          "minimum": 0.10,
          "maximum": 0.20,
          "title": "Fuel Oil Heat Content (MMBtu/gal)",
          "description": "The heat content of fuel oil in MMBtu per gallon"
        },
        "electric_heat": {
          "type": "number",
          "const": 0.003413,
          "title": "Electricity Heat Content (MMBtu/kWh)",
          "description": "The heat content of electricty in MMBtu per kWn (constant)"
        },
        "propane_heat": {
          "type": "number",
          "minimum": 0.05,
          "maximum": 0.15,
          "title": "Propane Heat Content (MMBtu/gal)",
          "description": "The heat content of propane in dollars per gallon"
        },
        "wood_heat": {
          "type": "number",
          "minimum": 10,
          "maximum": 50,
          "title": "Cord Wood Heat Content (MMBtu/chord)",
          "description": "The heat content of wood in MMBtu per 4x4x8 chord"
        },
        "coal_heat": {
          "type": "number",
          "minimum": 10,
          "maximum": 50,
          "title": "Coal Heat Content (MMBtu/ton)",
          "description": "The heat content of coal in MMBtu per ton"
        },
        "kerosene_heat": {
          "type": "number",
          "minimum": 0.10,
          "maximum": 0.20,
          "title": "Kerosene Heat Content (MMBtu/gal)",
          "description": "The heat content of kerosene in MMBtu per gallon"
        },
        "other_heat": {
          "type": "number",
          "minimum": 0.99,
          "maximum": 1.01,
          "title": "Other Heat Content (MMBtu/MMBtu)",
          "description": "The heat content of other fuel in MMBtu per million Btu (constant)"
        }
      },
      "required": [
        "electric",
        "electric_heat"
      ]
    },

    "fuel_escalation_rates_by_reference": {
      "type": "object",
      "title": "Fuel Escalation Rates by Reference",
      "description": "Reference the EIA fuel escalation rates by referens, alternately enter fer section",
      "properties": {
        "year": {
          "type": "integer",
          "minimum": 2011,
          "maximum": 2021,
          "title": "The EIA Year to Reference",
          "description": "This is the four digit year of the EIA escalation rates to reference"
        },
        "state": {
          "type": "string",
          "minLength": 2,
          "maxLength": 2,
          "title": "State Code",
          "description": "The two letter code for the state"
        },
        "region": {
          "type": "integer",
          "minimum": 1,
          "maximum": 5,
          "title": "The EIA Region to Reference",
          "description": "This is the region for the given year, region 5 = US average"
        }
      },
      "anyOf": [
        {"required": ["year", "region"]},
        {"required": ["year", "state"]}
      ]
    },

    "fuel_escalation_rates": {
      "type": "array",
      "title": "Fuel Escalation Costs",
      "description": "The complete set of fuel escalation factors, alternately enter the rer section",
      "minItems": 8,
      "maxItems": 8,
      "uniqueItems": true,
      "additionalItems": false,
      "items": {
        "type": "object",
        "properties": {
          "fuel_type_id": {
            "type": ["integer", "string"],
            "enum": [
              1, "Natural Gas",
              2, "Fuel Oil",
              3, "Electricity",
              4, "Propane",
              5, "Wood",
              6, "Coal",
              7, "Kerosene",
              8, "Other"
            ],
            "title": "Fuel Type ID",
            "description": "MUST appear first in the field list. Use ONLY the ID numbers, the strings are in the enum just for reference"
          },
          "fuel_name": {
            "type": ["integer", "string"],
            "enum": [
              1, "Natural Gas",
              2, "Fuel Oil",
              3, "Electricity",
              4, "Propane",
              5, "Wood",
              6, "Coal",
              7, "Kerosene",
              8, "Other"
            ],
            "title": "Fuel Name",
            "description": "Use ONLY the fuel name string, the IDs are in the enum just for reference"
          },
          "rate": {
            "type": "array",
            "minItems": 31,
            "maxItems": 31,
            "items": {
              "type": "number",
              "minimum": 0.5,
              "maximum": 10.0
            }
          }
        },
        "required": [
          "fuel_type_id",
          "fuel_name",
          "rate"
        ]
      }
    },

    "measure_active_flags": {
      "type": "array",
      "title": "Measure Enable/Disable Flags",
      "description": "The list of true/false flags for each possible considered measure",
      "uniqueItems": true,
      "minItems": 45,
      "maxItems": 45,
      "items": [{
          "properties": {
            "num": {"type": "integer", "description": "Optional counter for the array of objects just to assist in finding JSON schema errors"},
            "engine_num": {"const": 1, "description": "MUST appear before other fields. The identifier used by the analsysis engine"},
            "measure_name": {"const": "Duct Sealing"},
            "active": {"type": "boolean",
            "$comment": "Evaluated only if active = true AND ducts_and_infiltration.evaluate_duct_sealing = true AND ducts_and_infiltration.duct_seal_cost > 0"}
          },
          "required": ["engine_num", "active", "measure_name"]
        },{
          "properties": {
            "num": {"type": "integer"},
            "engine_num": {"const": 2},
            "measure_name": {"const": "General Air Sealing"},
            "active": {"type": "boolean",
            "$comment": "Evaluated only if active = true AND ducts_and_infiltration.air_leak_red_cost > 0"}
          },
          "required": ["engine_num", "active", "measure_name"]
        },{
          "properties": {
            "num": {"type": "integer"},
            "engine_num": {"const": 3},
            "measure_name": {"const": "Wall Fiberglass Batt Insulation"},
            "active": {"type": "boolean"}
          },
          "required": ["engine_num", "active", "measure_name"]
        },{
          "properties": {
            "num": {"type": "integer"},
            "engine_num": {"const": 4},
            "measure_name": {"const": "Wall Fiberglass Batt Insulation in Addition"},
            "active": {"type": "boolean"}
          },
          "required": ["engine_num", "active", "measure_name"]
        },{
          "properties": {
            "num": {"type": "integer"},
            "engine_num": {"const": 5},
            "measure_name": {"const": "Wall Cellulose Loose Insulation"},
            "active": {"type": "boolean"}
          },
          "required": ["engine_num", "active", "measure_name"]
        },{
          "properties": {
            "num": {"type": "integer"},
            "engine_num": {"const": 6},
            "measure_name": {"const": "Wall Cellulose Loose Insulation in Addition"},
            "active": {"type": "boolean"}
          },
          "required": ["engine_num", "active", "measure_name"]
        },{
          "properties": {
            "num": {"type": "integer"},
            "engine_num": {"const": 7},
            "measure_name": {"const": "Wall Fiberglass Loose Insulation"},
            "active": {"type": "boolean"}
          },
          "required": ["engine_num", "active", "measure_name"]
        },{
          "properties": {
            "num": {"type": "integer"},
            "engine_num": {"const": 8},
            "measure_name": {"const": "Wall Fiberglass Loose Insulation in Addition"},
            "active": {"type": "boolean"}
          },
          "required": ["engine_num", "active", "measure_name"]
        },{
          "properties": {
            "num": {"type": "integer"},
            "engine_num": {"const": 9},
            "measure_name": {"const": "Floor Cellulose Loose Insulation"},
            "active": {"type": "boolean"}
          },
          "required": ["engine_num", "active", "measure_name"]
        },{
          "properties": {
            "num": {"type": "integer"},
            "engine_num": {"const": 10},
            "measure_name": {"const": "Floor Cellulose Loose Insulation in Addition"},
            "active": {"type": "boolean"}
          },
          "required": ["engine_num", "active", "measure_name"]
        },{
          "properties": {
            "num": {"type": "integer"},
            "engine_num": {"const": 11},
            "measure_name": {"const": "Floor Fiberglass Loose Insulation"},
            "active": {"type": "boolean"}
          },
          "required": ["engine_num", "active", "measure_name"]
        },{
          "properties": {
            "num": {"type": "integer"},
            "engine_num": {"const": 12},
            "measure_name": {"const": "Floor Fiberglass Loose Insulation in Addition"},
            "active": {"type": "boolean"}
          },
          "required": ["engine_num", "active", "measure_name"]
        },{
          "properties": {
            "num": {"type": "integer"},
            "engine_num": {"const": 13},
            "measure_name": {"const": "Roof Cellulose Loose Insulation"},
            "active": {"type": "boolean"}
          },
          "required": ["engine_num", "active", "measure_name"]
        },{
          "properties": {
            "num": {"type": "integer"},
            "engine_num": {"const": 14},
            "measure_name": {"const": "Roof Cellulose Loose Insulation in Addition"},
            "active": {"type": "boolean"}
          },
          "required": ["engine_num", "active", "measure_name"]
        },{
          "properties": {
            "num": {"type": "integer"},
            "engine_num": {"const": 15},
            "measure_name": {"const": "Roof Fiberglass Loose Insulation"},
            "active": {"type": "boolean"}
          },
          "required": ["engine_num", "active", "measure_name"]
        },{
          "properties": {
            "num": {"type": "integer"},
            "engine_num": {"const": 16},
            "measure_name": {"const": "Roof Fiberglass Loose Insulation in Addition"},
            "active": {"type": "boolean"}
          },
          "required": ["engine_num", "active", "measure_name"]
        },{
          "properties": {
            "num": {"type": "integer"},
            "engine_num": {"const": 17},
            "measure_name": {"const": "Add Skirting"},
            "active": {"type": "boolean"}
          },
          "required": ["engine_num", "active", "measure_name"]
        },{
          "properties": {
            "num": {"type": "integer"},
            "engine_num": {"const": 18},
            "measure_name": {"const": "Add Skirting on Addition"},
            "active": {"type": "boolean"}
          },
          "required": ["engine_num", "active", "measure_name"]
        },{
          "properties": {
            "num": {"type": "integer"},
            "engine_num": {"const": 19},
            "measure_name": {"const": "White Roof Coating"},
            "active": {"type": "boolean"}
          },
          "required": ["engine_num", "active", "measure_name"]
        },{
          "properties": {
            "num": {"type": "integer"},
            "engine_num": {"const": 20},
            "measure_name": {"const": "White Roof Coating in Addition"},
            "active": {"type": "boolean"}
          },
          "required": ["engine_num", "active", "measure_name"]
        },{
          "properties": {
            "num": {"type": "integer"},
            "engine_num": {"const": 21},
            "measure_name": {"const": "Door Replacement"},
            "active": {"type": "boolean"}
          },
          "required": ["engine_num", "active", "measure_name"]
        },{
          "properties": {
            "num": {"type": "integer"},
            "engine_num": {"const": 23},
            "measure_name": {"const": "Door Replacement in Addition"},
            "active": {"type": "boolean"}
          },
          "required": ["engine_num", "active", "measure_name"]
        },{
          "properties": {
            "num": {"type": "integer"},
            "engine_num": {"const": 24},
            "measure_name": {"const": "Storm Door"},
            "active": {"type": "boolean"}
          },
          "required": ["engine_num", "active", "measure_name"]
        },{
          "properties": {
            "num": {"type": "integer"},
            "engine_num": {"const": 25},
            "measure_name": {"const": "Storm Door in Addition"},
            "active": {"type": "boolean"}
          },
          "required": ["engine_num", "active", "measure_name"]
        },{
          "properties": {
            "num": {"type": "integer"},
            "engine_num": {"const": 26},
            "measure_name": {"const": "Replace Window"},
            "active": {"type": "boolean"}
          },
          "required": ["engine_num", "active", "measure_name"]
        },{
          "properties": {
            "num": {"type": "integer"},
            "engine_num": {"const": 27},
            "measure_name": {"const": "Replace Window in Addition"},
            "active": {"type": "boolean"}
          },
          "required": ["engine_num", "active", "measure_name"]
        },{
          "properties": {
            "num": {"type": "integer"},
            "engine_num": {"const": 30},
            "measure_name": {"const": "Add Storm Window"},
            "active": {"type": "boolean"}
          },
          "required": ["engine_num", "active", "measure_name"]
        },{
          "properties": {
            "num": {"type": "integer"},
            "engine_num": {"const": 31},
            "measure_name": {"const": "Add Storm Window in Addition"},
            "active": {"type": "boolean"}
          },
          "required": ["engine_num", "active", "measure_name"]
        },{
          "properties": {
            "num": {"type": "integer"},
            "engine_num": {"const": 32},
            "measure_name": {"const": "Add Awning"},
            "active": {"type": "boolean"}
          },
          "required": ["engine_num", "active", "measure_name"]
        },{
          "properties": {
            "num": {"type": "integer"},
            "engine_num": {"const": 33},
            "measure_name": {"const": "Add Awning in Addition"},
            "active": {"type": "boolean"}
          },
          "required": ["engine_num", "active", "measure_name"]
        },{
          "properties": {
            "num": {"type": "integer"},
            "engine_num": {"const": 34},
            "measure_name": {"const": "Add Exterior Shading"},
            "active": {"type": "boolean"}
          },
          "required": ["engine_num", "active", "measure_name"]
        },{
          "properties": {
            "num": {"type": "integer"},
            "engine_num": {"const": 35},
            "measure_name": {"const": "Add Exterior Shading in Addition"},
            "active": {"type": "boolean"}
          },
          "required": ["engine_num", "active", "measure_name"]
        },{
          "properties": {
            "num": {"type": "integer"},
            "engine_num": {"const": 36},
            "measure_name": {"const": "Install Smart Thermostat"},
            "active": {"type": "boolean"}
          },
          "required": ["engine_num", "active", "measure_name"]
        },{
          "properties": {
            "num": {"type": "integer"},
            "engine_num": {"const": 37},
            "measure_name": {"const": "Tune Up Heating System"},
            "active": {"type": "boolean"}
          },
          "required": ["engine_num", "active", "measure_name"]
        },{
          "properties": {
            "num": {"type": "integer"},
            "engine_num": {"const": 39},
            "measure_name": {"const": "Tune Up Cooling System"},
            "active": {"type": "boolean"}
          },
          "required": ["engine_num", "active", "measure_name"]
        },{
          "properties": {
            "num": {"type": "integer"},
            "engine_num": {"const": 41},
            "measure_name": {"const": "Lighting Retrofits"},
            "active": {"type": "boolean"}
          },
          "required": ["engine_num", "active", "measure_name"]
        },{
          "properties": {
            "num": {"type": "integer"},
            "engine_num": {"const": 42},
            "measure_name": {"const": "Refrigerator Replacement"},
            "active": {"type": "boolean"}
          },
          "required": ["engine_num", "active", "measure_name"]
        },{
          "properties": {
            "num": {"type": "integer"},
            "engine_num": {"const": 43},
            "measure_name": {"const": "Water Heater Tank Insulation"},
            "active": {"type": "boolean"}
          },
          "required": ["engine_num", "active", "measure_name"]
        },{
          "properties": {
            "num": {"type": "integer"},
            "engine_num": {"const": 44},
            "measure_name": {"const": "Water Heater Pipe Insulation"},
            "active": {"type": "boolean"}
          },
          "required": ["engine_num", "active", "measure_name"]
        },{
          "properties": {
            "num": {"type": "integer"},
            "engine_num": {"const": 45},
            "measure_name": {"const": "Low Flow Showerheads"},
            "active": {"type": "boolean"}
          },
          "required": ["engine_num", "active", "measure_name"]
        },{
          "properties": {
            "num": {"type": "integer"},
            "engine_num": {"const": 46},
            "measure_name": {"const": "Water Heater Replacement"},
            "active": {"type": "boolean"}
          },
          "required": ["engine_num", "active", "measure_name"]
        },{
          "properties": {
            "num": {"type": "integer"},
            "engine_num": {"const": 47},
            "measure_name": {"const": "Weatherize Window"},
            "active": {"type": "boolean"}
          },
          "required": ["engine_num", "active", "measure_name"]
        },{
          "properties": {
            "num": {"type": "integer"},
            "engine_num": {"const": 48},
            "measure_name": {"const": "Weatherize Window in Addition"},
            "active": {"type": "boolean"}
          },
          "required": ["engine_num", "active", "measure_name"]
        },{
          "properties": {
            "engine_num": {"const": 49},
            "measure_name": {"const": "Replace HVAC System"},
            "active": {"type": "boolean"}
          },
          "required": ["engine_num", "active", "measure_name"]
        },{
          "properties": {
            "num": {"type": "integer"},
            "engine_num": {"const": 50},
            "measure_name": {"const": "Duct Insulation"},
            "active": {"type": "boolean"}
          },
          "required": ["engine_num", "active", "measure_name"]
        }
      ]
    },

    "measure_costs": {
      "type": "array",
      "title": "Measure Cost Details",
      "description": "The detailed costing information for each setup library measure",
      "uniqueItems": true,
      "minItems": 50,
      "maxItems": 50,
      "items": [{
          "properties": {
            "num": {"type": "integer", "description": "Optional counter for the array of objects just to assist in finding JSON schema errors"},
            "engine_num": {"const": 0, "description": "MUST appear before other fields. The identifier used by the analsysis engine"},            "units": {"const": "SqFt"},
            "measure_name": {"const": "Wall Fiberglass Batt Insulation"},
            "measure_type": {"const": "Building Insulation"},
            "life": {"type": "number", "minimum": 1, "maximum": 30, "default": 30},
            "material_cost": {"type": "number", "minimum": 0, "maximum": 5000},
            "labor_cost": {"type": "number", "minimum": 0, "maximum": 50000},
            "other_cost": {"type": "number", "minimum": 0, "maximum": 5000,  "$comment" : "All other_cost entries are in units of Cost Each"}
          },
          "required": ["engine_num", "measure_name", "life", "material_cost", "labor_cost", "other_cost"]
        },{
          "properties": {
            "num": {"type": "integer"},
            "engine_num": {"const": 1},
            "units": {"const": "Bag"},
            "measure_name": {"const": "Wall Cellulose Loose Insulation"},
            "measure_type": {"const": "Building Insulation"},
            "life": {"type": "number", "minimum": 1, "maximum": 30, "default": 30},
            "material_cost": {"type": "number", "minimum": 0, "maximum": 5000},
            "labor_cost": {"type": "number", "minimum": 0, "maximum": 5000},
            "other_cost": {"type": "number", "minimum": 0, "maximum": 5000}
          },
          "required": ["engine_num", "measure_name", "life", "material_cost", "labor_cost", "other_cost"]
        },{
          "properties": {
            "num": {"type": "integer"},
            "engine_num": {"const": 2},
            "units": {"const": "Bag"},
            "measure_name": {"const": "Wall Fiberglass Loose Insulation"},
            "measure_type": {"const": "Building Insulation"},
            "life": {"type": "number", "minimum": 1, "maximum": 30, "default": 30},
            "material_cost": {"type": "number", "minimum": 0, "maximum": 5000},
            "labor_cost": {"type": "number", "minimum": 0, "maximum": 5000},
            "other_cost": {"type": "number", "minimum": 0, "maximum": 5000}
          },
          "required": ["engine_num", "measure_name", "life", "material_cost", "labor_cost", "other_cost"]
        },{
          "properties": {
            "num": {"type": "integer"},
            "engine_num": {"const": 3},
            "units": {"const": "Bag"},
            "measure_name": {"const": "Floor Cellulose Loose Insulation"},
            "measure_type": {"const": "Building Insulation"},
            "life": {"type": "number", "minimum": 1, "maximum": 30, "default": 30},
            "material_cost": {"type": "number", "minimum": 0, "maximum": 5000},
            "labor_cost": {"type": "number", "minimum": 0, "maximum": 5000},
            "other_cost": {"type": "number", "minimum": 0, "maximum": 5000}
          },
          "required": ["engine_num", "measure_name", "life", "material_cost", "labor_cost", "other_cost"]
        },{
          "properties": {
            "num": {"type": "integer"},
            "engine_num": {"const": 4},
            "units": {"const": "Bag"},
            "measure_name": {"const": "Floor Fiberglass Loose Insulation"},
            "measure_type": {"const": "Building Insulation"},
            "life": {"type": "number", "minimum": 1, "maximum": 30, "default": 20},
            "material_cost": {"type": "number", "minimum": 0, "maximum": 5000},
            "labor_cost": {"type": "number", "minimum": 0, "maximum": 5000},
            "other_cost": {"type": "number", "minimum": 0, "maximum": 5000}
          },
          "required": ["engine_num", "measure_name", "life", "material_cost", "labor_cost", "other_cost"]
        },{
          "properties": {
            "num": {"type": "integer"},
            "engine_num": {"const": 5},
            "units": {"const": "Bag"},
            "measure_name": {"const": "Roof Cellulose Loose Insulation"},
            "measure_type": {"const": "Building Insulation"},
            "life": {"type": "number", "minimum": 1, "maximum": 30, "default": 30},
            "material_cost": {"type": "number", "minimum": 0, "maximum": 5000},
            "labor_cost": {"type": "number", "minimum": 0, "maximum": 5000},
            "other_cost": {"type": "number", "minimum": 0, "maximum": 5000}
          },
          "required": ["engine_num", "measure_name", "life", "material_cost", "labor_cost", "other_cost"]
        },{
          "properties": {
            "num": {"type": "integer"},
            "engine_num": {"const": 6},
            "units": {"const": "Bag"},
            "measure_name": {"const": "Roof Fiberglass Loose Insulation"},
            "measure_type": {"const": "Building Insulation"},
            "life": {"type": "number", "minimum": 1, "maximum": 30, "default": 30},
            "material_cost": {"type": "number", "minimum": 0, "maximum": 5000},
            "labor_cost": {"type": "number", "minimum": 0, "maximum": 5000},
            "other_cost": {"type": "number", "minimum": 0, "maximum": 5000}
          },
          "required": ["engine_num", "measure_name", "life", "material_cost", "labor_cost", "other_cost"]
        },{
          "properties": {
            "num": {"type": "integer"},
            "engine_num": {"const": 7},
            "units": {"const": "SqFt"},
            "measure_name": {"const": "Add Skirting"},
            "measure_type": {"const": "Building Insulation"},
            "life": {"type": "number", "minimum": 1, "maximum": 30, "default": 10},
            "material_cost": {"type": "number", "minimum": 0, "maximum": 5000},
            "labor_cost": {"type": "number", "minimum": 0, "maximum": 5000},
            "other_cost": {"type": "number", "minimum": 0, "maximum": 5000}
          },
          "required": ["engine_num", "measure_name", "life", "material_cost", "labor_cost", "other_cost"]
        },{
          "properties": {
            "num": {"type": "integer"},
            "engine_num": {"const": 8},
            "units": {"const": "Each Door"},
            "measure_name": {"const": "Door Replacement"},
            "measure_type": {"const": "Doors and Windows"},
            "life": {"type": "number", "minimum": 1, "maximum": 30, "default": 15},
            "material_cost": {"type": "number", "minimum": 0, "maximum": 5000},
            "labor_cost": {"type": "number", "minimum": 0, "maximum": 5000},
            "other_cost": {"type": "number", "minimum": 0, "maximum": 5000}
          },
          "required": ["engine_num", "measure_name", "life", "material_cost", "labor_cost", "other_cost"]
        },{
          "properties": {
            "num": {"type": "integer"},
            "engine_num": {"const": 9},
            "units": {"const": "Each Door"},
            "measure_name": {"const": "Storm Door"},
            "measure_type": {"const": "Doors and Windows"},
            "life": {"type": "number", "minimum": 1, "maximum": 30, "default": 10},
            "material_cost": {"type": "number", "minimum": 0, "maximum": 5000},
            "labor_cost": {"type": "number", "minimum": 0, "maximum": 5000},
            "other_cost": {"type": "number", "minimum": 0, "maximum": 5000}
          },
          "required": ["engine_num", "measure_name", "life", "material_cost", "labor_cost", "other_cost"]
        },{
          "properties": {
            "num": {"type": "integer"},
            "engine_num": {"const": 10},
            "units": {"const": "SqFt"},
            "measure_name": {"const": "Replace Window Double Pane"},
            "measure_type": {"const": "Doors and Windows"},
            "life": {"type": "number", "minimum": 1, "maximum": 30, "default": 20},
            "material_cost": {"type": "number", "minimum": 0, "maximum": 5000},
            "labor_cost": {"type": "number", "minimum": 0, "maximum": 5000},
            "other_cost": {"type": "number", "minimum": 0, "maximum": 5000}
          },
          "required": ["engine_num", "measure_name", "life", "material_cost", "labor_cost", "other_cost"]
        },{
          "properties": {
            "num": {"type": "integer"},
            "engine_num": {"const": 12},
            "units": {"const": "SqFt"},
            "measure_name": {"const": "Add Storm Window Clear"},
            "measure_type": {"const": "Doors and Windows"},
            "life": {"type": "number", "minimum": 1, "maximum": 30, "default": 15},
            "material_cost": {"type": "number", "minimum": 0, "maximum": 5000},
            "labor_cost": {"type": "number", "minimum": 0, "maximum": 5000},
            "other_cost": {"type": "number", "minimum": 0, "maximum": 5000}
          },
          "required": ["engine_num", "measure_name", "life", "material_cost", "labor_cost", "other_cost"]
        },{
          "properties": {
            "num": {"type": "integer"},
            "engine_num": {"const": 13},
            "units": {"const": "Linear Foot"},
            "measure_name": {"const": "Add Awning"},
            "measure_type": {"const": "Doors and Windows"},
            "life": {"type": "number", "minimum": 1, "maximum": 30, "default": 10},
            "material_cost": {"type": "number", "minimum": 0, "maximum": 5000},
            "labor_cost": {"type": "number", "minimum": 0, "maximum": 5000},
            "other_cost": {"type": "number", "minimum": 0, "maximum": 5000}
          },
          "required": ["engine_num", "measure_name", "life", "material_cost", "labor_cost", "other_cost"]
        },{
          "properties": {
            "num": {"type": "integer"},
            "engine_num": {"const": 14},
            "units": {"const": "SqFt"},
            "measure_name": {"const": "Add Exterior Shading Low-e Film"},
            "measure_type": {"const": "Doors and Windows"},
            "life": {"type": "number", "minimum": 1, "maximum": 30, "default": 10},
            "material_cost": {"type": "number", "minimum": 0, "maximum": 5000},
            "labor_cost": {"type": "number", "minimum": 0, "maximum": 5000},
            "other_cost": {"type": "number", "minimum": 0, "maximum": 5000}
          },
          "required": ["engine_num", "measure_name", "life", "material_cost", "labor_cost", "other_cost"]
        },{
          "properties": {
            "num": {"type": "integer"},
            "engine_num": {"const": 15},
            "units": {"const": "SqFt"},
            "measure_name": {"const": "White Roof Coating"},
            "measure_type": {"const": "Building Insulation"},
            "life": {"type": "number", "minimum": 1, "maximum": 30, "default": 7},
            "material_cost": {"type": "number", "minimum": 0, "maximum": 5000},
            "labor_cost": {"type": "number", "minimum": 0, "maximum": 5000},
            "other_cost": {"type": "number", "minimum": 0, "maximum": 5000}
          },
          "required": ["engine_num", "measure_name", "life", "material_cost", "labor_cost", "other_cost"]
        },{
          "properties": {
            "num": {"type": "integer"},
            "engine_num": {"const": 16},
            "units": {"const": "Each"},
            "measure_name": {"const": "Seal Ducts"},
            "measure_type": {"const": "General Heat Waste and Air Infiltration"},
            "life": {"type": "number", "minimum": 1, "maximum": 30, "default": 10},
            "material_cost": {"type": "number", "minimum": 0, "maximum": 5000, "$comment" : "Just setup costs"}
          },
          "required": ["engine_num", "measure_name", "life", "material_cost"]
        },{
          "properties": {
            "num": {"type": "integer"},
            "engine_num": {"const": 17},
            "units": {"const": "Each"},
            "measure_name": {"const": "General Air Sealing"},
            "retrofit_type": {"type": ["string", "null"], "maxLength": 50},
            "measure_type": {"const": "General Heat Waste and Air Infiltration"},
            "life": {"type": "number", "minimum": 1, "maximum": 30, "default": 10},
            "material_cost": {"type": "number", "minimum": 0, "maximum": 5000, "$comment" : "Just setup costs"}
          },
          "required": ["engine_num", "measure_name", "life", "material_cost"]
        },{
          "properties": {
            "num": {"type": "integer"},
            "engine_num": {"const": 18},
            "units": {"const": "Each"},
            "measure_name": {"const": "Smart Thermostat"},
            "measure_type": {"const": "HVAC System"},
            "life": {"type": "number", "minimum": 1, "maximum": 30, "default": 15},
            "material_cost": {"type": "number", "minimum": 0, "maximum": 5000},
            "labor_cost": {"type": "number", "minimum": 0, "maximum": 5000},
            "other_cost": {"type": "number", "minimum": 0, "maximum": 5000, "units": "Each Thermostat"}
          },
          "required": ["engine_num", "measure_name", "life", "material_cost", "labor_cost", "other_cost"]
        },{
          "properties": {
            "num": {"type": "integer"},
            "engine_num": {"const": 19},
            "units": {"const": "Each"},
            "measure_name": {"const": "Tune Up Heating System"},
            "measure_type": {"const": "HVAC System"},
            "life": {"type": "number", "minimum": 1, "maximum": 30, "default": 3},
            "material_cost": {"type": "number", "minimum": 0, "maximum": 5000},
            "labor_cost": {"type": "number", "minimum": 0, "maximum": 5000},
            "other_cost": {"type": "number", "minimum": 0, "maximum": 5000}
          },
          "required": ["engine_num", "measure_name", "life", "material_cost", "labor_cost", "other_cost"]
        },{
          "properties": {
            "num": {"type": "integer"},
            "engine_num": {"const": 20, "description": "Costs and life come from audit HVAC form, only label used from this"},
            "units": {"const": "Each"},
            "measure_name": {"const": "Replace HVAC System"},
            "measure_type": {"const": "HVAC System"}
          },
          "required": ["engine_num", "measure_name"]
        },{
          "properties": {
            "num": {"type": "integer"},
            "engine_num": {"const": 24},
            "units": {"const": "Each"},
            "measure_name": {"const": "Tune Up Cooling System"},
            "measure_type": {"const": "HVAC System"},
            "life": {"type": "number", "minimum": 1, "maximum": 30, "default": 3},
            "material_cost": {"type": "number", "minimum": 0, "maximum": 5000},
            "labor_cost": {"type": "number", "minimum": 0, "maximum": 5000},
            "other_cost": {"type": "number", "minimum": 0, "maximum": 5000}
          },
          "required": ["engine_num", "measure_name", "life", "material_cost", "labor_cost", "other_cost"]
        },{
          "properties": {
            "num": {"type": "integer"},
            "engine_num": {"const": 40},
            "units": {"const": "Each"},
            "measure_name": {"const": "Water Heater Tank Insulation Wrap"},
            "measure_type": {"const": "Baseloads"},
            "life": {"type": "number", "minimum": 1, "maximum": 30, "default": 13},
            "material_cost": {"type": "number", "minimum": 0, "maximum": 5000},
            "labor_cost": {"type": "number", "minimum": 0, "maximum": 5000},
            "other_cost": {"type": "number", "minimum": 0, "maximum": 5000}
          },
          "required": ["engine_num", "measure_name", "life", "material_cost", "labor_cost", "other_cost"]
        },{
          "properties": {
            "num": {"type": "integer"},
            "engine_num": {"const": 41},
            "units": {"const": "Each"},
            "measure_name": {"const": "Water Heater Pipe Insulation"},
            "measure_type": {"const": "Baseloads"},
            "life": {"type": "number", "minimum": 1, "maximum": 30, "default": 13},
            "material_cost": {"type": "number", "minimum": 0, "maximum": 5000},
            "labor_cost": {"type": "number", "minimum": 0, "maximum": 5000},
            "other_cost": {"type": "number", "minimum": 0, "maximum": 5000}
          },
          "required": ["engine_num", "measure_name", "life", "material_cost", "labor_cost", "other_cost"]
        },{
          "properties": {
            "num": {"type": "integer"},
            "engine_num": {"const": 42},
            "units": {"const": "Each"},
            "measure_name": {"const": "Low Flow Showerheads"},
            "measure_type": {"const": "Baseloads"},
            "life": {"type": "number", "minimum": 1, "maximum": 30, "default": 15},
            "material_cost": {"type": "number", "minimum": 0, "maximum": 5000},
            "labor_cost": {"type": "number", "minimum": 0, "maximum": 5000},
            "other_cost": {"type": "number", "minimum": 0, "maximum": 5000}
          },
          "required": ["engine_num", "measure_name", "life", "material_cost", "labor_cost", "other_cost"]
        },{
          "properties": {
            "num": {"type": "integer"},
            "engine_num": {"const": 43},
            "units": {"const": "Each Window"},
            "measure_name": {"const": "Weatherize Window"},
            "measure_type": {"const": "Doors and Windows"},
            "life": {"type": "number", "minimum": 1, "maximum": 30, "default": 10},
            "material_cost": {"type": "number", "minimum": 0, "maximum": 5000},
            "labor_cost": {"type": "number", "minimum": 0, "maximum": 5000},
            "other_cost": {"type": "number", "minimum": 0, "maximum": 5000}
          },
          "required": ["engine_num", "measure_name", "life", "material_cost", "labor_cost", "other_cost"]
        },{
          "properties": {
            "num": {"type": "integer"},
            "engine_num": {"const": 44},
            "units": {"const": "SqFt"},
            "measure_name": {"const": "Wall Fiberglass Batt Insulation in Addition"},
            "measure_type": {"const": "Building Insulation"},
            "life": {"type": "number", "minimum": 1, "maximum": 30, "default": 20},
            "material_cost": {"type": "number", "minimum": 0, "maximum": 5000},
            "labor_cost": {"type": "number", "minimum": 0, "maximum": 5000},
            "other_cost": {"type": "number", "minimum": 0, "maximum": 5000}
          },
          "required": ["engine_num", "measure_name", "life", "material_cost", "labor_cost", "other_cost"]
        },{
          "properties": {
            "num": {"type": "integer"},
            "engine_num": {"const": 45},
            "units": {"const": "Bag"},
            "measure_name": {"const": "Wall Cellulose Loose Insulation in Addition"},
            "measure_type": {"const": "Building Insulation"},
            "life": {"type": "number", "minimum": 1, "maximum": 30, "default": 20},
            "material_cost": {"type": "number", "minimum": 0, "maximum": 5000},
            "labor_cost": {"type": "number", "minimum": 0, "maximum": 5000},
            "other_cost": {"type": "number", "minimum": 0, "maximum": 5000}
          },
          "required": ["engine_num", "measure_name", "life", "material_cost", "labor_cost", "other_cost"]
        },{
          "properties": {
            "num": {"type": "integer"},
            "engine_num": {"const": 46},
            "units": {"const": "Bag"},
            "measure_name": {"const": "Wall Fiberglass Loose Insulation in Addition"},
            "measure_type": {"const": "Building Insulation"},
            "life": {"type": "number", "minimum": 1, "maximum": 30, "default": 20},
            "material_cost": {"type": "number", "minimum": 0, "maximum": 5000},
            "labor_cost": {"type": "number", "minimum": 0, "maximum": 5000},
            "other_cost": {"type": "number", "minimum": 0, "maximum": 5000}
          },
          "required": ["engine_num", "measure_name", "life", "material_cost", "labor_cost", "other_cost"]
        },{
          "properties": {
            "num": {"type": "integer"},
            "engine_num": {"const": 47},
            "units": {"const": "Bag"},
            "measure_name": {"const": "Floor Cellulose Loose Insulation in Addition"},
            "measure_type": {"const": "Building Insulation"},
            "life": {"type": "number", "minimum": 1, "maximum": 30, "default": 20},
            "material_cost": {"type": "number", "minimum": 0, "maximum": 5000},
            "labor_cost": {"type": "number", "minimum": 0, "maximum": 5000},
            "other_cost": {"type": "number", "minimum": 0, "maximum": 5000}
          },
          "required": ["engine_num", "measure_name", "life", "material_cost", "labor_cost", "other_cost"]
        },{
          "properties": {
            "num": {"type": "integer"},
            "engine_num": {"const": 48},
            "units": {"const": "Bag"},
            "measure_name": {"const": "Floor Fiberglass Loose Insulation in Addition"},
            "measure_type": {"const": "Building Insulation"},
            "life": {"type": "number", "minimum": 1, "maximum": 30, "default": 20},
            "material_cost": {"type": "number", "minimum": 0, "maximum": 5000},
            "labor_cost": {"type": "number", "minimum": 0, "maximum": 5000},
            "other_cost": {"type": "number", "minimum": 0, "maximum": 5000}
          },
          "required": ["engine_num", "measure_name", "life", "material_cost", "labor_cost", "other_cost"]
        },{
          "properties": {
            "num": {"type": "integer"},
            "engine_num": {"const": 49},
            "units": {"const": "Bag"},
            "measure_name": {"const": "Roof Cellulose Loose Insulation in Addition"},
            "measure_type": {"const": "Building Insulation"},
            "life": {"type": "number", "minimum": 1, "maximum": 30, "default": 20},
            "material_cost": {"type": "number", "minimum": 0, "maximum": 5000},
            "labor_cost": {"type": "number", "minimum": 0, "maximum": 5000},
            "other_cost": {"type": "number", "minimum": 0, "maximum": 5000}
          },
          "required": ["engine_num", "measure_name", "life", "material_cost", "labor_cost", "other_cost"]
        },{
          "properties": {
            "num": {"type": "integer"},
            "engine_num": {"const": 50},
            "units": {"const": "Bag"},
            "measure_name": {"const": "Roof Fiberglass Loose Insulation in Addition"},
            "measure_type": {"const": "Building Insulation"},
            "life": {"type": "number", "minimum": 1, "maximum": 30, "default": 20},
            "material_cost": {"type": "number", "minimum": 0, "maximum": 5000},
            "labor_cost": {"type": "number", "minimum": 0, "maximum": 5000},
            "other_cost": {"type": "number", "minimum": 0, "maximum": 5000}
          },
          "required": ["engine_num", "measure_name", "life", "material_cost", "labor_cost", "other_cost"]
        },{
          "properties": {
            "num": {"type": "integer"},
            "engine_num": {"const": 51},
            "units": {"const": "SqFt"},
            "measure_name": {"const": "Add Skirting on Addition"},
            "measure_type": {"const": "Building Insulation"},
            "life": {"type": "number", "minimum": 1, "maximum": 30, "default": 10},
            "material_cost": {"type": "number", "minimum": 0, "maximum": 5000},
            "labor_cost": {"type": "number", "minimum": 0, "maximum": 5000},
            "other_cost": {"type": "number", "minimum": 0, "maximum": 5000}
          },
          "required": ["engine_num", "measure_name", "life", "material_cost", "labor_cost", "other_cost"]
        },{
          "properties": {
            "num": {"type": "integer"},
            "engine_num": {"const": 52},
            "units": {"const": "SqFt"},
            "measure_name": {"const": "White Roof Coating in Addition"},
            "measure_type": {"const": "Building Insulation"},
            "life": {"type": "number", "minimum": 1, "maximum": 30, "default": 20},
            "material_cost": {"type": "number", "minimum": 0, "maximum": 5000},
            "labor_cost": {"type": "number", "minimum": 0, "maximum": 5000},
            "other_cost": {"type": "number", "minimum": 0, "maximum": 5000}
          },
          "required": ["engine_num", "measure_name", "life", "material_cost", "labor_cost", "other_cost"]
        },{
          "properties": {
            "num": {"type": "integer"},
            "engine_num": {"const": 53},
            "units": {"const": "Each Door"},
            "measure_name": {"const": "Door Replacement in Addition"},
            "measure_type": {"const": "Doors and Windows"},
            "life": {"type": "number", "minimum": 1, "maximum": 30, "default": 15},
            "material_cost": {"type": "number", "minimum": 0, "maximum": 5000},
            "labor_cost": {"type": "number", "minimum": 0, "maximum": 5000},
            "other_cost": {"type": "number", "minimum": 0, "maximum": 5000}
          },
          "required": ["engine_num", "measure_name", "life", "material_cost", "labor_cost", "other_cost"]
        },{
          "properties": {
            "num": {"type": "integer"},
            "engine_num": {"const": 54},
            "units": {"const": "Each Door"},
            "measure_name": {"const": "Storm Door in Addition"},
            "measure_type": {"const": "Doors and Windows"},
            "life": {"type": "number", "minimum": 1, "maximum": 30, "default": 10},
            "material_cost": {"type": "number", "minimum": 0, "maximum": 5000},
            "labor_cost": {"type": "number", "minimum": 0, "maximum": 5000},
            "other_cost": {"type": "number", "minimum": 0, "maximum": 5000}
          },
          "required": ["engine_num", "measure_name", "life", "material_cost", "labor_cost", "other_cost"]
        },{
          "properties": {
            "num": {"type": "integer"},
            "engine_num": {"const": 55},
            "units": {"const": "Each Window"},
            "measure_name": {"const": "Weatherize Window in Addition"},
            "measure_type": {"const": "Doors and Windows"},
            "life": {"type": "number", "minimum": 1, "maximum": 30, "default": 10},
            "material_cost": {"type": "number", "minimum": 0, "maximum": 5000},
            "labor_cost": {"type": "number", "minimum": 0, "maximum": 5000},
            "other_cost": {"type": "number", "minimum": 0, "maximum": 5000}
          },
          "required": ["engine_num", "measure_name", "life", "material_cost", "labor_cost", "other_cost"]
        },{
          "properties": {
            "num": {"type": "integer"},
            "engine_num": {"const": 56},
            "units": {"const": "SqFt"},
            "measure_name": {"const": "Replace Window Double Pane in Addition"},
            "measure_type": {"const": "Doors and Windows"},
            "life": {"type": "number", "minimum": 1, "maximum": 30, "default": 20},
            "material_cost": {"type": "number", "minimum": 0, "maximum": 5000},
            "labor_cost": {"type": "number", "minimum": 0, "maximum": 5000},
            "other_cost": {"type": "number", "minimum": 0, "maximum": 5000}
          },
          "required": ["engine_num", "measure_name", "life", "material_cost", "labor_cost", "other_cost"]
        },{
          "properties": {
            "num": {"type": "integer"},
            "engine_num": {"const": 58},
            "units": {"const": "SqFt"},
            "measure_name": {"const": "Add Storm Window Clear in Addition"},
            "measure_type": {"const": "Doors and Windows"},
            "life": {"type": "number", "minimum": 1, "maximum": 30, "default": 15},
            "material_cost": {"type": "number", "minimum": 0, "maximum": 5000},
            "labor_cost": {"type": "number", "minimum": 0, "maximum": 5000},
            "other_cost": {"type": "number", "minimum": 0, "maximum": 5000}
          },
          "required": ["engine_num", "measure_name", "life", "material_cost", "labor_cost", "other_cost"]
        },{
          "properties": {
            "num": {"type": "integer"},
            "engine_num": {"const": 59},
            "units": {"const": "Linear Foot"},
            "measure_name": {"const": "Add Awning in Addition"},
            "measure_type": {"const": "Doors and Windows"},
            "life": {"type": "number", "minimum": 1, "maximum": 30, "default": 15},
            "material_cost": {"type": "number", "minimum": 0, "maximum": 5000},
            "labor_cost": {"type": "number", "minimum": 0, "maximum": 5000},
            "other_cost": {"type": "number", "minimum": 0, "maximum": 5000}
          },
          "required": ["engine_num", "measure_name", "life", "material_cost", "labor_cost", "other_cost"]
        },{
          "properties": {
            "num": {"type": "integer"},
            "engine_num": {"const": 60},
            "units": {"const": "SqFt"},
            "measure_name": {"const": "Add Exterior Shading Low-e Film in Addition"},
            "measure_type": {"const": "Doors and Windows"},
            "life": {"type": "number", "minimum": 1, "maximum": 30, "default": 10},
            "material_cost": {"type": "number", "minimum": 0, "maximum": 5000},
            "labor_cost": {"type": "number", "minimum": 0, "maximum": 5000},
            "other_cost": {"type": "number", "minimum": 0, "maximum": 5000}
          },
          "required": ["engine_num", "measure_name", "life", "material_cost", "labor_cost", "other_cost"]
        },{
          "properties": {
            "num": {"type": "integer"},
            "engine_num": {"const": 61},
            "units": {"const": "SqFt"},
            "measure_name": {"const": "Replace Window Double Pane Low-e"},
            "measure_type": {"const": "Doors and Windows"},
            "life": {"type": "number", "minimum": 1, "maximum": 30, "default": 20},
            "material_cost": {"type": "number", "minimum": 0, "maximum": 5000},
            "labor_cost": {"type": "number", "minimum": 0, "maximum": 5000},
            "other_cost": {"type": "number", "minimum": 0, "maximum": 5000}
          },
          "required": ["engine_num", "measure_name", "life", "material_cost", "labor_cost", "other_cost"]
        },{
          "properties": {
            "num": {"type": "integer"},
            "engine_num": {"const": 62},
            "units": {"const": "SqFt"},
            "measure_name": {"const": "Replace Window Double Pane Low-e in Addition"},
            "measure_type": {"const": "Doors and Windows"},
            "life": {"type": "number", "minimum": 1, "maximum": 30, "default": 20},
            "material_cost": {"type": "number", "minimum": 0, "maximum": 5000},
            "labor_cost": {"type": "number", "minimum": 0, "maximum": 5000},
            "other_cost": {"type": "number", "minimum": 0, "maximum": 5000}
          },
          "required": ["engine_num", "measure_name", "life", "material_cost", "labor_cost", "other_cost"]
        },{
          "properties": {
            "num": {"type": "integer"},
            "engine_num": {"const": 63},
            "units": {"const": "SqFt"},
            "measure_name": {"const": "Add Exterior Shading Sun Screen Fabric"},
            "measure_type": {"const": "Doors and Windows"},
            "life": {"type": "number", "minimum": 1, "maximum": 30, "default": 10},
            "material_cost": {"type": "number", "minimum": 0, "maximum": 5000},
            "labor_cost": {"type": "number", "minimum": 0, "maximum": 5000},
            "other_cost": {"type": "number", "minimum": 0, "maximum": 5000}
          },
          "required": ["engine_num", "measure_name", "life", "material_cost", "labor_cost", "other_cost"]
        },{
          "properties": {
            "num": {"type": "integer"},
            "engine_num": {"const": 64},
            "units": {"const": "SqFt"},
            "measure_name": {"const": "Add Exterior Shading Sun Screen Fabric in Addition"},
            "measure_type": {"const": "Doors and Windows"},
            "life": {"type": "number", "minimum": 1, "maximum": 30, "default": 10},
            "material_cost": {"type": "number", "minimum": 0, "maximum": 5000},
            "labor_cost": {"type": "number", "minimum": 0, "maximum": 5000},
            "other_cost": {"type": "number", "minimum": 0, "maximum": 5000}
          },
          "required": ["engine_num", "measure_name", "life", "material_cost", "labor_cost", "other_cost"]
        },{
          "properties": {
            "num": {"type": "integer"},
            "engine_num": {"const": 65},
            "units": {"const": "SqFt"},
            "measure_name": {"const": "Add Exterior Shading Sun Screen Louvered"},
            "measure_type": {"const": "Doors and Windows"},
            "life": {"type": "number", "minimum": 1, "maximum": 30, "default": 10},
            "material_cost": {"type": "number", "minimum": 0, "maximum": 5000},
            "labor_cost": {"type": "number", "minimum": 0, "maximum": 5000},
            "other_cost": {"type": "number", "minimum": 0, "maximum": 5000}
          },
          "required": ["engine_num", "measure_name", "life", "material_cost", "labor_cost", "other_cost"]
        },{
            "properties": {
              "num": {"type": "integer"},
              "engine_num": {"const": 66},
              "units": {"const": "SqFt"},
              "measure_name": {"const": "Add Exterior Shading Sun Screen Louvered in Addition"},
              "measure_type": {"const": "Doors and Windows"},
            "life": {"type": "number", "minimum": 1, "maximum": 30, "default": 10},
              "material_cost": {"type": "number", "minimum": 0, "maximum": 5000},
              "labor_cost": {"type": "number", "minimum": 0, "maximum": 5000},
              "other_cost": {"type": "number", "minimum": 0, "maximum": 5000}
            },
            "required": ["engine_num", "measure_name", "life", "material_cost", "labor_cost", "other_cost"]
        },{
          "properties": {
            "num": {"type": "integer"},
            "engine_num": {"const": 67},
            "units": {"const": "SqFt"},
            "measure_name": {"const": "Add Storm Window Low-e"},
            "measure_type": {"const": "Doors and Windows"},
            "life": {"type": "number", "minimum": 1, "maximum": 30, "default": 15},
            "material_cost": {"type": "number", "minimum": 0, "maximum": 5000},
            "labor_cost": {"type": "number", "minimum": 0, "maximum": 5000},
            "other_cost": {"type": "number", "minimum": 0, "maximum": 5000}
          },
          "required": ["engine_num", "measure_name", "life", "material_cost", "labor_cost", "other_cost"]
        },{
          "properties": {
            "num": {"type": "integer"},
            "engine_num": {"const": 68},
            "units": {"const": "SqFt"},
            "measure_name": {"const": "Add Storm Window Low-e in Addition"},
            "measure_type": {"const": "Doors and Windows"},
            "life": {"type": "number", "minimum": 1, "maximum": 30, "default": 15},
            "material_cost": {"type": "number", "minimum": 0, "maximum": 5000},
            "labor_cost": {"type": "number", "minimum": 0, "maximum": 5000},
            "other_cost": {"type": "number", "minimum": 0, "maximum": 5000}
          },
          "required": ["engine_num", "measure_name", "life", "material_cost", "labor_cost", "other_cost"]
        },{
          "properties": {
            "num": {"type": "integer"},
            "engine_num": {"const": 69},
            "units": {"const": "SqFt"},
            "measure_name": {"const": "Duct Insulation"},
            "measure_type": {"const": "Fiberglass Batts"},
            "life": {"type": "number", "minimum": 1, "maximum": 30, "default": 20},
            "material_cost": {"type": "number", "minimum": 0, "maximum": 5000},
            "labor_cost": {"type": "number", "minimum": 0, "maximum": 5000},
            "other_cost": {"type": "number", "minimum": 0, "maximum": 5000, "units": "Each Measure"}
          },
          "required": ["engine_num", "measure_name", "life", "material_cost", "labor_cost", "other_cost"]
        }
      ]
    },

    "key_parameters": {
      "type": "object",
      "title": "Key Parameters",
      "description": "Top level energy and economic parameters from setup library",
      "additionalProperties": false,
      "properties": {
        "real_discount_rate":                            {"type": "number", "minimum": 0,    "maximum": 10,       "description": "%"},
        "minimum_acceptable_sir":                        {"type": "number", "minimum": 0,    "maximum": 10,       "description": "Factor"},
        "spending_limit":                                {"type": "number", "minimum": 0,    "maximum": 10000,    "description": "Dollars"},

        "heating_setpoint_day":                          {"type": "number", "minimum": 50,    "maximum": 80,    "description": "deg F"},
        "heating_setpoint_night":                        {"type": "number", "minimum": 50,    "maximum": 80,    "description": "deg F"},
        "cooling_setpoint_day":                          {"type": "number", "minimum": 50,    "maximum": 90,    "description": "deg F"},
        "cooling_setpoint_night":                        {"type": "number", "minimum": 50,    "maximum": 90,    "description": "deg F"},

        "bag_size_for_loose_fiberglass_insulation":      {"type": "number", "minimum": 0,    "maximum": 50,    "description": "Lb"},
        "density_of_loose_fiberglass_insulation":        {"type": "number", "minimum": 0,    "maximum": 10,    "description": "Lb/cuft"},
        "bag_size_for_loose_cellulose_insulation":       {"type": "number", "minimum": 0,    "maximum": 50,    "description": "Lb"},
        "density_of_loose_cellulose_insulation":         {"type": "number", "minimum": 0,    "maximum": 10,    "description": "Lb/cuft"},

        "interior_wall_r_value_winter":                  {"type": "number", "minimum": 0,    "maximum": 10,    "description": "F-sqft-hr/Btu"},
        "interior_wall_r_value_summer":                  {"type": "number", "minimum": 0,    "maximum": 10,    "description": "F-sqft-hr/Btu"},
        "interior_ceiling_r_value_winter":               {"type": "number", "minimum": 0,    "maximum": 10,    "description": "F-sqft-hr/Btu"},
        "interior_ceiling_r_value_summer":               {"type": "number", "minimum": 0,    "maximum": 10,    "description": "F-sqft-hr/Btu"},
        "interior_floor_r_value_winter":                 {"type": "number", "minimum": 0,    "maximum": 10,    "description": "F-sqft-hr/Btu"},
        "interior_floor_r_value_summer":                 {"type": "number", "minimum": 0,    "maximum": 10,    "description": "F-sqft-hr/Btu"},
        "outside_wall_r_value_winter":                   {"type": "number", "minimum": 0,    "maximum": 10,    "description": "F-sqft-hr/Btu"},
        "outside_wall_r_value_summer":                   {"type": "number", "minimum": 0,    "maximum": 10,    "description": "F-sqft-hr/Btu"},
        "loose_insulation_r_value_per_inch":             {"type": "number", "minimum": 0,    "maximum": 10,    "description": "F-sqft-hr/Btu-in"},
        "batt_blanket_insulation_r_value_per_inch":      {"type": "number", "minimum": 0,    "maximum": 10,    "description": "F-sqft-hr/Btu-in"},
        "rigid_insulation_r_value_per_inch":             {"type": "number", "minimum": 0,    "maximum": 10,    "description": "F-sqft-hr/Btu-in"},
        "foamcore_insulation_r_value_per_inch":          {"type": "number", "minimum": 0,    "maximum": 10,    "description": "F-sqft-hr/Btu-in"},

        "home_leakiness_loose":                          {"type": "number", "minimum": 0,    "maximum": 5000,    "description": "cfm"},
        "home_leakiness_medium":                         {"type": "number", "minimum": 0,    "maximum": 5000,    "description": "cfm"},
        "home_leakiness_tight":                          {"type": "number", "minimum": 0,    "maximum": 5000,    "description": "cfm"},
        "free_heat_from_interior_sources_day":           {"type": "number", "minimum": 0,    "maximum": 5000,    "description": "Btu/hr"},
        "free_heat_from_interior_sources_night":         {"type": "number", "minimum": 0,    "maximum": 5000,    "description": "Btu/hr"},
       
        "evaporative_cooler_actual_saturating_eff":      {"type": "number", "minimum": 0,    "maximum": 100,    "description": "%"},
        "saturating_eff_for_evaporative_tune_up":        {"type": "number", "minimum": 0,    "maximum": 100,    "description": "%"},
        "saturating_eff_for_evaporative_rplcmnt":        {"type": "number", "minimum": 0,    "maximum": 100,    "description": "%"},
        "cooling_system_fan_power":                      {"type": "number", "minimum": 0,    "maximum": 200,    "description": "Watts"},

        "door_u_value_wood_with_hollow_core":            {"type": "number", "minimum": 0,    "maximum": 10,    "description": "Btu/F-sqft-hr"},
        "door_u_value_wood_with_solid_core":             {"type": "number", "minimum": 0,    "maximum": 10,    "description": "Btu/F-sqft-hr"},
        "door_u_value_standard_mfg_home_door":           {"type": "number", "minimum": 0,    "maximum": 10,    "description": "Btu/F-sqft-hr"},
        "u_value_of_replacement_door":                   {"type": "number", "minimum": 0,    "maximum": 10,    "description": "Btu/F-sqft-hr"},
        
        "low_flow_shower_head_flow_rate":                {"type": "number", "minimum": 0,    "maximum": 10,    "description": "gal/min"},
        "water_heater_wrap_added_r_value":               {"type": "number", "minimum": 0,    "maximum": 10,    "description": "F-sqft-hr/Btu"},
        "refrigerator_defrost_cycle_energy":             {"type": "number", "minimum": 0,    "maximum": 10,    "description": "kWh"}
      },
      "required": [
        "real_discount_rate",                           
        "minimum_acceptable_sir",                       
        "spending_limit", 
                                      
        "heating_setpoint_day",                         
        "heating_setpoint_night",                       
        "cooling_setpoint_day",                         
        "cooling_setpoint_night",                       

        "bag_size_for_loose_fiberglass_insulation",     
        "density_of_loose_fiberglass_insulation",       
        "bag_size_for_loose_cellulose_insulation",      
        "density_of_loose_cellulose_insulation",

        "interior_wall_r_value_winter",                 
        "interior_wall_r_value_summer",                 
        "interior_ceiling_r_value_winter",              
        "interior_ceiling_r_value_summer",              
        "interior_floor_r_value_winter",                
        "interior_floor_r_value_summer",                
        "outside_wall_r_value_winter",                  
        "outside_wall_r_value_summer",                  
        "loose_insulation_r_value_per_inch",            
        "batt_blanket_insulation_r_value_per_inch",     
        "rigid_insulation_r_value_per_inch",            
        "foamcore_insulation_r_value_per_inch",

        "home_leakiness_loose",                         
        "home_leakiness_medium",                        
        "home_leakiness_tight",                         
        "free_heat_from_interior_sources_day",          
        "free_heat_from_interior_sources_night", 
                  
        "evaporative_cooler_actual_saturating_eff",     
        "saturating_eff_for_evaporative_tune_up",       
        "saturating_eff_for_evaporative_rplcmnt",       
        "cooling_system_fan_power",   

        "door_u_value_wood_with_hollow_core",           
        "door_u_value_wood_with_solid_core",            
        "door_u_value_standard_mfg_home_door",          
        "u_value_of_replacement_door",
                          
        "low_flow_shower_head_flow_rate",               
        "water_heater_wrap_added_r_value",              
        "refrigerator_defrost_cycle_energy"         
      ]
    }

  }
}
