system.mes.meter.getMeterType
Description
Retrieves a Meter Type record by its ID or name.
Permissions
This method requires the METERING.READ.GET permission.
Syntax
system.mes.meter.getMeterType(idOrName)
Parameters
| Parameter | Type | Nullable | Description |
|---|---|---|---|
idOrName | String | False | The ID or name of the Meter Type to retrieve. |
Returns
Returns a JSON representation of the Meter Type. Returns nothing if no Meter Type is found.
| Name | Type | Description |
|---|---|---|
id | String (ULID) | The ULID of the Meter Type. |
name | String | Display name for this meter type (e.g., Water, Electricity, Gas). |
usageUnitOfMeasureId | String (ULID) | The ULID of the unit of measure for usage values. |
usageUnitOfMeasureName | String | Display name of the usage unit of measure. |
usageUnitOfMeasureSymbol | String | Symbol of the usage unit of measure (e.g., kWh). |
cost | Double | Default cost per unit of measure. |
costUnitOfMeasureId | String (ULID) | The ULID of the unit of measure for cost values. |
costUnitOfMeasureName | String | Display name of the cost unit of measure. |
costUnitOfMeasureSymbol | String | Symbol of the cost unit of measure (e.g., USD). |
notes | String | Notes related to the meter type. |
enabled | Boolean | Indicates if the meter type is active and enabled. |
spare1 | String | Additional field for user-defined context. |
spare2 | String | Additional field for user-defined context. |
spare3 | String | Additional field for user-defined context. |
Code Examples
# Retrieve a Meter Type by name
meterType = system.mes.meter.getMeterType('Electricity')
# Output the Meter Type
print(meterType)