Hi,
i started testing the new mqtt binding in 2.4. And run into several ‘problems’ or things i don’t understand.
i have mosquitto with letsencrypt certificate running; and didn’t manage to connect succesfully to it. When i switched to non-encrypted communication messages started showing up.
Here’s my test-setting:
file: mqtt-broker.things (as i did read that there is an error when having all things in one file and you need to restart always OH - is this still correct?)
Bridge mqtt:broker:mySecureBroker [ host="...", secure=false, username="openhab2", password="....." ]
file: mqtt.things
Thing topic mything (mqtt:broker:mySecureBroker) {
Channels:
Type switch : mq_lampe “Kitchen Lamp” [ stateTopic=“lamp/enabled”, commandTopic=“lamp/enabled/set”, postCommand=“lamp/enabled/command” ]
}
Which leeds to the first “error” in the logs:
[del.core.internal.ModelRepositoryImpl] - Validation issues found in configuration model ‘mqtt.things’, using it anyway:
Provide a thing UID in this format:
<bindingId>:<thingTypeId>:<thingId>
i did bind this to a KNX-Item
Switch K_WANDLEUCHTEN "Wandleuchten Küche" <light> [ "Switchable" ]
{
channel="knx:device:bridge:generic:K_WANDLEUCHTEN",
channel="mqtt:topic:mything:mq_lampe"
}
So when switching this with KNX the state was published to MQTT as
lamp/enabled/set
0 or 1
but PostCommand did not seems to do anything. So switching out of MQTT does not seem to work.
i also tried to raise Log-Level - but didn’t mange with this - but i needed to guess:
log:set DEBUG org.openhab.binding.mqtt
i also set this rule - like in the examples:
file mqtt.rules
rule “Publish all”
when
Member of Kueche changed
then
val actions = getActions(“mqtt”,“mqtt:broker:mySecureBroker”)
actions.publishMQTT(“allItems/”+triggeringItem.name,triggeringItem.state)
end
Which result always in actions been NULL
[ERROR] [untime.internal.engine.RuleEngineImpl] - Rule 'Publish all': An error occurred during the script execution: Could not invoke method: org.eclipse.smarthome.binding.mqtt.action.MQTTActions.publishMQTT(org.eclipse.smarthome.core.thing.binding.ThingActions,java.lang.String,java.lang.String) on instance: null
So - here are my questions: How do i raise Debug-Level?
Why a command from MQTT did not change anything on the Item - a lamp/enabled/command ON should work from my understanding of the Documentation? Do i need to restart OH everytime i change something from the config in regards to MQTT?