(+39) 0424.166.02.08 support@ilevia.com

SHELLY DOOR WINDOWS WITH MQTT PROTOCOL

INTRODUCTION

This device from shelly is made to be applyed to doors and widowns to return theirs status, if its open, close, tilted to a specific position in “°”,  report the room temperature, the brightness of the room, the device’s battery level and report if the door/window vibrate. 

Web interface configurations

Step 1:

First connect into the shelly door window 2’s wifi network, once connected type the default shelly’s web interface IP: 192.168.33.1, on the URL text field on your web browser.

How to connect inside the Shelly device's web interface

Step 2:

Head to the Internet and security settings menu then open the section wifi client mode and check the box: Connect the Shelly device to an existing WiFi Network, to be able to pair the shelly device with your wifi network. 

How to connect your shelly device to your wifi network

Step 3:

The next will be enabling the MQTT protocol inside the shelly device, inside the  Internet security settings menu open the Advanced developer settings and anable the check box: Enable action execution via MQTT.

Then insert the IP address of your EVE server inside the field text Address on the MQTT settings, then set the Qos to 2, finally hit save to apply the settings.

How to enable the action execution via MQTT protocol inside the shelly device's web interface

Topics confiugration:

FAST TOPIC SELECTION

Click on the topic you want to see its configuration:

TOPIC'S CONFIGURATION INDEX

shellies/shellydw2-<deviceiD>/sensor/stateThis topic will return the door/window current state;

shellies/shellydw2-<deviceiD>/sensor/luxThis topic will retrun the level of brightness of the room where the shelly device is, in lux;

shellies/shellydw2-<deviceiD>/sensor/batteryThis topic will return the level battery of the shelly device;

shellies/shellydw2-<deviceiD>/sensor/tiltThis topic will return the window’s tilt in “°” from 0 to 180;

shellies/shellydw2-<deviceiD>/sensor/temperatureThis topic will return the Room temperature which the shelly device has been placed in.

shellies/shellydw2-<deviceiD>/sensor/vibrationThis topic will return 0 when no vibration is detected or 1 if vibration detected;

Step 4:

Open EVE Manager Pro and create a new project, create a new MQTT gateway, here a guide that explain how to set up the new gateway.

Step 5:

Drug and drop a Text info component inside the Components section and set its gateway to the one we have created earlier with the MQTT protocol.

Adding a new Text info component inside the Home automation configuration software EVE Manager Pro

Step 6:

Topic: shellies/shellydw-<deviceID>/sensor/state

Now lets set up the component. The topic that will be set to retreive the status of the device is the topic Event.

By clicking this link you will be able to consult the topic configuration.

Setting up the topic to the Text info component inside the Home automation configuration software EVE Manager Pro

Step 7:

To get the lux percentage from the shelly device, add a new Info component inside the component section in EVE Manager Pro and set its gateway to the MQTT one created earlier.

Adding new info component inside the Home automation configuration software EVE Manager Pro

Step 8:

Topic: shellies/shellydw2-<deviceiD>/sensor/lux

This is the topic that will be applyed to the Info component to retreive the value coming from the shelly device.

By clicking this link you will be able to consult the topic configuration.

Setting up the info component in order to display the lux value coming from the shelly device inside the Home automation configuration software EVE Manager Pro

Step 9:

Now lets set up the Info component that will return the battery level value coming from the shelly device.

So add a new Info component inside the project and set its gateway to the MQTT one.

Adding a new Info component in order to display the Shelly device battery level inside the home automation configuration software EVE manager Pro

Step 10:

Topic: shellies/shellydw2-<deviceiD>/sensor/battery

Lets set up the topic that will return the battery level of the shelly device. In order to display the value as a percentage select “percentage” as mesurement unit from the data type’s drop down menu inside the info component properties.

By clicking this link you will be able to consult the topic configuration.

Info component Topic configuration in order to display the battery level coming from the shelly device

Step 11:

Lets set up the component that will return the tilting value coming from the shelly device. Add a new Info component inside your project and set it up with the MQTT protocol by selecting it from the gateway menu on top of the component’s properties.

