Create meters

Create meters

This API creates meters in Fracttal.

Body Parameters

Parameter

Type

Required

Description

description

Text

YES

Meter description

item_code

Text

YES

Asset code to which the meter belongs

unit_code

Text

YES

Meter unit code

serial

Text

No

Meter serial number (Must be unique)

is_counter

Text

No

Value that indicates if the meter is a counter type

serial_parent_meter

Text

No

Parent meter serial number

last_reading

Text

No

Current meter value (last reading). Applies when the meter is a counter

date_reading

Date

No

Date of the last reading. Format: 'YYYY-MM-DDTHH:MM:SS-UTC' Example:'2023-07-12T20:00:00-03′. Applies when the meter is a counter

monthly_average_data

Text

No

Monthly average value. Applies when the meter is a counter

monthly_average_auto

Boolean

No

Automatic average value. Applies when the meter is a counter

Output Parameters

Parameter

Type

Description

id

Text

Meter ID

code

Text

Asset code

description

Text

Meter description

serial

Text

Meter serial number

is_counter

Text

Value that indicates if the meter is a counter type

counter_offset_value

Text

Accumulated value

counter_value

Text

Current meter value

last_data

Text

Information from the last reading added to the meter: -"date": date, -"value": value, -"accumulated_value": accumulated value

monthly_average_data

Text

Monthly average value

units_description

Text

Meter unit description

units_code

Text

Meter unit code

items_description

Text

Description of the asset to which the meter belongs

parent_description

Text

Location to which the asset belongs

monthly_average_auto

Boolean

Value that indicates if the monthly average will be calculated by the system or manually entered by the user

min_value

Number

Meter minimum value

max_value

Number

Meter maximum value

Example:

Request: (POST)https://app.fracttal.com/api/meters

{
  "description": "Medidor por API",
  "item_code": "EQM028",
  "unit_code": "UND",
  "serial": "API",
  "is_counter": true,
  "last_reading": 50,
  "date_reading": "2023-01-12T20:00:00-03",
  "monthly_average_auto": true
}
{
  "success": true,
  "message": "200",
  "data": {
    "id": 352871,
    "code": "EQM028",
    "value": "50",
    "id_hub": null,
    "serial": "API",
    "id_item": 145,
    "id_unit": 1,
    "id_group": null,
    "last_data": {
      "date": "2023-01-12T23:00:00+00:00",
      "value": 50,
      "accumulated_value": 50
    },
    "max_value": null,
    "min_value": null,
    "id_company": 69,
    "id_group_1": null,
    "id_group_2": null,
    "is_counter": true,
    "slot_index": null,
    "units_code": "UND",
    "description": "Medidor por API",
    "id_priority": null,
    "id_hub_model": null,
    "id_type_item": 2,
    "id_unit_type": 2,
    "channel_index": null,
    "counter_value": 50,
    "id_meter_type": 1,
    "id_cost_center": null,
    "id_parent_meter": null,
    "item_id_priority": null,
    "path_description": "// REFRIGERADOR DE VACUNAS/ ",
    "items_description": "REFRIGERADOR DE VACUNAS SAMSUNG C13 D 001827 02 RACKS 750X580X390 { EQM028 }",
    "units_description": "Unidad",
    "parent_description": "// ",
    "counter_offset_value": 0,
    "monthly_average_auto": true,
    "monthly_average_data": null,
    "parent_meter_description": " {}"
  },
  "total": 1
}
Language