[SOLVED] Strange bug with MQTT command topic, posts command to wrong topic

  • Platform information:
    • Hardware: Synology/Docker
    • OS: Synology/Docker
    • Java Runtime Environment: (whichever comes with the Docker image)
    • openHAB version: openHAB 2.5.0 Release Build (latest Docker image)

I have defined all my MQTT things and items exclusively with .things and .items files and did nothing in PaperUI. However, if I view the command topic in PaperUI, it shows the wrong topic, and, judged by watching all MQTT traffic with MQTT.fx, the command gets really sent to that wrong topic!

This is displayed in PaperUI. I marked the topic discrepancy in red:

And this is the relevant portion of my things file. You’ll see that the commandTopic is defined as zwave/DevoloThermostat05/thermostat_setpoint/heating_1/set while the display in PaperUI is zwave/DevoloThermostat01/thermostat_setpoint/heating_1/set:

Bridge mqtt:broker:mosquitto "Mosquitto MQTT Broker" [ host="homeserver", secure=false, clientID="openHAB_docker" ]
    {
        Thing topic DevoloThermostat01  "Devolo Home Control Radiator Thermostat (Bad)" @ "Bad" {
        Channels:
            Type number : temperature   "Temperatur"    [stateTopic="zwave/DevoloThermostat01/sensor_multilevel/unknown",
                                                         transformationPattern="JSONPATH:$.value"]
            Type number : battery       "Batterie"      [stateTopic="zwave/DevoloThermostat01/battery/battery_level",
                                                         transformationPattern="JSONPATH:$.value"]
            Type number : setpoint      "Zieltemperatur"[stateTopic="zwave/DevoloThermostat01/thermostat_setpoint/heating_1",
                                                         transformationPattern="JSONPATH:$.value",
                                                         commandTopic="zwave/DevoloThermostat01/thermostat_setpoint/heating_1/set",
                                                         min=10, max=28, step=1]
            Type string : status        "Status"        [stateTopic="zwave/DevoloThermostat01/status",
                                                         transformationPattern="JSONPATH:$.value"]
        }

        Thing topic DevoloThermostat05  "Devolo Home Control Radiator Thermostat (Office)" @ "Office" {
        Channels:
            Type number : temperature   "Temperatur"    [stateTopic="zwave/DevoloThermostat05/sensor_multilevel/unknown",
                                                         transformationPattern="JSONPATH:$.value"]
            Type number : battery       "Batterie"      [stateTopic="zwave/DevoloThermostat05/battery/battery_level",
                                                         transformationPattern="JSONPATH:$.value"]
            Type number : setpoint      "Zieltemperatur"[stateTopic="zwave/DevoloThermostat05/thermostat_setpoint/heating_1",
                                                         transformationPattern="JSONPATH:$.value",
                                                         commandTopic="zwave/DevoloThermostat05/thermostat_setpoint/heating_1/set",
                                                         min=10, max=28, step=1]
            Type string : status        "Status"        [stateTopic="zwave/DevoloThermostat05/status",
                                                         transformationPattern="JSONPATH:$.value"]
        }
    }

And this is the corresponding part of the .items file:

Number:Temperature
            thermostat01_temp_RawSensor
                                    (gRawSensor)
                                    {channel="mqtt:topic:mosquitto:DevoloThermostat01:temperature"}
Number:Temperature
            thermostat01_temp       "Thermostat Bad [%.1f %unit%]"
                                    <temperatur>
                                    (gPersist,gLastUpdt)
Number:Temperature
            thermostat01_setpoint   "Zieltemperatur Bad [%.1f %unit%]"
                                    <temperatur>
                                    (gPersist,gSetpoint)
                                    {channel="mqtt:topic:mosquitto:DevoloThermostat01:setpoint"}
Number      thermostat01_batt       "Batterie [%d %%]"
                                    <battery>
                                    (gPersist,gBattery,gLastUpdt)
                                    {channel="mqtt:topic:mosquitto:DevoloThermostat01:battery"}
DateTime    thermostat01_lastUpdt   "Last Update [%1$tm/%1$td %1$tH:%1$tM]"
                                    (gPersist)

Number:Temperature
            thermostat05_temp_RawSensor
                                    (gRawSensor)
                                    {channel="mqtt:topic:mosquitto:DevoloThermostat05:temperature"}
Number:Temperature
            thermostat05_temp       "Thermostat Büro [%.1f %unit%]"
                                    <temperatur>
                                    (gPersist,gLastUpdt)
Number
            thermostat05_setpoint   "Zieltemperatur Büro [%.1f %unit%]"
                                    <temperatur>
                                    (gPersist,gSetpoint)
                                    {channel="mqtt:topic:mosquitto:DevoloThermostat05:setpoint"}
Number      thermostat05_batt       "Batterie [%d %%]"
                                    <battery>
                                    (gPersist,gBattery,gLastUpdt)
                                    {channel="mqtt:topic:mosquitto:DevoloThermostat05:battery"}
DateTime    thermostat05_lastUpdt   "Last Update [%1$tm/%1$td %1$tH:%1$tM]"
                                    (gPersist)

I left out DevoloThermostat02DevoloThermostat04, but they show the same error, all linking to the command topic of the first.
I don’t know how many times I’ve checked that the numbering of all my things and items is correct. I’ve commentend the things and items out and in, restarted openHAB inbetween and such, but I still wind up with the wrong command topic. A grep search for DevoloThermostat01 in the openHAB folders only found the logs and the .things and .items file, so I have absolutely no idea why this command topic is attached to more than one thing :roll_eyes:

Is this a bug in the MQTT binding? I have some “tasmotarized” Sonoff switches with a similar numbering scheme, they work fine.

Did you clear the cache?

1 Like

Aaaargh, that was so obviously the solution that I’m really ashamed now :flushed:
Thank you, the posts now go to the right topic :slight_smile: