Skip to content

Light Tag

The Light Tag is a pick-by-light system from NIMMSTA. Each of the Light Tags store their location information on device and can be triggered using the location information. We call the process of defining the location information "Attach". If you reset the location, we call it "Detach".

The following documentation helps you to illuminate, attach a location, and reset a Light Tag location.

Prerequisites

Before starting to use Light Tag methods, you need to have a connection manager, you can use NimmstaConnectionManager to connect to a device.

Glossary

  • Light Tag: A Light Tag device is a physical device that can be attached to a location and illuminated.
  • Location: A location is a given name by end user to locate a Light Tag device later.
  • Attach: The process of setting the location on a Light Tag.
  • Detach: The process of resetting a Light Tags location to the default one.
  • Illumination: A method to illuminate a Light Tag device.
  • LedMode: A mode in which a Light Tag device can be illuminated.
  • address: it is Light Tag device Mac Address.

Light Tag Device Basics

Before you start adding your application-specific code, you should know a few basic concepts around the devices:

  1. Every Light Tag has a unique Mac Address and can Store a "Location". We call the process of defining the Location "Attach".
  2. The Location is a simple string that can be up to 20 characters long.
  3. The SDK provides functions to define which Light Tags should be illuminated and with which color and intensity.
  4. As long as no new information is coming, the SDK will always search for those Light Tags and illuminate them. Also when losing the connection, it will retry doing this.

Supported Configuration

Light Tag LED Mode Color (LTColor)

to get your desired color you can use the following predefined colors enum:

export enum LTColor {
  RED,
  GREEN,
  BLUE,
  YELLOW,
  PURPLE,
  TURQUOISE,
  WHITE,
  ORANGE,
  VIOLET,
  FORESTGREEN,
  MAGENTA,
  LIME,
  PINK,
  EMERGENCY,
  OFF,
}

Light Tag LED Mode Intensity (LTIntensity)

this value should be something between 0 and 300. All values above 100 mean more than 100% which will decrease battery life.

// 50% intensity example:
var intensity = 50;

Light Tag LED Blinking Pattern (LTBlinkingPattern)

this value should be one of the following values:

export enum LTBlinkingPattern {
  DOUBLE,
  TRIPLE,
  BLINK,
  PULSE,
  OFF,
}

Attach Location

To attach a location to a LightTag device you can use the following method: It will store the information on the device, so other devices can illuminate it by location. For the successful case, the Light Tag device will blink green.

function attachLocation(
      macAddress: string,
      location: string
): Promise<void>
var deviceAddress = document.getElementById("deviceAddress").value;
var location = document.getElementById("location").value;

connectionManager.attachLocation(deviceAddress, location).then(() => {
    console.log("Location attached");
}).catch((error) => {
    console.error(JSON.stringify(error));
});

Reset Location

To delete location information from a LightTag device you can use the following method:

function detachLocation(
      macAddress: string
): Promise<void>

var deviceAddress = document.getElementById("deviceAddress").value;

connectionManager.detachLocation(deviceAddress).then(() => {
    console.log("Location reset");
}).catch((error) => {
    console.error(JSON.stringify(error));
});

Illumination

To illuminate a light tag, you need to provide the locations of Light Tags being illuminated and also the desired LED Mode. The SDK in the background will make sure to illuminate the Light Tag as long it is in range and also reilluminate it if it goes out of range and comes back in range. There can be a maximum of 5 Light Tags illuminated at the same time. The Light Tags will be illuminated until a new request is received. To turn it off, send a request with an empty deviceList.

function setDesiredLightTagDevices(
      desiredDevices: [lightTag: string],
      ledMode: LEDMode
): Promise<void> {}

desiredDevices is an array of LightTag device locations. Maximum: 5 Locations.

ledMode is a JSON object with the following properties: - color: LTColor - pattern: LTBlinkingPattern (DOUBLE, TRIPLE, BLINK, PULSE, OFF) - intensity: LTIntensity (from 0 to 300, 100 is 100%. It is not recommened to use values above 100)

Illuminate Light Tag

var device = document.getElementById("deviceName").value;
var ledMode = {
    color: LTColor.RED,
    pattern: LTBlinkingPattern.BLINK,
    intensity: parseInt($('#intensity').val()) * 100,
};

connectionManager.setDesiredLightTagDevices([device], ledMode).then(() => {
    console.log("Lighttag started");
}).catch((error) => {
    console.error(JSON.stringify(error));
});

Stop of Light Tag Illumination

to stop illuminating devices you can use the following method:

connectionManager.setDesiredLightTagDevices([]).then(() => {
    console.log("Lighttag reset");
}).catch((error) => {
    console.error(JSON.stringify(error));
})