Step 12:

Topicshellies/shellydw2-<deviceiD>/sensor/tilt

Now lets set up the topic that will retrieve the value pubblished from the shelly device. This value will be returned as a integer value, in order to display it as a “°” you need to select the right meurement unit from the data type drop down inside the info component properties.

By clicking this link you will be able to consult the topic configuration.

Step 13:

Now lets set up the component that will retreive the temperature value pubblished from the shelly device. Add a new Info component inside the project and set the MQTT protocol by selecting it from the gateway drop down menu inside the component’s properties.

Adding new Info component inside the project in order to display the temperature value coming from the shelly device

Step 14:

Topic: shellies/shellydw2-<deviceiD>/sensor/temperature

Now lets set up the topic information, This topic will return the value pubblished as decimals from the shelly device. 

By clicking this link you will be able to consult the topic configuration.

Info topic configuration with MQTT protocol in order to display the temperature value coming from the shelly device inside the Home automation configuration software EVE Manager Pro

Step 15:

As last but not least lets set up the Vibration detection, add a new Pulse component inside the components section and set its protocol to the MQTT one we have create at the beggining of the guide by selecting it from the gateway drop down menu inside the Pulse component’s properties.

Adding a new pulse component inside the project in the Home automation software EVE Manager Pro that will trigger when a vibration is dected from the shelly device.

Step 16:

Topic: shellies/shellydw2-<deviceID>/sensor/vibration

Then lets set up the topic, this time the topic other then only retreive the if there are vibration or not, it will change the state to the pulse component. Then to be able to “reset” the status pf the pulse component each time the the shelly device triggers it, set a auto release time from the Auto release setting section inside the pulse component properties, it is suggested to set the Auto release time to 1 second.

By clicking this link you will be able to consult the topic configuration.

Configuration of the pulse component with the MQTT topic inside the Home automation configuration software in order to trigger it when the vibration is the detected from the shelly device

HOW TO SEND NOTIFICATION WHEN A VIBRATION IS DETECTED

INTRODUCTION

If the option is enabled the shelly device door window 2 can send values of 0 if no vibration is detected or 1 if a vibration has been detected. 

Notification module set up

Step 1.1:

Drag and drop a Notification component from the messaging tab on the left menu of the components section.

Adding a new notification component inside the Home automation configuration software EVE Manager Pro

Step 2.1:

Now select the pulse component from the trigger component drop drop down inside the Notification component’s properties. 

Setting the trigger component inside the properties of the notification component in the Home automation configuration software EVE Manager Pro

Step 3.1:

Now select the user that will receive the notification when a vibration will be detected from the shelly device. Click on the “Select users” drop down menu and select the user you want.

Setting the users to the notification component inside its properties inside the Home automation configuration software EVE Manager Pro

Step 4.1:

Once you select the user, it will be needed to set up the content that will appear when the notification is received from the users. You are free to write anything on the content field of text inside the Notification component properties.

This will concludes the configuration of the notification module.

Writing the content that will be displayed once the notification is triggered from the pulse component inside the Home automation software EVE Manager Pro

USER INTERFACE RESULT

Now lets finally try all the components we have set inside the User Interface of the Home automatio App EVE Remote Plus. 

Window closed

Here displayed how the project configuration is inside the Home automation app EVE Remote Plus when the window is closed

Window Opened

Here displayed how the project configuration is inside the Home automation app EVE Remote Plus when the window is open

Tilted window

Here displayed how the project configuration is inside the Home automation app EVE Remote Plus when the window is open and tilted

Notification Visualization

This is how the notification will be displayed inside the EVE Remote Plus APP once the shelly device detect a vibration.

Here displayed how the project configuration is inside the Home automation app EVE Remote Plus when the shelly device has detected a vibration

TROUBLE SHOOTING

1- Make sure to have the last version available for EVE manager and Eve X1 server firmware.

2- Make sure the shelly plug is connected in your network.

3- If you can’t connect to the broker check if the X1 server has been wired correctly.

Discover more about our shelly solution.