Device management
This page shows the simplest way to connect a device to Optimaatti and which details are worth filling in right away.
Fastest way to succeed
- Copy the MQTT details from Optimaatti: host, port, username and password.
- Open the device settings and turn MQTT on.
- Paste the details exactly as shown and save.
- Wait a moment and open the Devices view in Optimaatti.
- When the device appears, give it a clear name and choose its purpose.
If something is not working
- Device does not appear at all: first check the MQTT details, especially host, port, username and password.
- Device appears but is offline: check that the device has internet access and that MQTT stays connected.
- Device appears but does not react: check the correct channel, device type and usage purpose.
MQTT configuration
What MQTT means in practice
MQTT is the connection method the device uses to send data to Optimaatti and receive control back. You do not need to learn the protocol deeply: the important part is copying the correct values into the correct fields.
Before you start
- -Make sure the device is on the same home network as your phone or computer.
- -Open the MQTT details in Optimaatti before you start editing the device.
- -Copy values directly from Optimaatti. One typo is enough to break the connection.
- -If the device has a TLS/SSL setting, use it together with the matching port.
- -Start with one device first and add more only after the first one works.
TLS/SSL and the port
Think of these as a pair: if TLS is enabled, use the matching port. If TLS and the port do not match, the connection will fail.
Configure MQTT settings (web UI)
- Open the device web UI (e.g. Shelly) using its IP address
- Go to Settings → Advanced → MQTT (or similar)
- Enable MQTT
- Verify TLS/SSL setting and matching port
- Open the "MQTT credentials" page in Optimaatti
- Copy host, port, username and password
- Paste values into device MQTT settings exactly
- Save and reboot the device if prompted
Always get host, port, username and password from Optimaatti "MQTT credentials".
Do not use example placeholders.Common MQTT fields and what they mean
- -Host: MQTT server address. Copy as-is from Optimaatti.
- -Port: TLS and non-TLS use different ports. Wrong port = no connection.
- -Username/Password: user-specific credentials. Wrong password = not authorized.
- -Client ID: keep unique. Duplicate client IDs cause disconnect loops.
- -Keepalive: keep defaults. Too small can increase disconnects on poor networks.
Set up Shelly without the Shelly App
- Power the Shelly device (wiring by a qualified electrician where required)
- Wait for Shelly to create its own Wi-Fi network (e.g. "shellyplus1-XXXXXX")
- Connect your phone/computer to that Wi-Fi network
- Open http://192.168.33.1
- Select your home Wi-Fi (SSID) and enter password
- Save — Shelly joins your home Wi-Fi
- Find the Shelly IP in your router and open its web UI (e.g. http://192.168.1.123)
- Open MQTT settings (Settings → Advanced → MQTT)
- Enable MQTT and enter Optimaatti credentials
- Save and wait for the device to appear in Optimaatti Devices view
Where do I find MQTT credentials?
You can find MQTT credentials in the Optimaatti dashboard under Settings → MQTT credentials. Each user has their own credentials.
Shortcut: I just want one device to appear quickly
- Open the MQTT details in Optimaatti.
- Turn MQTT on in the device settings.
- Paste the values and save.
- Open Devices in Optimaatti and wait a moment.
- If the device does not appear, check the port, TLS and password first.
Automatic discovery
How do devices appear in the system?
When a Shelly device is configured to use MQTT, it announces itself automatically. Optimaatti detects it and adds it to the dashboard in seconds.
What information does the device send?
- -Device model
- -MAC address
- -IP address
- -Firmware version
- -Number of channels
- -State (on/off)
- -Power usage (if supported)
If the model is not detected automatically
If model detection fails, you can set the model on the device edit page. This matters because it determines how many outputs/channels the device has and how control is mapped.
Device metadata: type, purpose and metering
After the device appears, open its settings and fill in key metadata. This affects where the device appears and how reports are calculated.
- -Device type: affects number of channels/outputs and how the device is controlled.
- -Purpose: helps interpretation (Heating vs Lighting vs Outlet/relay).
- -Energy metering: only metering devices appear in cost analysis.
- -This device is a heater + nominal power (W): used for forecasting and reporting.
- -Temperature sensor: link a sensor to improve heating logic and away coverage.
Managing devices
Renaming a device
You can rename devices in the dashboard. Click the device name and enter a new one.
Rooms and groups
Organize devices into rooms and light groups. Create rooms in the Rooms view and add devices. Inside rooms you can create light groups and assign one or more devices.
Sensors and controlling light groups
- Open the room page in the Rooms view.
- Create a light group if needed and add lights.
- Add a sensor and select which device/input provides the sensor data.
- Link the sensor to the light group you want it to control.
- Use sensors and light groups together with rules for automation.
Manual control
You can always control devices manually from the dashboard regardless of rules.
Device type and purpose (why they matter)
- Open a device in the Devices view and edit details
- Select device type so Optimaatti knows how many outputs it has and how control maps
- Select purpose (Heating, Lighting, Ventilation, Outlet/relay) for better grouping and automation
Energy metering
If the device supports energy metering (PM models), enable it. Only metering devices appear in cost analysis and reports.
Heater device and nominal power (W)
If the device controls heating, mark it as a heater and enter nominal power (W). This is used for heating cost forecasting.
Link a temperature sensor
If a heater has no own temperature, link a separate sensor device. This improves temperature-based logic and away coverage.
Demo devices
What are demo devices?
Demo devices are virtual Shelly devices that let you try Optimaatti without controlling any physical devices. They use real spot prices and the same rules/MPC logic as real devices.
Add a demo device
- Sign in and open the Dashboard.
- Find the "Add demo device" card.
- Select a demo device type.
- Click "Add demo device".
- Open Devices view — the demo device appears with a DEMO label and can be used with rules like real devices.
Limitations
- -Demo devices never control any physical relay/heating — they are fully virtual.
- -You can create only a limited number to keep the UI clear.
- -You can reset the whole demo environment and start again.
Common problems
Device does not appear
- -Confirm MQTT is enabled on the device
- -Confirm host is correct (copied from Optimaatti, no typos)
- -Check port (TLS vs non-TLS) and that TLS setting matches the port
- -Re-copy username/password from Optimaatti
- -Confirm the device is online and has internet access
- -Wait 1–2 minutes and refresh Devices view
- -If the device appears twice or disappears, check for duplicate clientId on another device
Device shows offline
- -Check internet connectivity
- -Confirm the MQTT server is reachable
- -Restart the device
- -Confirm the MQTT password has not expired
- -Check router/firewall settings that may block outbound connections
Device does not react to commands
- -Confirm the device is online
- -Confirm you have rights to control the device
- -Try manual control in the device web UI
- -Update device firmware
- -For multi-channel devices, confirm you are controlling the correct channel
If the issue persists
If you have checked the above and the device still does not appear or stays offline, open troubleshooting for a more detailed checklist.