Codec format

Codec format

A codec is used to decode sensor data (JSON format). A codec is compatible with a device type or brand. Each device must be configured with a codec in order to get the decoded output.

The output of the decoding will depend on the device capability, brand and type.

Schemes of decoded values are fixed for a specific data model but new decoded scheme can be created upon request.

Defaut decoding

The default decoding output will match closely the device manufacturer documentation. This is useful is you want to use very specific functionality of the devices.

For example:

image-20250327-141307.png

Smart Format

The Smart Format for decoding output will have the same formatting of measure regardless of the device manufacturer.

JSON Format

Each useful information of the device frame is classify in a table of values. All data are defined by a type, a reference and the actual value.

Field

Format

Description

Field

Format

Description

type

string

The type of the information, it can be Measure, Meter, Status or Alarm

ref

string : "item|index|service"

item allows further classification (Global, Multi_Fluid, Item) ; index is the number of the value, this is only useful for device having several mesure of the same service ; service is the type of physical measure.

value

float, interger, boolean depending of the service

value measured by the device for the service

at

timestamp

optinal, timestamp of mesurement. This field is only useful when several measure are sent in the same frame

Here is bellow an example of a device with three measurements, one for humitdity and two for temperature.

{ "columns": [ "type", "ref", "value" ], "values": [ [ "Measure", "Multi_Fluid|0|IHumidity", 53 ], [ "Measure", "Multi_Fluid|0|IInstTemperature", 22.5 ], [ "Measure", "Multi_Fluid|1|IInstTemperature", 10.34 ] ] }

JSON Format Datalog

Here is bellow an example of a device sending the measurement with timestamp. It is necessary when a device makes several measurement but sent it all at once (Batch mode or Historisation mode).

{ "columns": [ "at", "type", "ref", "value" ], "values": [ [ 1655078400, "Meter", "Multi_Fluid|0|IVolume", 11115088.19 ], [ 1655121600, "Measure", "Multi_Fluid|0|IVolumeConsumptionH", 3206.85 ], [ 1655118000, "Measure", "Multi_Fluid|0|IVolumeConsumptionH", 203.99 ] ] }

Basic Smart Services

The list of basic service is limited, they are used by many different devices.

Service list

Description

Unit

Type

Service list

Description

Unit

Type

IDeviceBatteryFlag

boolean indicator of battery status (1 = warning)

NA

boolean (0/1)

IDeviceBatteryLevel

% indicator of battery level

%

integer

IDeviceBatteryVoltage

battery level

mV

integer

IGenericStatus

boolean status

NA

boolean(0/1)

IOutRelayState

boolean control

NA

boolean(0/1)

IPulseCounter

Meter counter

NA

integer

IVolume

Volume measure

m3

float

IEnergy

Energy

kWh

float

IPower

Power

KW

float

ICurrent

Current

A

float

IVoltage

Voltage

V

float

IHumidity

Humidity

%

float

IInstTemperature

Instant Temperature

°C

float

Irradiance

Solar radiation measure

W/m²

float

IVOC

VOC measure

NA

integer

ICO2

CO2 measure

PPM

integer

ISound

sound level measure

dB

integer

IPressure

Pressure measure

Pa

integer

Advanced Smart Services

The list of service will be used by more complex devices. Contact Wi6labs support for more details.

Service list

Description

Unit

Type

Service list

Description

Unit

Type

IAnalogGenericRawValue

Analog measure

either V or mA depending on the device

float

IVolumeConsumptionH

Hourly Consumption

m3/h

float

ILevel

Warning or alarm level, scale will depend of the device

NA

integer

IDistance

Distance measure

mm

integer

ICurrentH

Electrical consumption

Ah

float

IPressure_Min

Pressure measure minimum

Pa

integer

IPressure_Max

Pressure measure maximum

Pa

integer

IPressure_Avg

Pressure measure average

Pa

integer

IEaPInst

Active Positive Energy

kWh

float

IEaNInst

Active Negative Energy

kWh

float

IErPInst

Reactive Positive Energy

kVarh

float

IErNInst

Reactive Negative Energy

kVarh

float

IPaP

Positive Active Power

kW

float

IPaN

Negative Active Power

kW

float

IPrP

Positive Reactive Power

kVar

float

IPrN

Negative Reactive Power

kVar

float

TIC_SN

Serial number of the electrical counter

NA

integer

TIC_BASE

Global index (drawn energy)

kWh

float

TIC_HC

index Heure Creuse (drawn energy)

kWh

float

TIC_HP

index Heure Pleine (drawn energy)

kWh

float

TIC_HCE

index Heure Creuse Eté (drawn energy)

kWh

float

TIC_HPE

index Heure Pleine Eté (drawn energy)

kWh

float

TIC_HPH

index Heure Creuse Hivers (drawn energy)

kWh

float

TIC_HCH

index Heure Pleine Hivers (drawn energy)

kWh

float

TIC_BASE_Injection

Global index (produced energy)

kWh

float

TIC_HCE_Injection

index Heure Creuse Eté (produced energy)

kWh

float

TIC_HPE_Injection

index Heure Pleine Eté (produced energy)

kWh

float

TIC_HPH_Injection

index Heure Creuse Hivers (produced energy)

kWh

float

TIC_HCH_Injection

index Heure Pleine Hivers (produced energy)

kWh

float

Example:

image-20250327-142413.png