OpenHab MQTT Item Extra Publish

Hello all! I have this item on my OpenHab2.2

Switch          FF_LivingRoom_Light            "Luz"             <light>           (FF_LivingRoom, gLight)            ["Lighting"]     {mqtt=">[mymqtt:mygateway1-in/50/1/1/0/2:command:OFF:0],>[mymqtt:mygateway1-in/50/1/1/0/2:command:ON:1],<[mymqtt:mygateway1-out/50/1/1/0/2:state:MAP(1on0off.map)]"}

When I click it, a MQTT request is generated, but some extra ones also (The first 2 are extras):

MyMQTT/commandUpdates/FF_LivingRoom_Light/command ON
MyMQTT/stateUpdates/FF_LivingRoom_Light/state ON
mygateway1-in/50/1/1/0/2 1

mqtt.cfg

mymqtt.url=tcp://192.168.1.10:1883
mymqtt.clientId=openhab
mymqtt.qos=1
mymqtt.retain=true
mymqtt.async=false

mqtt-eventbus.cfg
– empty – (all commented)

Way is this happening? Can I disable it?

Thank You

Do you have any other Items that publish to those topics?

It is not necessarily OH that is publishing to those topics. What topics do your devices publish to? It is common and reasonable to expect your device to publish to both of those topics in response to the command you sent.

This is my only item atm… This was just a test, this 3 publishes appear all at the same time when the switch is activated.

Then the publishes are coming from the device, not openHAB. There is nothing openHAB can do about it. Look at your device, though the device publishes them for a reason.

just out of curiosity: did you have an mqtt-eventbus.cfg running bevor commenting the file?
if so, I suspect you had the above logic in the eventbus? (commandUpdates and stateUpdates?). If still yes, please have a look here:

just a minor tweak, but you should consider avoiding those special characters, as they tend to confuse humans - and algorithms. I personally think underscores are fine, but there are loads of different “-” out there, which could accidentially slip in and until you figure out, what’s going on, you spend a night with error logs! :persevere:

http://4.bp.blogspot.com/-fUlpaZwsnrU/ToL-a80Us3I/AAAAAAAAA9c/misOcGHU0WQ/s640/Bildschirmfoto+2011-09-28+um+12.50.07.png

just out of curiosity: did you have an mqtt-eventbus.cfg running bevor commenting the file?
if so, I suspect you had the above logic in the eventbus? (commandUpdates and stateUpdates?). If still yes, please have a look here:

Yes that was the case. I tried to follow the topic, deleting the cache, but still no success… I still have the duplicated messages

Just to be clear, please post your mqtt-eventbus.cfg.

  1. What’s your platform, you’re running OH2 from?
  2. if /var/lib/openhab2/cache and /var/lib/openhab2/tmp won’t work, you should have a look in
  3. /var/lib/openhab2/config/org/openhab/mqtt-eventbus.config it should be empty then, if not, do as in the “Clear the Cache”-thread described and stop OH2, delete cache and tmp again but plus empty the mqtt-eventbus.config, then start OH2 again

(but be sure, mqtt-eventbus.cfg is indeed empty!)

This solved the problem :slight_smile: thank you @binderth

1 Like