Shelly Motion device integration with Ilevia

How to integrate the Shelly Motion sensor with the Ilevia server via MQTT: device, gateway and component configuration in Ilevia Manager.

Introduction

Shelly Motion is a first-generation Shelly device. In addition to motion detection, it reports other information such as vibration detection in case of tampering, lux measurement and more. This guide explains how to integrate all this information with the Ilevia server via MQTT.

Web interface configuration

Step 1:

Connect to the Shelly web interface: open a browser, enter the Shelly device IP address in the URL bar and press Enter.

Shelly Motion device web interface

Step 2:

Go to the “Internet & Security” menu, then open the MQTT setting menu.

How to access the MQTT settings menu of the Shelly Motion device to integrate it with Ilevia

Step 3:

Enable the “Enable MQTT” checkbox, enter the IP address of your Ilevia server in the “Server” text field, set QoS to 1 and finally click Save.

MQTT configuration setup to establish communication between the Ilevia server and the Shelly device

Project configuration in Ilevia Manager

Step 4:

1. Open Ilevia Manager and create a new gateway; 2. set the gateway protocol to MQTT broker; 3. set the server address to localhost; 4. finally set QoS to “At most once”.

Creation of an MQTT gateway within the Ilevia Manager configuration software.

Step 5:

1. Go to the Components section in Ilevia Manager. 2. Open the Base drop-down menu in the “Component library”. 3. Add a new Colored info component to the project. Finally, make sure the newly created MQTT gateway is set in the component.

Adding a colored info component to receive the motion sensor status within the Ilevia Manager configuration software.

Step 6:

The next step is to set the Topic Event. This component will display the information coming from the Shelly device as a status. The topic used is the following: shellies/shellymotion2-<device-ID>/status, where <device-ID> must be replaced with the Shelly device ID. Finally add the script required to parse the payload received from the Shelly device.

Click the link to view the topic and script configurations.

Configuration of the colored info component topic to receive the Shelly motion sensor status.

Step 7:

Add a second Colored info component to the project. The topic used is the following: shellies/shellymotion2-<device-ID>/status, where <device-ID> must be replaced with the Shelly device ID. Finally add the script required to parse the payload received from the Shelly device.

Click the link to view the topic and script configurations.

Configuration of the Colored info component topic to receive the status from the Shelly device

Step 8:

Add a new Info component to the project. This component will display the temperature value of the environment where the device is installed. The topic used is the following: shellies/shellymotion2-<device-ID>/status, where <device-ID> must be replaced with your Shelly device ID. Finally add the script required to parse the payload received from the Shelly device.

Click the link to view the topic and script configurations.

Info component configuration to receive the ambient temperature value from the Shelly component within the Ilevia Manager configuration software.

Step 9:

Add a new Info component to the project. This component will display the Lux value of the environment where the device is installed. The topic to configure is the following: shellies/shellymotion2-<device-ID>/status, where <device-ID> must be replaced with your Shelly device ID. Finally add the script that parses the payload received from the Shelly device.

Click the link to view the topic and script configurations.

Info component configuration to receive the lux sensor value from the Shelly device within the Ilevia Manager configuration software.

Step 10:

Add a new Info component to the project. This component will display the device battery level. The topic to configure is the following: shellies/shellymotion2-<device-ID>/status, where <device-ID> must be replaced with your Shelly device ID. Finally add the script that parses the payload received from the Shelly device.

Click the link to view the topic and script configurations.

Info component configuration to display the battery level value from the Shelly motion device within the Ilevia Manager configuration software.

Step 11:

Add a new Info component to the project. This component will display the illumination value of the environment where the device is installed. The topic to configure is the following: shellies/shellymotion2-<device-ID>/status, where <device-ID> must be replaced with your Shelly device ID. Finally add the script that parses the payload received from the Shelly device.

Click the link to view the topic and script configurations.

Info component configuration for displaying the ambient light value from the Shelly motion device within the Ilevia Manager configuration software.

Interface display

Here you can see some examples of how components can be displayed in the application interfaces Ilevia Remote Plus (Classic and Maps).

Classic User Interface

Classic display of components configured with the Shelly motion device within the Ilevia Remote Plus application.

Map User Interface

Components set with MQTT protocol within the Ilevia application | Map display

Click the link below to download the Shelly Motion demo project.

Download the demo project.

Last updated: