This service provides access to the CTid® facility built into the EG4xxx series meters. Specifically, it enables:
retrieving the CTid® information from a sensor,
flashing the (optional) locator LED on the sensor, and
deleting the stored CTid® information associated with a sensor port.
Note that while scanning or flashing a sensor, normal measurement of local sensors is suspended. It is therefore recommended to use this service primarily during device setup.
All methods other than GET
required a user with the save
right.
A Python program illustrating the use of this service can be found
here.
This program takes advantage of class
egauge.webapi.device.CTidInfo
to handle the details of encoding
the HTTP requests and decoding the responses.
Read the existing (previously scanned) CTid® info of all sensor ports.
CTid® information response.
Unauthorized response.
{- "info": [
- {
- "ts": "1678384222",
- "tid": 2,
- "port": 1,
- "polarity": "+",
- "version": 4,
- "mfgid": 0,
- "model": "EV1000",
- "sn": 80,
- "k": 3,
- "rsrc": 160,
- "rload": 10000000,
- "params": {
- "scale": 2071.98706,
- "offset": 0,
- "delay": 116.27,
- "unit": 0
}
}, - {
- "ts": "1668455577",
- "tid": 2008264382,
- "port": 2,
- "polarity": "+",
- "version": 2,
- "mfgid": 0,
- "model": "ERA",
- "sn": 2,
- "k": 2,
- "rsvd": 0,
- "mfgdata": 0,
- "rsrc": 176,
- "rload": 10000000,
- "params": {
- "size": 106,
- "i": 2775,
- "v": 0.33333,
- "a": 0.45,
- "tv": 0,
- "ta": 0,
- "cal": {
- "1.5": {
- "v": 0,
- "a": 0
}, - "5.0": {
- "v": 0,
- "a": 0
}, - "15.0": {
- "v": 0,
- "a": 0
}, - "50.0": {
- "v": 0,
- "a": 0
}
}
}
}
]
}
Write CTid® info of the sensor ports specified in the request body to the meter. This does not update the CTid® info on the sensors themselves.
This method is supported mainly for testing purposes. However, it could also be used to fix faulty or inaccurate sensor information. The written information will persist only until the sensor ports are scanned again, so this would only be a temporary fix.
Array of objects (CTidInfoObject) |
CTid® information response.
Unauthorized response.
{ }
{- "status": "OK",
- "error": "Error message (present if an error occurred)."
}
Read the CTid® info of a sensor port or get the status of an operation that is in progress.
Without a query parameter, this returns the CTid® info object of the most recent scan. If the port has not been scanned or the scan failed, an empty object is returned instead.
If the tid
query parameter is specified, it must be the
transaction id of a CTid® operation that was previously
initiated on this port. A status object is returned if the
operation identified by tid
is still in progress. Otherwise,
the request is handled as if tid
had not been specified.
CTid® information response.
Unauthorized response.
{- "ts": "1668455577",
- "tid": 2008264382,
- "port": 2,
- "polarity": "+",
- "version": 2,
- "mfgid": 0,
- "model": "ERA",
- "sn": 2,
- "k": 2,
- "rsrc": 176,
- "rload": 10000000,
- "params": {
- "size": 106,
- "i": 2775,
- "v": 0.33333,
- "a": 0.45,
- "tv": 0,
- "ta": 0,
- "cal": {
- "1.5": {
- "v": 0,
- "a": 0
}, - "5.0": {
- "v": 0,
- "a": 0
}, - "15.0": {
- "v": 0,
- "a": 0
}, - "50.0": {
- "v": 0,
- "a": 0
}
}
}
}
Initiate the operation specified in the request body. EG4xxx series meters are limited to performing one CTid® operation at a time. If this request is received while another operation is pending, an error is returned.
CTid® post response.
Unauthorized response.
{- "op": "flash",
- "polarity": "+",
- "tid": 4294967295
}
{- "status": "OK",
- "error": "Error message (present if an error occurred)."
}
Write CTid® info of the sensor port. This replaces any existing CTid® info on the meter with the one passed in the request body. It does not update the CTid® info on the sensor itself.
This method is supported mainly for testing purposes. However, it could also be used to fix faulty or inaccurate sensor information. The written information will persist only until the sensor port is scanned again, so this would only be a temporary fix.
error | string (ErrorString) A message describing the first error that occurred. This member is present only if an error occurred. |
k | integer >= 0 The type of the sensor (kind). |
mfgid required | integer >= 0 The numeric identifier of the manufacturer of the sensor. |
model required | string The model name of the sensor. |
object Sensor-type dependent parameters. | |
polarity | string The polarity of the voltage that was used to read this info. |
port required | integer >= 1 The port number this information is associated with. |
rload | number The load resistance that was applied when characterizing the other parameters of this sensor. |
rsrc | number The output resistance of the sensor. |
sn required | integer [ 0 .. 16777215 ] The serial number of the sensor. |
tid required | integer >= 0 Transaction ID of the scan that initiated the reading of this information. |
ts required | string (ForeverStamp) The Unix timestamp of when the information was scanned. |
version | integer >= 0 The CTid protocol version that the sensor implements. |
CTid® put response.
Unauthorized response.
{- "ts": "1668455577",
- "tid": 2008264382,
- "port": 2,
- "polarity": "+",
- "version": 2,
- "mfgid": 0,
- "model": "ERA",
- "sn": 2,
- "k": 2,
- "rsrc": 176,
- "rload": 10000000,
- "params": {
- "size": 106,
- "i": 2775,
- "v": 0.33333,
- "a": 0.45,
- "tv": 0,
- "ta": 0,
- "cal": {
- "1.5": {
- "v": 0,
- "a": 0
}, - "5.0": {
- "v": 0,
- "a": 0
}, - "15.0": {
- "v": 0,
- "a": 0
}, - "50.0": {
- "v": 0,
- "a": 0
}
}
}
}
{- "status": "OK",
- "error": "Error message (present if an error occurred)."
}
Delete the CTid® info associated with the port from the meter.
This also terminates any pending scan
or flash
operations.
The CTid® info stored in the sensor is not affected by this operation.
CTid® delete response.
Unauthorized response.
{- "status": "OK",
- "error": "Error message (present if an error occurred)."
}
Immediately stop any pending scan
or flash
operation.
Generally, this should be used only after successfully
initiating a flash
operation as scan
operations will stop
automatically after a few seconds.
CTid® stop response.
Unauthorized response.
{- "status": "OK",
- "error": "Error message (present if an error occurred)."
}