Reading from an external MQTT broker

Hi, I have an mqtt broker to where my devices are sending messages.
I want to “import” them into open remote.

I have created an MQTT Agent, and since my mqtt-broker uses mqtts:// i also added the required certificates (.pem files from /etc/ssl/certs) to my OR_SSL_CLIENT_TRUSTSTORE_FILE=/storage/keystores/client_truststore.p12 with the keytool command.

So now i can see in the logs that OpenRemote connects to my mqtt-broker.

However, I dont know how to proceed to get the data ingested into OpenRemote as asset attributes.

Please note that I’m new to OpenRemote so it maybe is obvious, but to be clear I want to subscribe to some mqtt topcis and convert them into openremote attributes.

Can anyone help me and explain what the next step is?

I have looked for documentation but only found communication in the other direction (FROM OR to mqtt broker), and a few questions in the forum [1], [2], about the same thing I’m asking about. However, they didnt have any answers.

I’d be very grateful for any help!

Cheers!
/Lars (from Sweden)

[1] Subscribe to locally hosted Mosquitto MQTT Broker
[2] MQTT integration (Mosquitto) - no subscribe message

Hey Lars,

Happy to hear you were able to connect your agent to the external MQTT broker!

I recommend reading through the agent overview, to understand more about how agents work. Principally, you’d start with creating an Agent link configuration item on the attribute you’d like, and then configuring the subscription/publish topic for that specific attribute’s agent link. Depending on the format of your message, you’d possibly have to use some value filters. The agent link would then use the linked agent to perform the work required.

Best of luck!

Panos

Ok, thanks.

I managed to create an Attribute that gets its value from the MQTT Agent.

But when i try to add one more attribute from the same MQTT Agent I’m unable
to add it. My broker publishes several topics (power, current, voltage, etc) and I want to ingest them,
but after I’ve added the first attribute it is no longer possible to select any agent in the pull down box
that lists the agents. If i try to enter the id and MQTTAgentLink type etc in the json box, it just reverts back to DefaultAgentLink.

Is that a bug?

Thanks for any explanation of what is happening!
/Lars

Good afternoon @larsr ,

I’m understanding that you’re trying to add another Agent link configuration item to a different attribute of an asset. I’m not exactly sure what could be the issue, are there any logs that describe the issue a bit more in-depth? I wasn’t able to reproduce this locally.

Hi, I think it is some kind of problem with the web interface.
The problem is that I can’t create more than one asset with an AgentLink to my MQTTAgent.

I have created a ThingAsset and an MQTTAgent. First I create a new attribute on the ThingAsset
with an AgentLink to the MQTTAgent.

The problem comes now.

After having created and saved the first attribute, it becomes impossible to choose
the MQTTAgent again when I try to create an AgentLink for another attribute.
The web interface just reverts the settings back to some DefaultAgent.

I noticed today that I can create more that one AgentLink attribute AS LONG AS I DONT SAVE the asset. But I would really like to be able to add them one at a time.

@Rich @wborn any ideas? I’m not sure what exactly could be going wrong…