Select Page

HOW EVE AUTOMATION SOFTWARE WORKS WITH SHELLY

MQTT is a low weight publish-subscribe protocol.

This protocol is made by two parts:

  1. The client (someone connecting to a broker).
  2. The broker (the one who has the credentials of all the users and allow you to connect trade information with components that can work with MQTT protocol).

You can find more information about the MQTT protocol here.

In the picture below is explaned how the MQTT works with EVE system.
All our systems, X1 server, virtual machine and raspberry pi are able to work as brokers and servers.
Come funziona il protocollo MQTT sul sistema domotico EVE
HOW TO SET MQTT IN EVE MANAGER:

Before starting verify these parameter to be correctly set:

 

  • Create a new gateway and set it in MQTT broker.

 

  •  The default client id should be set to: “eve-mqtt-client“.
    Anyway you can call it as you like, if you need to create more then one client make sure you choose a different name from the default one.

 

  •  The default open port in the server should be: “1883“.

 

  •  The default parameter used to maintain the istance open should be: “Keep alive” (even if you are not sending any command).

 

  •  Set Quality of Service (QoS) to: “exactly once” (This option guarantees that each message is received only once by the intended recipients).
Ilevia software di autoamzione
Step 1:

Add a component within my components area, make sure it has the MQTT protocol selected as shown in the picture below.

Software di automazione | Come impostare l'MQTT gateway all'interno del software di supervisione EVE manager
HOW DO THE PAYLOAD AND THE TOPIC WORKS?

TOPICS

The topics are: read, event, wirte and response.
Each topic has a different type of message that the MQTT broker uses to filter messages for each connected client,  the topics are composed in levels divided by slash

Example: home/livingroom/light

Here is a description of  the four automation software topics:
Topic read: Is used to retreve the status of the devices.

Topic response: Is the device repply to the automation server read request.

Topic write: This topic is used to set the value of  a device parameter.

Topic event: This topic display the status of the device in case it changes.

PAYLOAD

A payload is a piece of code that contains a javascript function.
For each topic is executed a javascript function to process the topic payload.

json string example:

var data = JSON.parse(payload);var color = {“mode”:”color”,”red”:data.r,”green”:data.g,”blue”:data.b}; return JSON.stringify(color);

payload example
Step 2:

Topic responce“:  In here you have to write the correct topic base on the device you want to control (you can find all shelly topics from this page).

Come funziona il topic responce all'interno del software di supervisione domotica EVE manager
Step 3:

Topic write“: In here you have to write the correct topic base on the device you want to control (you can find all shelly topics from this page).

Come funziona il topic write all'interno del software di supervisione EVE manager
Step 4:

Topic event“:  In here you have to write the correct topic base on the device you want to control (you can find all shelly topics from this page).

Come funziona il topic event all'interno del software di supervisione EVE manager
Step 5:

To verify if the device is working properly download the open source software MQTT-fx,
this will allow you to check the information that the broker is receiving from the device.
Install the software in your computer.
The next step will be setting the broker inside the software settings, click on the gear icon near the first text box, then put your EVE X1 IP address and the port 1883.

Come impostare il software di debug MQTT fx
step 6:

To subscribe to all the topics write the symbol  # (ash)
Click on the button subscribe and if a connection has been established, you should be able to see a series of messages; those messages are the sign that your shelly device has established a sucesfull connection with broker.

Step 7:

Check if the component works in Eve automation app.
Upload the project we have created earlier and execute it

Come impostare l'applicazione domotica tramite EVE manager
Here’s the project we used to test the shelly plug.

Download the test here.

Note: Every shelly component has a different ID and a different way to program via json therefore, we suggest to consult the shelly web page and make sure to use the right IDs and commands.

OTHER SHELLY’S DEVICES WITH MQTT

Still Need Help? Our Customer Service Is Here For You.