openapi: 3.0.3
info:
    title: ⚡ Energetics API
    description: >-
        <p> ⚡ Energetics </p>
    version: 1.0.0
    contact:
        name: Golemio Prague Data Platform
        email: golemio@operatorict.cz
        url: https://golemio.cz
servers:
    - url: https://rabin.golemio.cz
      description: Test (development) server
    - url: https://api.golemio.cz
      description: Main (production) server
tags:
    - name: ⚡ Energetics (v2)
      description: >-
          💡 Organizations & measurement devices — the original OICT Energetika data domain
          (`organizations*` and `consumption_energy_*` tables). All endpoints in this group are
          organization-scoped and require the internal `accessLimit` query parameter, which is set
          by the permission proxy (never by the client).
    - name: 🗺️ Energetics DeD (v2)
      description: >-
          🏢 DeD — city-wide energy management overview for Prague buildings. A separate data
          domain from ⚡ Energetics: ENO buildings, consumption points (OM), PRE/PPAS enrichment
          and Porsenna e-manazer devices. Data is not organization-scoped, so these endpoints do
          not use the `accessLimit` parameter at all — sending it (or any other unknown query
          parameter) is rejected with HTTP 400.
paths:
    /v2/energetics/buildings:
        get:
            tags:
                - ⚡ Energetics (v2)
            summary: Get all buildings
            parameters:
                - name: full
                  in: query
                  description: Display full buildings data.
                  required: false
                  schema:
                      type: boolean
                      default: false
                      example: false
            responses:
                "200":
                    description: OK
                    headers:
                        Cache-Control:
                            description: Cache control directive for caching proxies
                            schema:
                                type: string
                                example: public, s-maxage=21600, stale-while-revalidate=60
                    content:
                        application/json:
                            schema:
                                type: array
                                items:
                                    $ref: "#/components/schemas/EnergeticsBuildingShort"

    /v2/energetics/buildings/{id}:
        get:
            tags:
                - ⚡ Energetics (v2)
            summary: Get a building by ID
            parameters:
                - in: path
                  name: id
                  required: true
                  schema:
                      type: number
                      example: 100
            responses:
                "200":
                    description: OK
                    headers:
                        Cache-Control:
                            description: Cache control directive for caching proxies
                            schema:
                                type: string
                                example: public, s-maxage=1800, stale-while-revalidate=60
                    content:
                        application/json:
                            schema:
                                $ref: "#/components/schemas/EnergeticsBuildingFull"

    /v2/energetics/ded/buildings:
        get:
            tags:
                - 🗺️ Energetics DeD (v2)
            summary: Search buildings by name, address, GID, EAN, EIC or OM identifier
            description: >-
                Suggestion endpoint for the DeD map. A single free-text query `q` is matched against the
                building name, its addresses, the GID and the identifiers of every consumption point mapped
                to the building.

                Matching runs in two tiers. An exact match on an EAN, EIC, OM identifier or GID is returned
                on its own — fuzzy candidates are dropped entirely and `matched_exactly` is `true`. Note that
                one identifier can be mapped to several buildings, so an exact match may still return more
                than one result; the map should zoom automatically only when exactly one result is returned.
                Otherwise results are ranked by a weighted full-text and trigram score over the name
                (highest weight), the main address, the secondary addresses and the identifiers. Queries
                typed without Czech diacritics match normally.

                Every result carries the building outline as GeoJSON together with its bounding box and
                centroid, all in WGS84 (EPSG:4326), so the map can zoom to a hit. They are `null` when the
                building has no usable geometry, signalled by `geometry_source: null`.
            parameters:
                - in: query
                  name: q
                  required: true
                  description: Search text — name, address, GID, EAN, EIC or OM identifier.
                  schema:
                      type: string
                      minLength: 1
                      maxLength: 100
                      example: "859182400000000001"
                - in: query
                  name: limit
                  required: false
                  description: Maximum number of suggestions returned.
                  schema:
                      type: integer
                      minimum: 1
                      maximum: 50
                      default: 10
            responses:
                "200":
                    description: OK
                    headers:
                        Cache-Control:
                            description: Cache control directive for caching proxies
                            schema:
                                type: string
                                example: public, s-maxage=60, stale-while-revalidate=30
                    content:
                        application/json:
                            schema:
                                $ref: "#/components/schemas/EnergeticsDedBuildingSearch"
                "400":
                    $ref: "#/components/responses/BadRequestError"
                "401":
                    $ref: "#/components/responses/UnauthorizedError"
                "500":
                    $ref: "#/components/responses/ServerError"

    /v2/energetics/ded/buildings/{gid}:
        get:
            tags:
                - 🗺️ Energetics DeD (v2)
            summary: ENO building detail with consumption points (OM) and technical parameters
            description: >-
                Returns the ENO building (eno_budova) identified by GID together with its addresses and all
                consumption points mapped to it. Commodity-specific data is nested under the
                `electricity`/`gas`/`heat`/`water` keys of each consumption point; only the key matching the
                `commodity` field is present, the others are omitted entirely.

                Consumption points come from two independent sources: the energobroker mapping (EAN/EIC,
                enriched with PRE metadata and PPAS invoices) and Porsenna e-manazer devices
                (`link_source: porsenna`) — heat and water meters, plus any EAN/EIC the mapping lacks.
                An OM known to both sources is returned once, with the Porsenna data nested as a `porsenna`
                sub-block (device, sub-meters, yearly consumption) inside its commodity block. Buildings
                tracked in Porsenna also carry an `energy_management` summary.

                The endpoint returns whatever data exists for the GID: if there is any building record,
                address, or consumption point, the response is 200 with the missing parts as `null` or
                empty arrays (e.g. `building: null` when only consumption points or addresses are known).
                404 is returned only when no source holds any data for the GID.
            parameters:
                - in: path
                  name: gid
                  required: true
                  schema:
                      type: string
                      example: GID100
            responses:
                "200":
                    description: OK
                    headers:
                        Cache-Control:
                            description: Cache control directive for caching proxies
                            schema:
                                type: string
                                example: public, s-maxage=21600, stale-while-revalidate=60
                    content:
                        application/json:
                            schema:
                                $ref: "#/components/schemas/EnergeticsEnoBuildingDetail"
                "401":
                    $ref: "#/components/responses/UnauthorizedError"
                "404":
                    $ref: "#/components/responses/NotFoundError"
                "500":
                    $ref: "#/components/responses/ServerError"

    /v2/energetics/devices:
        get:
            tags:
                - ⚡ Energetics (v2)
            summary: List of measurement devices
            responses:
                "200":
                    description: Success
                    headers:
                        Cache-Control:
                            description: Cache control directive for caching proxies
                            schema:
                                type: string
                                example: public, s-maxage=1800, stale-while-revalidate=60
                    content:
                        application/json:
                            schema:
                                type: array
                                items:
                                    $ref: "#/components/schemas/EnergeticsDevice"
                "401":
                    $ref: "#/components/responses/UnauthorizedError"
                "500":
                    $ref: "#/components/responses/ServerError"

    /v2/energetics/devices/{deviceId}:
        get:
            tags:
                - ⚡ Energetics (v2)
            summary: Measurement device info
            parameters:
                - name: deviceId
                  in: path
                  description: Id of device
                  required: true
                  schema:
                      type: integer
                      format: int32
                      example: 16
            responses:
                "200":
                    description: Success
                    headers:
                        Cache-Control:
                            description: Cache control directive for caching proxies
                            schema:
                                type: string
                                example: public, s-maxage=1800, stale-while-revalidate=60
                    content:
                        application/json:
                            schema:
                                $ref: "#/components/schemas/EnergeticsDevice"
                "401":
                    $ref: "#/components/responses/UnauthorizedError"
                "404":
                    $ref: "#/components/responses/NotFoundError"
                "500":
                    $ref: "#/components/responses/ServerError"

    /v2/energetics/organizations:
        get:
            tags:
                - ⚡ Energetics (v2)
            summary: List of organizations in brief or full format
            parameters:
                - name: full
                  in: query
                  description: Display full organization data.
                  required: false
                  schema:
                      type: boolean
                      default: false
                      example: false
            responses:
                "200":
                    description: Success
                    headers:
                        Cache-Control:
                            description: Cache control directive for caching proxies
                            schema:
                                type: string
                                example: public, s-maxage=1800, stale-while-revalidate=60
                    content:
                        application/json:
                            schema:
                                anyOf:
                                    - type: array
                                      items:
                                          $ref: "#/components/schemas/EnergeticsOrganizationShort"
                                    - type: array
                                      items:
                                          $ref: "#/components/schemas/EnergeticsOrganizationFull"
                "401":
                    $ref: "#/components/responses/UnauthorizedError"
                "500":
                    $ref: "#/components/responses/ServerError"

    /v2/energetics/organizations/{organizationId}:
        get:
            tags:
                - ⚡ Energetics (v2)
            summary: Organization detail
            parameters:
                - name: organizationId
                  in: path
                  description: Id of organization
                  required: true
                  schema:
                      type: integer
                      format: int32
                      example: 1
            responses:
                "200":
                    description: Success
                    headers:
                        Cache-Control:
                            description: Cache control directive for caching proxies
                            schema:
                                type: string
                                example: public, s-maxage=1800, stale-while-revalidate=60
                    content:
                        application/json:
                            schema:
                                $ref: "#/components/schemas/EnergeticsOrganizationFull"
                "400":
                    $ref: "#/components/responses/BadRequestError"
                "401":
                    $ref: "#/components/responses/UnauthorizedError"
                "404":
                    $ref: "#/components/responses/NotFoundError"
                "500":
                    $ref: "#/components/responses/ServerError"

    /v2/energetics/measurements:
        get:
            tags:
                - ⚡ Energetics (v2)
            summary: Measurements
            parameters:
                - name: variable
                  in: query
                  required: false
                  schema:
                      $ref: "#/components/schemas/EnergeticsVariables"
                  description: >-
                      core - Kumulovaný objem [m3]<br />
                      core2 - Kumulovaný přepočítaný objem [Nm3]<br />
                      EFwActi - Odběr činné energie [kWh]<br />
                      EFwActiVT - Odběr činné energie, vysoký tarif [kVArh]<br />
                      ERvReact - Dodávka jalové energie [kVArh]<br />
                      EFwReact - Odběr jalové energie [kVArh]<br />
                      raw - Číselník impulzů [imp]<br />
                      RSSI - Síla signálu [dBm]<br />
                      T - Teplota [°C]<br />
                      CO2 - Koncentrace CO2 [ppm]<br />
                      RH - Relativní vlhkost [%]<br />
                      EFwActiNT - Odběr činné energie, nízký tarif [kVArh]<br />
                      VOC - Míra koncentrace těkavých látek [%]<br />
                      VT - Vysoký tarif [kWh]<br />
                      NT - Nízký tarif [kWh]<br />
                - name: type
                  in: query
                  required: false
                  schema:
                      $ref: "#/components/schemas/EnergeticsTypes"
                  description: >-
                      monthly_reading - hodnoty sčítané po měsících z 15 minutových spotřeb poskytovaných firmou PRE<br />
                      provider_value - data získaná od poskytovatelů energií<br />
                      dotcontrols_value - data získaná ze systémů VisApp firmy DotControls<br />
                - name: addr1
                  in: query
                  required: false
                  schema:
                      type: string
                      example: "2.9"
                - name: addr2
                  in: query
                  required: false
                  schema:
                      type: string
                      example: "PF1"
                - name: dateFrom
                  in: query
                  schema:
                      type: string
                      format: date-time
                      example: 2023-05-01T00:00:00.000Z
                - name: dateTo
                  in: query
                  schema:
                      type: string
                      format: date-time
                      example: 2023-05-02T00:00:00.000Z
                - name: limit
                  in: query
                  description: Limits number of retrieved items.
                  schema:
                      type: integer
                      example: 10000
                - name: offset
                  in: query
                  description: Number of the first items that are skipped.
                  schema:
                      type: integer
                      example: 0
            responses:
                "200":
                    description: Success
                    headers:
                        Cache-Control:
                            description: Cache control directive for caching proxies
                            schema:
                                type: string
                                example: public, s-maxage=1800, stale-while-revalidate=60
                    content:
                        application/json:
                            schema:
                                type: array
                                items:
                                    $ref: "#/components/schemas/EnergeticsMeasurement"
                "400":
                    $ref: "#/components/responses/BadRequestError"
                "401":
                    $ref: "#/components/responses/UnauthorizedError"
                "500":
                    $ref: "#/components/responses/ServerError"

    /v2/energetics/measurements/monthly-reading:
        get:
            tags:
                - ⚡ Energetics (v2)
            summary: Monthly sums of measurements from devices
            parameters:
                - name: addr1
                  in: query
                  description: First part of device address
                  required: true
                  schema:
                      type: string
                      example: "2.9"
                - name: addr2
                  in: query
                  description: Second part of device address
                  required: true
                  schema:
                      type: string
                      example: "PF1"
                - name: variable
                  in: query
                  required: true
                  schema:
                      $ref: "#/components/schemas/EnergeticsVariables"
                  description: >-
                      core - Kumulovaný objem [m3]<br />
                      core2 - Kumulovaný přepočítaný objem [Nm3]<br />
                      EFwActi - Odběr činné energie [kWh]<br />
                      EFwActiVT - Odběr činné energie, vysoký tarif [kVArh]<br />
                      ERvReact - Dodávka jalové energie [kVArh]<br />
                      EFwReact - Odběr jalové energie [kVArh]<br />
                      raw - Číselník impulzů [imp]<br />
                      RSSI - Síla signálu [dBm]<br />
                      T - Teplota [°C]<br />
                      CO2 - Koncentrace CO2 [ppm]<br />
                      RH - Relativní vlhkost [%]<br />
                      EFwActiNT - Odběr činné energie, nízký tarif [kVArh]<br />
                      VOC - Míra koncentrace těkavých látek [%]<br />
                      VT - Vysoký tarif [kWh]<br />
                      NT - Nízký tarif [kWh]<br />
                - name: year
                  in: query
                  description: Year of measurement
                  required: true
                  schema:
                      type: integer
                      format: int32
                      example: 2023
                - name: month
                  in: query
                  description: Month of measurement
                  required: true
                  schema:
                      type: integer
                      format: int32
                      example: 5
            responses:
                "200":
                    description: Success
                    headers:
                        Cache-Control:
                            description: Cache control directive for caching proxies
                            schema:
                                type: string
                                example: public, s-maxage=1800, stale-while-revalidate=60
                    content:
                        application/json:
                            schema:
                                type: array
                                items:
                                    $ref: "#/components/schemas/EnergeticsMeasurement"
                "400":
                    $ref: "#/components/responses/BadRequestError"
                "401":
                    $ref: "#/components/responses/UnauthorizedError"
                "500":
                    $ref: "#/components/responses/ServerError"

