Skip to main content
← Back to getting started

Shelly & MQTT — step-by-step visual guide

Visual guide for step 4 of the getting-started flow. Use this if you need more detail on MQTT settings or the connection does not work.

What you are doing

MQTT is the technology Shelly and Optimaatti use to talk to each other. You enter four values into Shelly (server, port, username, password) and then Shelly can report its state and accept commands. Optimaatti's cloud service sits between the two, so Shelly does not need to be on the same network as your phone.

Check you have these

  • Shelly connected to your home Wi-Fi (getting-started step 3).
  • Optimaatti account created and Connection details open (getting-started step 2).
  • The four values memorized or open in another tab: server, port, username, password.
Shelly app

Option 1: Via the Shelly app (recommended)

Easiest and fastest. Works with all recent Shelly devices.

  1. 1

    Open device settings

    In the Shelly app, pick the device from the list and tap the gear icon or `Settings`.

  2. 2

    Go to the MQTT section

    In settings, find `MQTT` or `Advanced → MQTT`. The exact location depends on your Shelly model.

  3. 3

    Turn MQTT on

    Flip `Enable MQTT` on. You will now see four fields: server, username, password and possibly an SSL toggle.

  4. 4

    Enter the four values

    Copy each field from Optimaatti's Connection details exactly as shown. Do not add spaces. If Shelly asks for SSL, turn it on.

  5. 5

    Save

    Tap `Save settings` or `Apply`. Shelly will restart the connection.

  6. 6

    Wait 30–60 seconds

    The device will connect to Optimaatti. Go back to Optimaatti and open the Devices page — it should appear automatically.

Shelly app MQTT settings view
Shelly app MQTT view. Four fields filled with values copied from Optimaatti.

Check these in the screenshot:

  1. 11. Open device settings In the Shelly app, pick the device from the list and tap the gear icon or `Settings`.
  2. 22. Go to the MQTT section In settings, find `MQTT` or `Advanced → MQTT`. The exact location depends on your Shelly model.
  3. 33. Turn MQTT on Flip `Enable MQTT` on. You will now see four fields: server, username, password and possibly an SSL toggle.
  4. 44. Enter the four values Copy each field from Optimaatti's Connection details exactly as shown. Do not add spaces. If Shelly asks for SSL, turn it on.
Show the more advanced browser method
Via browser

Option 2: Via the browser

Only use this if the Shelly app cannot find the settings or you want to double-check details.

  1. Find your Shelly's IP address: it is in the Shelly app device info (Device info → IP) or in your router's device list.
  2. Open `http://<IP-address>` in a browser (e.g. `http://192.168.1.50`).
  3. Go to `Settings → MQTT`.
  4. Turn `Enable MQTT` on and turn `SSL connectivity` on.
  5. Enter the same four values as in Option 1.
  6. Tap `Save settings`.
Shelly web UI MQTT settings
Shelly web UI in a browser. Same four fields, same result.

Check these in the screenshot:

  1. 11. Find your Shelly's IP address: it is in the Shelly app device info (Device info → IP) or in your router's device list.
  2. 22. Open `http://<IP-address>` in a browser (e.g. `http://192.168.1.50`).
  3. 33. Go to `Settings → MQTT`.
  4. 44. Turn `Enable MQTT` on and turn `SSL connectivity` on.

Four-field checklist

If the connection fails, go through these one at a time:

Server

Looks like: `shelly.swedencentral.cloudapp.azure.com:8883`. Some models have server and port in separate fields — enter the server without the `:port` suffix and put the port in the port field.

Port

Usually `8883` (TLS-encrypted). Never `1883` unless instructed.

Username

The email address you registered with in Optimaatti.

Password

A long random string that Optimaatti generates for you. DO NOT use your Optimaatti login password — the Connection details password is different.

Most common mistakes

  • Space in the password

    When you copy the password, paste it into a text editor first and check there is no space at the start or end. This is by far the most common cause.

  • Wrong port

    Port 8883 is TLS-encrypted, 1883 is plain. Choosing the plain port with TLS on (or vice versa) breaks the connection.

  • TLS/SSL off

    Many Shelly models have a separate `SSL connectivity` or `Use TLS` toggle. Turn it on.

  • Expired password

    If you generated a new password in Optimaatti, the old one stops working. Go back to Optimaatti, copy the latest value, and paste it into Shelly again.

  • Wrong username

    The username is the same email you log into Optimaatti with. Not the Shelly app email.

Is it working?

When everything is correct, you will see these signs:

  • In the Shelly app MQTT view, it shows `Connected` or a green dot.
  • In Optimaatti Devices, the device appears within 1–2 minutes.
  • The device state updates in Optimaatti — you can switch it on and off from the app.

Next step

Once the device shows up in Optimaatti, continue to step 5 of the getting-started guide.

Back to getting started

Still stuck?

If you cannot get a connection working even with these instructions, see the full troubleshooting guide or contact support.

Tip: keep the Optimaatti Connection details page open in another tab so you can copy values quickly.