Send data from device over MQTT

Hi.
I am unable to figure out how to send data from a device to openremote via MQTT.

Did you check out the wiki User Guide: Manager APIs · openremote/openremote Wiki · GitHub ?

Yes I have checked this.
What I already did is

  1. Added a new asset (MQTT agent)
  2. Connected MQTT Explorer to openremote on localhost 8883

and now when I try to publish data on a topic I get this error on console “client is not authorized to publish on topic: SMD”

Hi,

The article Pierre provided a link to states the topic format you must use to connect to the OpenRemote MQTT broker, you can’t make up your own topic SMD and expect it to work.

You don’t need an MQTT Agent to connect to our broker, you just need to create a service user in the Manager UI (and give them read/write access to the system).

The MQTT Agent is for connecting OpenRemote to another MQTT broker.

1 Like

@Rich in our pc we have to install an mqtt broker or we have to activate the mqtt server. to establish communication between openremote and client

There are two general situations:

  1. SEND DATA TO OPENREMOTE MQTT BROKER - You need to create a service user within the OpenRemote Manager UI and then use an MQTT client to connect to the OpenRemote broker using your service user credentials. Then you can publish/subscribe to the topics described in the wiki article linked above in Pierre’s post

  2. CONNECT OPENREMOTE TO ANOTHER MQTT BROKER - You need to create an MQTT Agent and then you can link asset attributes to this agent and set the publishTopic and/or subscribeTopic

1 Like

successfully connected my mqtt client by using the link.

1 Like