Add Sensors with Easy Setup

Add Sensors with Easy Setup

October 9, 2020
TeamViewer IoT Documentation

The Easy Setup for adding sensors is intended to provide you with an intuitive and easy experience which will lead you through the setup steps in adding the sensors.

The Easy Setup contains 3 basic steps. Follow the sections in this article:

  1. Generate a Sensor Script
  2. Enable the Sensor Script on the Edge Device
  3. Assign the Sensor Script to the Edge Device

The generated Sensor Script is a template.

The Sensor Script prints metric values of a sensor in JSON format and each metric is described as a variable which gets a random value in between 1 and 20.
If you don’t have a ready script, you might need to search for tutorials on how to read your sensor data, find a library or script that works with your sensor and make sure that your script’s output prints the JSON formatted example as presented in the template.
Then place the ready script on the edge device and provide the full path information into the configuration page.

Most sensors will be detected automatically when connected to your Edge Device. Other sensors may not be detected automatically; please refer to the Owners Manual of said sensor to get more information on how to connect the sensor to the Edge Device properly.
You will get an error message if input values are not permissible. You’ll need to adjust them accordingly.

There are thousands of different sensors in the world. Some of them would need special libraries or custom development to get a data from. If you have trouble with the setup of sensors, contact TeamViewer.

What you will need

Make sure that you have prepared the following points:

Generate a Sensor Script

  1. To log in to the IoT Management Console, open https://teamviewer-iot.com and use your TeamViewer account credentials.
  2. From the left menu select Devices.
  3. On the right side from the dropdown menu select Add Sensor.
  1. Click Easy Setup.
  1. From the dropdown menu select the device with the sensor you would like to add.
  2. Type in a unique sensor name.
  3. Click to add a metric. To configure the metric provide a metric name and an unique ID. The fields Value Type and Value Unit are optional. (When a metric becomes superfluous click to remove it.)
  1. When all metrics are configured click Download the generated Template.

The downloaded zip-file contains template examples for Python and Bash.

  1. On your local PC extract the zip-file.
  2. Pick one of the extracted files as your Sensor Script.

Keep the Management Console open and continue with Enable the Sensor Script on the Edge Device.

Enable the Sensor Script on the Edge Device

In this task you’ll need to transfer the previously downloaded Sensor Script to the Edge Device. Then you’ll give the Sensor Script fitting permissions to be executed.

  1. Transfer the Sensor Script to your Edge Device by using the Transfer Files feature. Remember the full path (FULLPATH) of the Sensor Script on the Edge Device.
  2. Access the edge device remotely (Access the Edge Device via Remote Terminal).
  3. Give the Sensor Script fitting permissions. In the terminal type in the following command and press return. Replace FULLPATH with the full path from the previous step.
sudo chmod +x FULLPATH

Assign the Sensor Script to the Edge Device

After you enabled the Sensor Script on the Edge Device you’ll need to continue where you left off from Generate a Sensor Script.

  1. Type in the FULLPATH you remembered from Enable the Sensor Script on the Edge Device.
  1. Select the frequency by which the data will be sent to the TeamViewer IoT Cloud. It can be defined in seconds or minutes.
  1. To finish the Easy Setup click Add.

Related posts

Want more? Exclusive deals, the latest news: Our Newsletter!