> ## Documentation Index
> Fetch the complete documentation index at: https://docs.datanumia.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Disaggregation

> The service returns the annual energy disaggregation of a given site.



## OpenAPI

````yaml /api-reference/energy-disaggregation.yaml get /v1/sites/{site-id}/usage-breakdowns
openapi: 3.1.0
info:
  title: Energy disaggregation
  termsOfService: TODO
  contact:
    email: api@datanumia.com
  version: 2.0.0
servers:
  - url: https://api.home.datanumia.com/api
    description: Production Server
security: []
paths:
  /v1/sites/{site-id}/usage-breakdowns:
    get:
      tags:
        - Annual energy disaggregation
      summary: Disaggregation
      description: The service returns the annual energy disaggregation of a given site.
      operationId: getUsageBreakdowns
      parameters:
        - name: site-id
          in: path
          description: The site identifier
          required: true
          schema:
            type: string
        - name: ts
          in: query
          description: >-
            From the timestamp, the energy disaggregation of the past year will
            be calculated.
          required: true
          schema:
            type: string
            format: date-time
          example: >-
            2024-06-19T17:10:14Z : Disaggregation will be calculated from June
            2023 (included) to June 2024 (excluded)
        - name: fluid
          in: query
          description: The type of consumption (electricity or gas)
          required: false
          schema:
            type: string
            default: ELEC
            enum:
              - ELEC
              - GAS
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UsageBreakdownFiabilityDTO'
        '400':
          description: Bad request.
          content: {}
        '404':
          description: Site not found
        '500':
          description: Unexpected error
components:
  schemas:
    UsageBreakdownFiabilityDTO:
      required:
        - beginMonth
        - endMonth
        - totalCost
        - totalEnergy
        - units
      type: object
      properties:
        beginMonth:
          type: string
          description: >-
            Start month of the period over which the disaggregation is
            calculated.
          format: YYYY-MM
        endMonth:
          type: string
          description: End month of the period over which the disaggregation is calculated.
          format: YYYY-MM
        units:
          $ref: '#/components/schemas/UnitsDto'
        totalCost:
          type: integer
          description: Total cost of the energy consumption on the period.
        totalEnergy:
          type: number
          description: Total of the energy consumption on the period.
        connectedHeatingTotalCost:
          type: integer
          description: Cost of the consumption sent by connected heatings.
        connectedHeatingTotalEnergy:
          type: number
          description: Energy consumption sent by connected heatings.
        algorithm:
          type: string
          description: >-
            Algorithm which has been used to calculate the consumption
            disaggregation.
          enum:
            - DISAGGREGATION
            - REGIME
            - SIMFAST
            - MIX_DISAGGREGATION_REGIME
            - MIX_DISAGGREGATION_SIMFAST
            - NO_ALGORITHM
        usageBreakdowns:
          type: array
          items:
            $ref: '#/components/schemas/UsageBreakdownDTO'
        generalProfilComplete:
          type: boolean
          description: Indicates if the general profile is complete for the site or not.
        seasonalUsageBreakdown:
          $ref: '#/components/schemas/SeasonalUsageBreakdownDTO'
    UnitsDto:
      type: object
      properties:
        cost:
          type: string
          format: ISO-4217
        energyMeter:
          type: string
    UsageBreakdownDTO:
      required:
        - cost
        - energy
        - percent
        - usage
      type: object
      properties:
        units:
          $ref: '#/components/schemas/UnitsDto'
        usage:
          type: string
          enum:
            - US_HEATING
            - US_SANITARY_HOT_WATER
            - US_AIR_CONDITIONING
            - US_WASHING_DRYING
            - US_FRIDGE_FREEZER
            - US_COOKING
            - US_LIGHTING
            - US_SWIMMING_POOL
            - US_AQUARIUM
            - US_ELECTRIC_VEHICLE
            - US_AUDIO
            - US_ALWAYS_ON
            - US_OTHERS
        cost:
          type: integer
          description: Cost of the usage consumption on the period.
        percent:
          type: integer
          description: Percentage of the usage consumption out of total consumption.
        energy:
          type: integer
          description: Energy consumption of the usage on the period.
        fiability:
          $ref: '#/components/schemas/Fiability'
        connectedPartCost:
          type: number
          description: Cost of the usage consumption sent by connected devices.
        connectedPartEnergy:
          type: number
          description: Energy of the usage consumption sent by connected devices.
        partialAlwaysOn:
          $ref: '#/components/schemas/AlwaysOnPartDTO'
    SeasonalUsageBreakdownDTO:
      type: object
      properties:
        winter:
          $ref: '#/components/schemas/SimpleUsageBreakdownFiabilityDTO'
        summer:
          $ref: '#/components/schemas/SimpleUsageBreakdownFiabilityDTO'
    Fiability:
      description: Indicates if the usage is reliable according to the profile information.
      type: object
      properties:
        isReliable:
          type: boolean
        equipmentsFiability:
          type: object
          additionalProperties:
            type: string
    AlwaysOnPartDTO:
      type: object
      properties:
        cost:
          type: integer
        percent:
          type: integer
        energy:
          type: integer
      description: >-
        The usage ALWAYS_ON is calculated only via the load curve disaggregation
        algorithm. In case of a mix of algorithms used on the year,
        partial_always_on indicates the part of this usage on a part of the
        year.
    SimpleUsageBreakdownFiabilityDTO:
      required:
        - beginMonth
        - endMonth
        - totalCost
        - totalEnergy
        - units
      type: object
      properties:
        beginMonth:
          type: string
          description: >-
            Start month of the period over which the disaggregation is
            calculated.
          format: YYYY-MM
        endMonth:
          type: string
          description: End month of the period over which the disaggregation is calculated.
          format: YYYY-MM
        units:
          $ref: '#/components/schemas/UnitsDto'
        totalCost:
          type: integer
          description: Total cost of the energy consumption on the period.
        totalEnergy:
          type: number
          description: Total of the energy consumption on the period.
        connectedHeatingTotalCost:
          type: integer
          description: Cost of the consumption sent by connected heatings.
        connectedHeatingTotalEnergy:
          type: number
          description: Energy consumption sent by connected heatings.
        algorithm:
          type: string
          description: >-
            Algorithm which has been used to calculate the consumption
            disaggregation.
          enum:
            - DISAGGREGATION
            - REGIME
            - SIMFAST
            - MIX_DISAGGREGATION_REGIME
            - MIX_DISAGGREGATION_SIMFAST
            - NO_ALGORITHM
        usageBreakdowns:
          type: array
          items:
            $ref: '#/components/schemas/UsageBreakdownDTO'
        generalProfilComplete:
          type: boolean
          description: Indicates if the general profile is complete for the site or not.

````