[Solved]MQTT 2.4: Migration of ESPEASY from MQTT 1.x

my whole setup is based on config-files and this makes it easy for me to migrate from openHAB 2.2 to 2.4. I made a new installation and copied my whole config-files to openHAB 2.4.
But I have to migrate to MQTT 2.4.
I’m using mosquitto-broker

I have some issues translating the Things and Items and want to ask for some help.
“o2mqtt” is the old broker in openHAB 2.2. “broker” the new one in openHAB 2.4

This is the old Item from openHAB 2.2:

Number SW1_MQT_231 "SW1MQT231: [%s]"
{ mqtt="<[o2mqtt:/mqtt231/Taste1/state:state:default]" }

I created the Thing, based on this documentation:

Bridge mqtt:broker:mosquitto "Mosquitto" [ host="localhost", port=1883, secure=false ]
	Thing topic SW1MQT231 {
        Type number : button    "Taste1"   [ stateTopic="mqtt231/Taste1/state"]
	Thing topic SWTMQT233 {
        Type string : reachable "Reachable"            [ stateTopic="tele/mqtt233/LWT" ]
        Type switch : power     "Power"                [ stateTopic="stat/mqtt233/POWER", commandTopic="cmnd/mqtt233/POWER" ]
        Type number : rssi      "WiFi Signal Strength" [ stateTopic="tele/mqtt233/STATE", transformationPattern="JSONPATH:$.Wifi.RSSI"]

And here the Item:

Number SW1_MQT_231 "SW1MQT231: [%s]" { channel="mqtt:topic:mosquitto:SW1MQT231:button" }

String SWT_MQT_233_Reachable	"Reachable: [%s]" { channel="mqtt:topic:mosquitto:SWTMQT233:reachable" }
Switch SWT_MQT_233 "MQT233"	{ channel="mqtt:topic:mosquitto:SWTMQT233:power" }
Number SWT_MQT_233_RSSI "WiFi Signal Strength [%d %%]" { channel="mqtt:topic:mosquitto:SWTMQT233:rssi" }

SWT_MQT_233 is working perfect, but I get no state from SW1_MQT_231

I checked the ESPEASY with
mosquitto_sub -h localhost -t /mqtt231/Taste1/state
and get 1 by pressing an 0 by relaesing the button.

What is my mistake in the Thing and/or Item?

According to your .thing file the given broker name is “mosquitto” (and not “broker”), which you correctly use in the items file for the channel.
For the thing “SW1MQT231” you are using a “stateTopic” only, that way you will only recieve state changes, in order to send command you have to use the “commandTopic”.

The channel needs either stat or tele?


Thing topic SW1MQT231 {
        Type number : button    "Taste1"   [ stateTopic="tele/mqtt231/Taste1/state"]

This is your error:

       Type number : button    "Taste1"   [ stateTopic="mqtt231/Taste1/state"]

And your topic is:


Notice the difference?

Indeed the missing / was the mistake. But I need to restart openHAB.
Adding tele has no effect, crosschecked with mosquitto_sub -h localhost -t tele/mqtt231/Taste1/state