MQTT how to start

I want to experiment how MQTT works. But it is a big black box for me. I know that mqtt is a protocol. You need a broker(server) to use this protocol. I thought that a device is a MQTT client. But when I search the store I find different apps. Which do i need and what can I do with it.

The first things i wanted to try is how i can manage a device f.i. a Sonos speaker or a Hue bulb.

Second i want to try to get weather data from openweather with MQTT and how can i get the data into a variable.

Would be nice to get some help and some examples.

The topic for the MQTT app is so huge that it is a little to much in the beginning.

Hi,

If i’m not mistaken you need all components

MQTT Client is needed to receive MQTT messages
MQTT Hub is needed to be able to send MQTT messages

MQTT Broker is more like the Server, it doesn’t have to run on Homey, can also run on external system.

1 Like

So i can install f.i mosquitto broker on my NAS
Install, mosquitto MQTT client on Homey. How can my NAS communicate back to Homey. Must you install a Mosquitto client on your NAS, and which one?

You only fundamentally need the client on Homey and the broker on your NAS. You don’t need a client on the NAS.

However It is likely you will also want MQTT hub on Homey to do useful and interesting things with your Homey devices

Installing MQTT Explorer (somewhere on a PC) is highly recommended as it allows you to see what is being sent to the MQTT

1 Like

I have everything running. Mqtt client, hub and mosquitto on my server. Mqtt explorer is showing this


How do I retrieve this information in Homey?

Add a new MQTT device using MQTT auto discovery? MQTT device & auto discovery are available in the beta/test version of MQTT hub app.

If I don’t want to use the MQTT- Hub on Homey, only the MQTT client.
Now I want to switch a device ON via a flowcard:
image

image

Wat exactly should my entry in “Bericht” have to be for switch:0 ?

Possibly send payload on to shellyplus2pm-b48xxx/command/switch:0, but the Shelly thread might be a better place to discuss Shelly MQTT specifics.


I would like to know what I should fill in here so that I receive a message or notification when the charging station turns on or off.
Schermafbeelding 2024-02-09 212423

1 Like