New MQTT 2.4 Binding

Hi,

I’m trying to configure the new MQTT driver, but can’t find any documentation for it.

Do you know where I can find it?

Thanks,
MC

I have no idea whether this is completely up-to-date or not, but here you go:

You will get a good overview if you watch the videos from the last openHAB event in Ludwigsburg. (on Youtube)

Thanks for the responses.

I’m trying to send all the events to an MQTT topic. Is this possible with the new binding?

So far, I’m able to send a message using mosquito_pub and see the message in openhab String item, but haven’t been able to use the trigger channel from the MQTTBroker thing.

Can you be more precise? I found some videos from old MQTT 1.x binding

This should be the right one

1 Like

Thanks for your quick response, but I’m working with 2.4 version.

A quick search here for “MQTT 2.4” turns up several threads specific to your question. Maybe repost your question to the thread you think is most appropriate for your issue?

thanks. I missed that search as I looked for MQTT only.

No problem. Hope you get a resolution to your problem.

Basically you are trying to use the mqtt event-bus integration that is available with MQTTv1 in the v2 binding

See there:

Can this topic be solved? :slight_smile:

MQTTv2 allows to publish all events with a self written rule only at the moment.
What is missing is a new rule engine template that does this job and simulates the old mqtt-eventbus. But we are not yet there.

Cheers, David

1 Like

Can you give an example, please?
I have not seen any MQTTv2 rule examples, yet

1 Like

I cannot. I haven’t written a javascript rule yet and have no idea how to interact with a new rule engine action from within DSL rules. But the idea is simple:

When
  item_change
Do
  mqtt.publish("my/topic/"+item.getUID(), item.getState().toString())
1 Like

But the MQTT action remains the same after MQTTv2 is installed and V1 removed? In the DSL

No, as I said, I have no idea how to access a new-rule-engine action. The binding id is “mqtt” and the action-id is “publish”, that is all I know.

Not in the new rule engine. In the DSL, does the action remain the same?

I would assume you cannot use the MQTT v2 action in the DSL rules.

Well, I want to clear up the assumption, and understand how to use the equivalent of the V1 Action with the V2 binding.

I could live with the fact that “new” actions would only be accessible via “new” javascript/jython rules. But Kai said something along the lines of that new actions will be available for DSL rules as well, personally I just don’t know how.