I am new in OH2. I have an simple configuaration for access from Java using Paho.
The goal is to receive a notification to my Java-App when I press the switch in OH.
I use a simple Swich
Switch java_text "Text von Java" <text> (gWRaumEG) { mqtt=">[localbroker:/IoTDemo/openHAB/java_text/command:command:OFF:0],>[localbroker:/IoTDemo/openHAB/java_text/command:command:ON:1],<[localbroker:/IoTDemo/openHAB/java_text/state:state:default]"}
Generally it works when I use this in my openhab.cfg:
but when I use this and press the switch (or send command from Java by MQTT), my mosquitto wents go into loop for Sending PUBLISH and Received PUBACK repeatly:
Im not sure i understand you correctly, I am german speeker…
My goal ist to write an management system and also measuring station written in Java. So my communication goes to mosquitto - server by using mqtt.
An also to embed openHAB.
I don’t have a solution but the same issue. As soon as I configure the
mqtt-eventbus:statePublishTopic
in the mqtt-eventbus.cfg I’m getting a loop and evey item I switch on/off after mosquitto has been started loops until i stop mosquitto. Mosquitto itself seems to work fine because I’m using it with owntracks.
As @watou alluded to, you shouldn’t need to mess with the MQTT event bus for what it sounds like you’re doing (sending a payload to an MQTT topic based on a switch state).