EMS Plant

Fetch Energy Metrics for Plant

GET /_ems/plant/<plant_id>

Description Fetch details of Energy Metrics of a specific Plant by its ID.

HTTP Method GET

ENDPOINT /_ems/plant/<plant_id>

Request Header Authorization Basic <token>

Request Parameters

URL Parameters

  • plant_id (string, required): The ID of the plant to retrieve details for.

Query Parameters

  • from (date range, required): The date range from when to retrieve details for the plant.

  • to (date range, required): The date range till when to retrieve details for the plant.

Sample Request

curl -X GET 'https://app.4pointx.com/_ems/plant/e29ae75e-dd88-45ef-90cb-cefb3807af70?from=2023-10-24T10:32:24.527Z&to=2023-10-30T10:32:24.527Z' \
--header 'Authorization: Basic <token>' \

Sample Response

Success

{
    "site_id": "d2e66edd-f13f-4d00-a7b5-8cab9ef4488d",
    "site_name": "Demo Site",
    "plant_id": "54c95758-a66d-45fd-8118-2ce361b505f5",
    "plant_name": "test-plant-demo13",
    "total_consumption": 0.0,
    "total_energy": 0.0,
    "energy_unit": "MWh",
    "total_production": 0.0,
    "production_unit": "ton",
    "idle_energy": 0.0,
    "idle_energy_percent": 0.0,
    "kwh_per_unit": 0.0
}

Error

{
"error": {
    "status": 401,
    "message": "Unauthorized access to module by general-user"
    }
}
{
"error": {
    "status": 400,
    "message": "Plant id not given"
    }
}
{
"error": {
    "status": 400,
    "message": "Insufficient date inputs"
    }
}
{
"error": {
    "status": 400,
    "message": "Invalid date format"
    }
}
{
"error": {
    "status": 400,
    "message": "Plant details not found"
    }
}
{
"error": {
    "status": 400,
    "message": "Site details not found"
    }
}

Fetch Energy Metric trend for Plant

GET /_ems/plant/_trend/<plant_id>

Description Fetch details of Energy Metrics of a specific plant by its ID.

HTTP Method GET

ENDPOINT /_ems/plant/_trend/<plant_id>

Request Header Authorization Basic <token>

Request Parameters

URL Parameters

  • plant_id (string, required): The ID of the plant to retrieve trend for.

Query Parameters

  • metric (string, required): The type of trend selected from predefined options such as (consumption_chart, prod_vs_kwh_per_ton, or idle_energy_trend) each triggering a distinct process.

  • interval (time range, required): Hourly, Daily, Weekly or Monthly trend to be collected.

  • from (date range, required): The date range from when to retrieve details for the plant.

  • to (date range, required): The date range till when to retrieve details for the plant.

Sample Request

  • Case 1: Metric is ‘consumption_chart’

curl -X GET 'https://app.4pointx.com/_ems/plant/_trend/e6f198d8-bb55-46ea-bf01-424f512553d4?from=2023-05-10T18:30:00.000Z&to=2023-05-29T18:29:59.999Z&metric=consumption_chart&interval=week' \
--header 'Authorization: Basic <token>' \
  • Case 2: Metric is ‘prod_vs_kwh_per_ton’

curl -X GET 'https://app.4pointx.com/_ems/plant/_trend/29d7b29a-080a-4304-b61f-d318b8a33c07?from=2023-04-30T18:30:00.000Z&to=2023-05-05T18:30:00.000Z&metric=prod_vs_kwh_per_ton&interval=day' \
--header 'Authorization: Basic <token>' \
  • Case 3: Metric is ‘idle_energy_trend’

curl -X GET 'https://app.4pointx.com/_ems/plant/_trend/29d7b29a-080a-4304-b61f-d318b8a33c07?from=2023-04-30T18:30:00.000Z&to=2023-05-05T18:30:00.000Z&metric=idle_energy_trend&interval=day' \
--header 'Authorization: Basic <token>' \

Sample Response

Success

  • Case 1: Metric is ‘consumption_chart’

[
    {
        "Date": "2023-05-07T00:00:00.000Z",
        "Energy": 450.47,
        "unit": "MWh"
    },
    {
        "Date": "2023-05-14T00:00:00.000Z",
        "Energy": 114.48,
        "unit": "MWh"
    },
    {
        "Date": "2023-05-21T00:00:00.000Z",
        "Energy": 153.22,
        "unit": "MWh"
    },
    {
        "Date": "2023-05-28T00:00:00.000Z",
        "Energy": 60.61,
        "unit": "MWh"
    },
    {
        "Date": "2023-06-04T00:00:00.000Z",
        "Energy": 0.0,
        "unit": "MWh"
    }
]
  • Case 2: Metric is ‘prod_vs_kwh_per_ton’

[
    {
        "date": "2023-04-30T00:00:00.000Z",
        "energy": 0.0,
        "production": 0.0,
        "energy_unit": "kWh",
        "production_unit": "ton"
    },
    {
        "date": "2023-05-01T00:00:00.000Z",
        "energy": 1887.12,
        "production": 460.69,
        "energy_unit": "kWh",
        "production_unit": "ton"
    },
    {
        "date": "2023-05-02T00:00:00.000Z",
        "energy": 4180.28,
        "production": 195.34,
        "energy_unit": "kWh",
        "production_unit": "ton"
    },
    {
        "date": "2023-05-03T00:00:00.000Z",
        "energy": 1582.43,
        "production": 527.76,
        "energy_unit": "kWh",
        "production_unit": "ton"
    },
    {
        "date": "2023-05-04T00:00:00.000Z",
        "energy": 1908.72,
        "production": 349.99,
        "energy_unit": "kWh",
        "production_unit": "ton"
    },
    {
        "date": "2023-05-05T00:00:00.000Z",
        "energy": 727.83,
        "production": 683.49,
        "energy_unit": "kWh",
        "production_unit": "ton"
    }
]
  • Case 3: Metric is ‘idle_energy_trend’

[
    {
        "idle_energy": 28.48,
        "date": "2023-04-30T00:00:00.000Z",
        "unit": "MWh"
    },
    {
        "idle_energy": 39.75,
        "date": "2023-05-01T00:00:00.000Z",
        "unit": "MWh"
    },
    {
        "idle_energy": 64.9,
        "date": "2023-05-02T00:00:00.000Z",
        "unit": "MWh"
    },
    {
        "idle_energy": 42.62,
        "date": "2023-05-03T00:00:00.000Z",
        "unit": "MWh"
    },
    {
        "idle_energy": 36.64,
        "date": "2023-05-04T00:00:00.000Z",
        "unit": "MWh"
    },
    {
        "idle_energy": 30.03,
        "date": "2023-05-05T00:00:00.000Z",
        "unit": "MWh"
    }
]

Error

{
"error": {
    "status": 401,
    "message": "Unauthorized access to module by general-user"
    }
}
{
"error": {
    "status": 400,
    "message": "Plant id not given"
    }
}
{
"error": {
    "status": 400,
    "message": "Plant details not found"
    }
}
{
"error": {
    "status": 400,
    "message": "Metric not given"
    }
}
{
"error": {
    "status": 400,
    "message": "Insufficient date inputs"
    }
}
{
"error": {
    "status": 400,
    "message": "Invalid date format"
    }
}
{
"error": {
    "status": 400,
    "message": "Idle energy data not available"
    }
}
{
"error": {
    "status": 400,
    "message": "Energy and Production data not available"
  }
}
{
"error": {
    "status": 400,
    "message": "Energy data not available"
  }
}
{
"error": {
    "status": 400,
    "message": "Production data not available"
  }
}