components:
    responses:
        UnauthorizedError:
            description: API key is missing or invalid
            content:
                application/json; charset=utf-8:
                    schema:
                        type: object
                        properties:
                            error_message:
                                type: string
                                example: Unauthorized
                            error_status:
                                type: number
                                example: 401
                            error_info:
                                type: string
        NotFoundError:
            description: Record not found
            content:
                application/json; charset=utf-8:
                    schema:
                        type: object
                        properties:
                            error_message:
                                type: string
                                example: Not fount
                            error_status:
                                type: number
                                example: 404
                            error_info:
                                type: string
                                example: "Record with id 1 not fount"
        BadRequestError:
            description: Bad request
            content:
                application/json; charset=utf-8:
                    schema:
                        type: object
                        properties:
                            error_message:
                                type: string
                                example: Bad request
                            error_status:
                                type: number
                                example: 400
                            error_info:
                                type: string
                                example: '{"limit":{"location":"query","param":"limit","value":"-2","msg":"Invalid value"}}'
        ServerError:
            description: Server error
            content:
                application/json; charset=utf-8:
                    schema:
                        type: object
                        properties:
                            error_message:
                                type: string
                                example: Server error
                            error_status:
                                type: number
                                example: 500
                            error_info:
                                type: string

    schemas:
        EnergeticsDedBuildingSearch:
            type: object
            properties:
                query:
                    type: string
                    example: "859182400000000001"
                matched_exactly:
                    type: boolean
                    description: >-
                        True when the query resolved to an exact EAN, EIC, OM identifier or GID. In that case
                        the results contain only exact matches.
                    example: true
                results:
                    type: array
                    items:
                        $ref: "#/components/schemas/EnergeticsDedBuildingSearchResult"
            required:
                - query
                - matched_exactly
                - results

        EnergeticsDedBuildingSearchResult:
            type: object
            properties:
                gid:
                    type: string
                    example: GID100
                name:
                    type: string
                    nullable: true
                    example: ZŠ Testovací
                designation:
                    type: string
                    nullable: true
                    example: ZŠT
                registration_unit:
                    allOf:
                        - $ref: "#/components/schemas/EnergeticsEnoRegistrationUnit"
                    nullable: true
                    description: >-
                        Evidenční jednotka (eno_ciselnik_evidencni_jednotka) resolved through eno_majetek;
                        null when the building has no majetek record. Its name is part of the search vector.
                address:
                    type: string
                    nullable: true
                    description: Main address of the building.
                    example: Testovací 123/4, 100 00 Praha 10
                addresses:
                    type: array
                    description: Every distinct address of the building, the main one first.
                    items:
                        type: string
                    example:
                        - Testovací 123/4, 100 00 Praha 10
                        - Testovací 125/6, 100 00 Praha 10
                matched_by:
                    type: string
                    enum: [ean, eic, om, gid, name, address]
                    example: ean
                matched_value:
                    type: string
                    nullable: true
                    description: The identifier that matched. Null for non-exact matches.
                    example: "859182400000000001"
                score:
                    type: number
                    description: Relevance score. Exact matches always score 1000.
                    example: 1000
                identifiers:
                    type: object
                    properties:
                        ean:
                            type: array
                            items:
                                type: string
                        eic:
                            type: array
                            items:
                                type: string
                        om:
                            type: array
                            items:
                                type: string
                geometry:
                    type: object
                    nullable: true
                    description: Building outline as GeoJSON geometry in WGS84 (EPSG:4326).
                    properties:
                        type:
                            type: string
                            example: MultiPolygon
                        coordinates:
                            type: array
                            items: {}
                bbox:
                    type: array
                    nullable: true
                    description: "[minLon, minLat, maxLon, maxLat] in WGS84, for zooming the map."
                    items:
                        type: number
                    minItems: 4
                    maxItems: 4
                    example: [14.4174, 50.0863, 14.4188, 50.0873]
                centroid:
                    type: object
                    nullable: true
                    properties:
                        lat:
                            type: number
                            example: 50.0868
                        lon:
                            type: number
                            example: 14.4181
                geometry_source:
                    type: string
                    nullable: true
                    description: Source of the geometry, null when the building has none.
                    example: eno_geometrie
                has_building_record:
                    type: boolean
                    description: >-
                        False when the GID is known only through the consumption-point mapping or Porsenna
                        and has no eno_budova record. Such results are ranked below described buildings.
                    example: true
                active_points_count:
                    type: integer
                    example: 3
            # Every property is emitted unconditionally by DedBuildingSearchTransformation - the
            # nullable ones are present with a null value, never absent.
            required:
                - gid
                - name
                - designation
                - registration_unit
                - address
                - addresses
                - matched_by
                - matched_value
                - score
                - identifiers
                - geometry
                - bbox
                - centroid
                - geometry_source
                - has_building_record
                - active_points_count

        EnergeticsEnoRegistrationUnit:
            type: object
            description: >-
                Evidenční jednotka (eno_ciselnik_evidencni_jednotka) resolved through the building's
                eno_majetek record. The same shape is returned by the search and the detail endpoint.
            properties:
                id:
                    type: number
                    nullable: true
                    example: 7001
                kod:
                    type: string
                    nullable: true
                    example: EJ-7001
                nazev:
                    type: string
                    nullable: true
                    example: Evidenční jednotka Praha 10
                typ:
                    type: string
                    nullable: true
                    example: škola
            required:
                - id
                - kod
                - nazev
                - typ

        EnergeticsEnoBuildingDetail:
            type: object
            properties:
                gid:
                    type: string
                    example: GID100
                building:
                    type: object
                    nullable: true
                    description: >-
                        All available eno_budova attributes (Czech identifiers mirror the upstream ENO source).
                        Null when the GID has no ENO building record and is known only through the
                        consumption-point mapping.
                    properties:
                        zdroj:
                            type: string
                            nullable: true
                        nazev:
                            type: string
                            nullable: true
                        oznaceni:
                            type: string
                            nullable: true
                        druh_vytapeni:
                            type: string
                            nullable: true
                        pripojka_elektro:
                            type: string
                            nullable: true
                        pripojka_voda:
                            type: string
                            nullable: true
                        pripojka_kanalizace:
                            type: string
                            nullable: true
                    additionalProperties: true
                property:
                    type: object
                    nullable: true
                    description: >-
                        ENO lookup data (eno_ciselnik_*) resolved through the building's eno_majetek record.
                        Null when the building has no majetek record.
                    properties:
                        registration_unit:
                            allOf:
                                - $ref: "#/components/schemas/EnergeticsEnoRegistrationUnit"
                            nullable: true
                            description: Evidenční jednotka (eno_ciselnik_evidencni_jednotka).
                        managers:
                            type: object
                            description: Správci (eno_ciselnik_spravce) from the mandate and accounting-unit references.
                            properties:
                                mandate:
                                    type: object
                                    nullable: true
                                    description: Správce referenced by eno_majetek.id_maj_spravce_mandatni.
                                    properties:
                                        id:
                                            type: number
                                            nullable: true
                                        kod:
                                            type: string
                                            nullable: true
                                        nazev:
                                            type: string
                                            nullable: true
                                        ic:
                                            type: string
                                            nullable: true
                                        dic:
                                            type: string
                                            nullable: true
                                accounting_unit:
                                    type: object
                                    nullable: true
                                    description: Správce referenced by eno_majetek.id_maj_spravce_ucet_jednotka.
                                    properties:
                                        id:
                                            type: number
                                            nullable: true
                                        kod:
                                            type: string
                                            nullable: true
                                        nazev:
                                            type: string
                                            nullable: true
                                        ic:
                                            type: string
                                            nullable: true
                                        dic:
                                            type: string
                                            nullable: true
                addresses:
                    type: array
                    items:
                        type: object
                        properties:
                            popis:
                                type: string
                                nullable: true
                            hlavni:
                                type: boolean
                                nullable: true
                            poradi:
                                type: number
                energy_management:
                    type: object
                    nullable: true
                    description: Porsenna (e-manazer) tracking summary; null when the building is not tracked there
                    properties:
                        source:
                            type: string
                            example: porsenna_p7
                        building_name:
                            type: string
                            nullable: true
                        address:
                            type: string
                            nullable: true
                        devices_total:
                            type: number
                        devices_active:
                            type: number
                consumption_points:
                    type: array
                    items:
                        $ref: "#/components/schemas/EnergeticsEnoConsumptionPoint"
        EnergeticsEnoPorsennaBlock:
            type: object
            description: Porsenna (e-manazer) device detail with sub-meters and yearly consumption aggregates
            properties:
                device:
                    type: object
                    additionalProperties: true
                sub_devices:
                    type: array
                    items:
                        type: object
                        additionalProperties: true
                yearly_consumption:
                    type: array
                    items:
                        type: object
                        properties:
                            period:
                                type: string
                                example: "2024"
                            value:
                                type: number
                            unit:
                                type: string
                                example: GJ
                            days_covered:
                                type: number
                                nullable: true
        EnergeticsEnoConsumptionPoint:
            type: object
            properties:
                place_id:
                    type: string
                    example: 27ZG100Z0000192O
                id_type:
                    type: string
                    enum: [ean, eic, om]
                commodity:
                    type: string
                    enum: [electricity, gas, heat, water]
                is_first_gid:
                    type: boolean
                is_active:
                    type: boolean
                    description: Derived from valid_to (null or in the future means the mapping is active)
                link_source:
                    type: string
                    example: mock
                valid_from:
                    type: string
                    format: date
                    nullable: true
                valid_to:
                    type: string
                    format: date
                    nullable: true
                address:
                    type: string
                    nullable: true
                    description: Consumption point address from the best available source
                electricity:
                    type: object
                    description: Electricity-specific data (present only for commodity = electricity, omitted otherwise)
                    properties:
                        metadata:
                            type: object
                            nullable: true
                            description: Latest available month of PRE metadata for the EAN
                            additionalProperties: true
                        porsenna:
                            $ref: "#/components/schemas/EnergeticsEnoPorsennaBlock"
                gas:
                    type: object
                    description: Gas-specific data (present only for commodity = gas, omitted otherwise)
                    properties:
                        porsenna:
                            $ref: "#/components/schemas/EnergeticsEnoPorsennaBlock"
                        distribution:
                            type: object
                            nullable: true
                            description: Latest non-canceled PPAS distribution invoice with its installation, devices and prices
                            properties:
                                invoice:
                                    type: object
                                    additionalProperties: true
                                installation:
                                    type: object
                                    additionalProperties: true
                                devices:
                                    type: array
                                    items:
                                        type: object
                                        additionalProperties: true
                                prices:
                                    type: array
                                    items:
                                        type: object
                                        additionalProperties: true
                        commercial:
                            type: object
                            nullable: true
                            description: Latest non-canceled PPAS commercial invoice with its installation, devices and prices
                            properties:
                                invoice:
                                    type: object
                                    additionalProperties: true
                                installation:
                                    type: object
                                    additionalProperties: true
                                devices:
                                    type: array
                                    items:
                                        type: object
                                        additionalProperties: true
                                prices:
                                    type: array
                                    items:
                                        type: object
                                        additionalProperties: true
                heat:
                    type: object
                    description: Heat-specific data (present only for commodity = heat, omitted otherwise; Porsenna-sourced)
                    properties:
                        porsenna:
                            $ref: "#/components/schemas/EnergeticsEnoPorsennaBlock"
                water:
                    type: object
                    description: Water-specific data (present only for commodity = water, omitted otherwise; Porsenna-sourced)
                    properties:
                        porsenna:
                            $ref: "#/components/schemas/EnergeticsEnoPorsennaBlock"
        EnergeticsBuildingShort:
            type: object
            properties:
                id:
                    type: number
                name:
                    type: string
                building_address_code:
                    type: string
                link:
                    type: string
        EnergeticsBuildingFull:
            type: object
            properties:
                id:
                    type: number
                name:
                    type: string
                    nullable: true
                main_use:
                    type: string
                    nullable: true
                method_of_protection:
                    type: string
                    nullable: true
                address:
                    type: object
                    properties:
                        city:
                            type: string
                            nullable: true
                        country:
                            type: string
                            nullable: true
                        house_number:
                            type: string
                            nullable: true
                        mail:
                            type: string
                            nullable: true
                        phone:
                            type: string
                            nullable: true
                        street:
                            type: string
                            nullable: true
                        web_address:
                            type: string
                            nullable: true
                    nullable: true
                allotment_number:
                    type: string
                    nullable: true
                beds_count:
                    type: number
                    nullable: true
                building_address_code:
                    type: string
                    nullable: true
                building_envelope:
                    type: object
                    properties:
                        filling_of_hole:
                            type: object
                            properties:
                                area:
                                    type: number
                                    nullable: true
                                construction:
                                    type: string
                                    nullable: true
                                technical_condition:
                                    type: string
                                    nullable: true
                                year_of_adjustment:
                                    type: string
                                    nullable: true
                            nullable: true
                        floor_of_the_lowest_heated_floor:
                            type: object
                            properties:
                                area:
                                    type: number
                                    nullable: true
                                construction:
                                    type: string
                                    nullable: true
                                year_of_adjustment:
                                    type: string
                                    nullable: true
                                technical_condition:
                                    type: string
                                    nullable: true
                                thermal_insulation:
                                    type: string
                                    nullable: true
                            nullable: true
                        roof:
                            type: object
                            properties:
                                area:
                                    type: number
                                    nullable: true
                                construction:
                                    type: string
                                    nullable: true
                                technical_condition:
                                    type: string
                                    nullable: true
                                thermal_insulation:
                                    type: string
                                    nullable: true
                                year_of_adjustment:
                                    type: string
                                    nullable: true
                            nullable: true
                        side_wall:
                            type: object
                            properties:
                                area:
                                    type: number
                                    nullable: true
                                heat_insulation:
                                    type: string
                                    nullable: true
                                prevailing_construction:
                                    type: string
                                    nullable: true
                                technical_condition:
                                    type: string
                                    nullable: true
                                year_of_adjustment:
                                    type: string
                                    nullable: true
                            nullable: true
                    nullable: true
                label:
                    type: string
                    nullable: true
                built_up_area:
                    type: number
                    nullable: true
                classrooms_count:
                    type: number
                    nullable: true
                csu_code:
                    type: string
                    nullable: true
                current_note:
                    type: string
                    nullable: true
                description:
                    type: string
                    nullable: true
                employees_count:
                    type: number
                    nullable: true
                energetic_management:
                    type: string
                    nullable: true
                energy_audits:
                    type: object
                    properties:
                        created_at:
                            type: string
                            nullable: true
                        ea_registration_number:
                            type: string
                            nullable: true
                        energy_audit:
                            type: string
                            nullable: true
                    nullable: true
                eno_id:
                    type: string
                    nullable: true
                fuel_and_energy:
                    type: object
                    properties:
                        coal:
                            type: boolean
                            nullable: true
                        czt:
                            type: boolean
                            nullable: true
                        electricity:
                            type: boolean
                            nullable: true
                        gas:
                            type: boolean
                            nullable: true
                        other:
                            type: boolean
                            nullable: true
                        oze:
                            type: boolean
                            nullable: true
                    nullable: true
                heated_bulding_volume:
                    type: number
                    nullable: true
                ku_code:
                    type: string
                    nullable: true
                location:
                    type: object
                    nullable: true
                    properties:
                        type:
                            type: string
                            example: "Point"
                        coordinates:
                            $ref: "#/components/schemas/Point"
                    required:
                        - coordinates
                        - type
                link:
                    type: string
                oze_energy_production:
                    type: object
                    properties:
                        heat_pump:
                            type: string
                            nullable: true
                        integrated_turbines_wind_energy:
                            type: string
                            nullable: true
                        solar_energy_photothermal:
                            type: string
                            nullable: true
                        solar_energy_photovoltaic:
                            type: string
                            nullable: true
                    nullable: true
                penb:
                    type: object
                    properties:
                        building_envelope:
                            type: number
                            nullable: true
                        building_envelope_category:
                            type: string
                            nullable: true
                        cooling:
                            type: number
                            nullable: true
                        cooling_category:
                            type: string
                            nullable: true
                        heating:
                            type: number
                            nullable: true
                        heating_category:
                            type: string
                            nullable: true
                        humidity_adjustment:
                            type: number
                            nullable: true
                        humidity_adjustment_category:
                            type: string
                            nullable: true
                        issue_date:
                            type: string
                            nullable: true
                        lighting:
                            type: number
                            nullable: true
                        lighting_category:
                            type: string
                            nullable: true
                        penb_number:
                            type: number
                            nullable: true
                        primary_non_renewable_energy:
                            type: number
                            nullable: true
                        primary_non_renewable_energy_category:
                            type: string
                            nullable: true
                        total_building_envelope_area:
                            type: number
                            nullable: true
                        total_energy_reference_area:
                            type: number
                            nullable: true
                        total_provided_energy:
                            type: number
                            nullable: true
                        total_provided_energy_category:
                            type: string
                            nullable: true
                        ventilation:
                            type: number
                            nullable: true
                        ventilation_category:
                            type: string
                            nullable: true
                        volume_factor_of_av_shape:
                            type: string
                            nullable: true
                        warm_water:
                            type: number
                            nullable: true
                        warm_water_category:
                            type: string
                            nullable: true
                    nullable: true
                registration_unit:
                    type: string
                    nullable: true
                secondary_use:
                    type: string
                    nullable: true
                students_count:
                    type: number
                    nullable: true
                technical_equipment:
                    type: object
                    properties:
                        cooling:
                            type: object
                            properties:
                                cooling_area_percentage:
                                    type: number
                                    nullable: true
                                cooling_system:
                                    type: string
                                    nullable: true
                                technical_condition:
                                    type: string
                                    nullable: true
                                year:
                                    type: string
                                    nullable: true
                            nullable: true
                        heating:
                            type: object
                            properties:
                                heat_percentage:
                                    type: number
                                    nullable: true
                                heating_system:
                                    type: string
                                    nullable: true
                                main_source_of_heat:
                                    type: string
                                    nullable: true
                                secondary_source_of_heat:
                                    type: string
                                    nullable: true
                                technical_condition:
                                    type: string
                                    nullable: true
                                year:
                                    type: string
                                    nullable: true
                            nullable: true
                        hot_water:
                            type: object
                            properties:
                                hot_water_source:
                                    type: string
                                    nullable: true
                                predominant_way_of_heating_tv:
                                    type: string
                                    nullable: true
                                technical_condition:
                                    type: string
                                    nullable: true
                                year:
                                    type: string
                                    nullable: true
                            nullable: true
                        humidity_adjustment:
                            type: object
                            properties:
                                humidity_adjustment:
                                    type: string
                                    nullable: true
                                technical_condition:
                                    type: string
                                    nullable: true
                                year:
                                    type: string
                                    nullable: true
                            nullable: true
                        lighting:
                            type: object
                            properties:
                                lighting:
                                    type: string
                                    nullable: true
                                measurement_method:
                                    type: string
                                    nullable: true
                                other_technological_elements:
                                    type: string
                                    nullable: true
                                technical_condition:
                                    type: string
                                    nullable: true
                                year:
                                    type: string
                                    nullable: true
                            nullable: true
                        ventilation:
                            type: object
                            properties:
                                technical_condition:
                                    type: string
                                    nullable: true
                                ventilation:
                                    type: string
                                    nullable: true
                                year:
                                    type: string
                                    nullable: true
                            nullable: true
                    nullable: true
                waste_and_emissions:
                    type: object
                    properties:
                        operating_co2_emissions:
                            type: string
                            nullable: true
                        solid_waste_production:
                            type: string
                            nullable: true
                        sox_emissions:
                            type: string
                            nullable: true
                        tied_co2_emissions:
                            type: string
                            nullable: true
                    nullable: true
                weekend_opening_hours:
                    type: string
                    nullable: true
                opening_hours:
                    type: string
                    nullable: true
                year_of_construction:
                    type: number
                    nullable: true
        EnergeticsAddress:
            type: object
            properties:
                street:
                    type: string
                    nullable: true
                house_number:
                    type: string
                    nullable: true
                city:
                    type: string
                    nullable: true
                country:
                    type: string
                    nullable: true
                mail:
                    type: string
                    nullable: true
                phone:
                    type: string
                    nullable: true
                web_address:
                    type: string
                    nullable: true
            additionalProperties: false
        EnergeticsDevice:
            type: object
            properties:
                id:
                    type: integer
                    format: int32
                addr:
                    type: string
                    nullable: true
                description:
                    type: string
                    nullable: true
                meter_number:
                    type: string
                    nullable: true
                meter_index:
                    type: integer
                    format: int32
                    nullable: true
                location_number:
                    type: string
                    nullable: true
                location_description:
                    type: string
                    nullable: true
                include_in_evaluation:
                    type: string
                    nullable: true
                meter_type:
                    type: string
                    nullable: true
                category:
                    type: string
                    nullable: true
                unit:
                    type: string
                    nullable: true
                replaced_meter_id:
                    type: string
                    nullable: true
                deleted:
                    type: string
                    nullable: true
                building_id:
                    type: integer
                    format: int32
                    nullable: true
            additionalProperties: false
        EnergeticsOrganizationFull:
            type: object
            properties:
                id:
                    type: integer
                    format: int32
                name:
                    type: string
                    nullable: true
                label:
                    type: string
                    nullable: true
                category:
                    type: string
                    nullable: true
                created_by_id:
                    type: string
                    nullable: true
                grafana_url:
                    type: string
                    nullable: true
                address:
                    $ref: "#/components/schemas/EnergeticsAddress"
                responsible_user:
                    type: array
                    items:
                        $ref: "#/components/schemas/EnergeticsUser"
                    nullable: true
                buildings:
                    type: array
                    items:
                        $ref: "#/components/schemas/EnergeticsBuildingShort"
                    nullable: true
                link:
                    type: string
                    nullable: true
            additionalProperties: false
        EnergeticsOrganizationShort:
            type: object
            properties:
                id:
                    type: integer
                    format: int32
                name:
                    type: string
                    nullable: true
                link:
                    type: string
                    nullable: true
            additionalProperties: false
        EnergeticsUser:
            type: object
            properties:
                name:
                    type: string
                    nullable: true
                last_name:
                    type: string
                    nullable: true
                position:
                    type: string
                    nullable: true
                phone:
                    type: string
                    nullable: true
                mail:
                    type: string
                    nullable: true
                company:
                    type: string
                    nullable: true
            additionalProperties: false
        Point:
            title: Point
            type: array
            minItems: 2
            maxItems: 2
            items:
                type: number
                format: float
            example:
                - 14.4633
                - 50.07827
        EnergeticsMeasurement:
            type: object
            properties:
                time:
                    type: string
                    format: date-time
                value:
                    type: string
                addr:
                    type: string
                meter:
                    type: string
                    nullable: true
                type:
                    $ref: "#/components/schemas/EnergeticsTypes"
                var:
                    $ref: "#/components/schemas/EnergeticsVariables"
            additionalProperties: false
        EnergeticsVariables:
            type: string
            example: core2
            enum:
                - core
                - core2
                - EFwActi
                - EFwActiVT
                - ERvReact
                - EFwReact
                - raw
                - T
                - CO2
                - RH
                - EFwActiNT
                - VOC
            description: >-
                core - Kumulovaný objem [m3]<br />
                core2 - Kumulovaný přepočítaný objem [Nm3]<br />
                EFwActi - Odběr činné energie [kWh]<br />
                EFwActiVT - Odběr činné energie, vysoký tarif [kVArh]<br />
                ERvReact - Dodávka jalové energie [kVArh]<br />
                EFwReact - Odběr jalové energie [kVArh]<br />
                raw - Číselník impulzů [imp]<br />
                RSSI - Síla signálu [dBm]<br />
                T - Teplota [°C]<br />
                CO2 - Koncentrace CO2 [ppm]<br />
                RH - Relativní vlhkost [%]<br />
                EFwActiNT - Odběr činné energie, nízký tarif [kVArh]<br />
                VOC - Míra koncentrace těkavých látek [%]<br />
                VT - Vysoký tarif [kWh]<br />
                NT - Nízký tarif [kWh]<br />
        EnergeticsTypes:
            type: string
            example: provider_value
            enum:
                - monthly_reading
                - provider_value
                - dotcontrols_value
            description: >-
                monthly_reading - hodnoty sčítané po měsících z 15 minutových spotřeb poskytovaných firmou PRE<br />
                provider_value - data získaná od poskytovatelů energií<br />
                dotcontrols_value - data získaná ze systémů VisApp firmy DotControls<br />
