[JSR223][MQTT]publishMQTT causes messages to be retained even though I'm not asking for it

Hi guys! Long time no see. I’ve been away for quite a while but finally back playing with and adding things to my openHAB setup again. I’m currently on openHAB 2.5.0 Build #1627.

So, I’m publishing an MQTT message as follows:

mqttActions = actions.get(“mqtt”,“mqtt:broker:volatile”)

I’ve looked through several other threads for troubleshooting. I’ve deleted (published an empty string) to the topic to make sure it’s gone, and then restarted MQTT Explorer to make sure it’s really gone.

But, every time I publish from my jsr223/jython script in openHAB, the message is retained – and I absolutely do not want it to be! The message needs to be once and done.

The documentation says this:

The MQTT broker connection thing configuration Retain option is OFF

I’ve tried supplying false, False, FALSE and 0 as the third parameter. false and FALSE are undefined! False is defined but results in this error, as does 0:

TypeError: publishMQTT(): 1st arg can't be coerced to org.eclipse.smarthome.core.thing.binding.ThingActions

Any ideas?

…nevermind. I think this issue has already been solved in a later version, maybe.

I removed the two homie devices that were on my “volatile” broker connection (i’ll bet i added that connection just to solve this problem ages ago and forgot about it) and restarted openhab completely, and now the messages are no longer retained! Yay.

BUT – looking at MQTTActions.java, it seems like the channel retain flag is only used when no parameter is given. So, specifying “False” should have solved the problem as well, and for some reason that didn’t work as specified in the documentation.