Create a TSVB in Kibana to observe room occupancy over time

Our step-by-step guide to create a TSVB visualisation in Kibana to answer the question: When are rooms occupied?

Kibana Visual Builder buckets visualization
Kibana Visual Builder buckets visualization
Kibana Visual Builder buckets visualization
Kibana Visual Builder buckets visualization
Kibana Visual Builder buckets visualization

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

Learn how we at reelyActive use a Kibana TSVB bar visualization to analyse room occupancy over time.

What will this accomplish?
A visualisation of room occupancy per meaningful unit of time.
Is there an easier way?
Manual occupancy counts using pen and paper?
So why would I read this?
To learn both how and why to automate occupancy observation with a bar chart visualisation.


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 TSVB visualization   Step 1 of 4

Create a TSVB bar visualization in Kibana with the default settings.

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 Vertical Bar chart
Create a new Bar Chart in Kibana

The default settings will result in a bar chart with just one bucket being generated, similar to that below. The next step will be to define a meaningful set of buckets.

Default Bar Chart in Kibana

Defining TSVB Metrics   Step 2 of 3

Define a meaningful set of metrics and filters to visualize rooms 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.

Cardinality Aggregation 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. Select Filter Ratio from the Aggregation pull-down in the Metrics tab
  2. Enter the Numerator 1 and the Denominator 4
  3. Select Cardinality from the Metric Aggregation pull-down
  4. Choose the field transmitterId.keyword
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 zone you want to compare by entering each location in a specific filter as below:

  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 filters you can display only tags within a certain distance.

  1. Complete the filter input and separate the expressions by entering and
  2. Enter rssi: and type the rssi threshold
Create a new Visual Builder in Kibana

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 a new Visual Builder in Kibana

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 a new Visual Builder in Kibana

Analysing data   Step 3 of 3

Analyse data and identife 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.

Visualize the data in a bar chart, where a bar stands for one hour.

  1. From the Option tab, go to Chart type
  2. Select bar style
  3. Select None in the Stacked options
Create Visual Builder Kibana Guide

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

Kibana dashboard example
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.