Official Plugins (Kuzzle v2.x)
Device Manager v1.x
2

This plugin is part of the Kuzzle Enterprise Plan. If you are interested, please contact us.

registerMeasure #

Add properties definition to the measures field of the devices collection.

Copied to clipboard!
registerMeasure (measureName: string, mapping: JSONObject, options: JSONObject);

Arguments Type Description
measureName
string
Name of the measure you are willing to add to the measures field
mapping
JSONObject
Mapping definiton of the custom measure property
options
JSONObject
Additional options

options #

Properties Type Description
tenantGroup
string
Name of the group for which the mapping should apply. If unspecified, mappings will apply to every group who does not have specific definition

Usage #

Copied to clipboard!
import { DeviceManagerPlugin } from 'kuzzle-plugin-device-manager';

const deviceManagerPlugin = new DeviceManagerPlugin();

deviceManagerPlugin.devices.registerMeasure(
  'temperature',
  {
    dynamic: 'false',
    properties: {
      fahrenheit: { type: 'float' },
      celsius: { type: 'float' }
    }
  },
  { tenantGroup: 'water_management' });

deviceManagerPlugin.devices.registerMeasure(
  'humidity',
  {
    dynamic: 'false',
    properties: {
      percentage: {
        type: 'keyword',
        fields: {
          text: { type: 'text' } }
      }
    }
  },
  { tenantGroup: 'air_quality' });