Create a TSVB in Kibana to calculate average occupancy

Our step-by-step guide to create a TSVB visualization in Kibana and gives an understanding of how rooms are used.

Create a TSVB to analyse room performance

The TL;DR (Too Long; Didn't Read)

Learn how we at reelyActive use Kibana TSVB to analyse rooms occupancy.


What will this accomplish?
A visualization to calculate the average occupancy per hour for each room.
Is there an easier way?
Manual counts and analysis of people/device using pen and paper?
So why would I read this?
To learn both how and why to analyse rooms utilization with TSVB.

Prerequisites

reelyActive open source software with Elasticsearch and Kibana.

In order for there to be data to visualise, the reelyActive software must also have collected and written raddec data to Elasticsearch.

Creating a new TSVB visualization   Step 1 of 3

Create a TSVB in Kibana


What's a TSVB ?
A Time Series Data Visualizer which provides a UI to achieve the features of Timelion and gives many ways of showing data.
Why Kibana?
Kibana makes it easy to visualize data from an Elasticsearch database, where the source data is stored.

Open Kibana and then:

  1. Select the Visualize tab from the left menu bar
  2. Click the Create a Visualization button
  3. Select the TSVB chart
Create a new Visual Builder in Kibana

The default settings will result in a time series visualization with unfiltred data. The next step will be to define a meaningful filters in order to reduce the unnecessary information that can confuse the analysis.

Default Visual Builder in Kibana

Defining TSVB Metrics   Step 2 of 3

Define a meaningful set of metrics and filters to understand room utilization


What's a Metric?
A metric visualization displays a single number for each aggregation you select.
What's filtering data?
This means the data sets are refined by removing data that can be repetitive or irrelevant.

Apply a Filter Ratio Part 1

To protect mobile devices from being tracked as they move there is a technique known as MAC address randomization. This replaces the number that uniquely identifies a device's wireless hardware with randomly generated values. Devices like smartphones change their MAC address about every 15 minutes. On average on one hour of meeting a single smartphone will be collected 4 times.

  1. Choose Gauge visualization
  2. Select Filter Ratio from the Aggregation pull-down in the Metrics tab
  3. Enter the Numerator 1 and the Denominator 4
  4. Select Cardinality from the Metric Aggregation pull-down
  5. Choose the field transmitterId.keyword

Cardinality means the number of distinct values in a table column. By choosing the field transmitterId.keyword that will count the transmitters once and will reduce the number of counts effectively.

  1. Add Aggregation by clicking the + button
  2. Select Overall Average from the Aggregation pull-down
  3. Choose the Metric Filter Ratio
Create a new Visual Builder in Kibana

Location Filter Part 2

Each sensors has a fixe position and refers to a location, ex: room, zone, floor etc. Define which room you want to monitorize by entering the ID of the sensor installed inside.

  1. Select Filters from the Group by pull-down
  2. Enter receiverId.keyword: and type the ID of the sensor
  3. From the Label input type the name of the location where the sensor is set up
Create Visual Builder Kibana Guide

Distance Filter Part 3

RSSI is used to approximate distance between the device and the sensor. At maximum Broadcasting Power the RSSI ranges from -35 (a few inches) to -100 (40-50 m distance). By applying RSSI filter you can display only tags within a certain distance. The RSSI threshold can be defined according to the size of the rooms.

  1. Complete the filter input and separate the expressions by entering and
  2. Enter rssi and type the rssi threshold as the example below:
Create Visual Builder Kibana Guide

Transmitter Type Filter Part 4

To measure anonymously the occupation of spaces, our sensors detect Bluetooth devices that people already carry on them (smartphones). Bluetooth devices such as smartphone use a 48-bit random device address which is classified as 3. This filter removes most devices that are not associated with people like smart TV.

  1. Complete the filter input and separate the expressions by entering and
  2. Enter transmitterIdType: and enter the value 3 which refers to Random 48-bit advertiser address (BLE)
Create Visual Builder Kibana Guide

Number Of Decoding Filter Part 5

In most cases, devices are decoded multiple times. A decode filter is used to suppress all noise signals decoded only a few times.

  1. Complete the filter input and separate the expressions by entering and
  2. Enter numberOfDecodings: and enter the threshold
Create Visual Builder Kibana Guide

Customizing TSVB settings   Step 3 of 3

Customize the chart to quickly identify trends and patterns


What's a trend?
A general tendency of a set of data to change.
What's a pattern?
Data doesn't have to follow a trend, always going up or down over time. A pattern is a when data repeats in a predictable way.

Apply a threshold set to the capacity of the room to correctly observe its occupation.

  1. Click the Panel Options tab
  2. From the Style part enter the capacity of the rooms in the Gauge max input
Create Visual Builder Kibana Guide

Add color rules to observe the occupation at a glance.

  1. From the Style part set the gauge color or the text color
  2. Choose one of these metrics >, <, >= or <= and type the threshold
  3. Click the + icon the add rules
Create Visual Builder Kibana Guide

This visualization can be combined with other visualizations as part of a space occupancy dashboard, such as that below.

Create Visual Builder Kibana Guide
Elastic Search Award

Winner of a 2020 Elastic Search Award!

For our innovation of making physical spaces searchable like the web.


Where to next?

Create other visualizations, or continue exploring our open architecture and all its applications.