MQTT value is NULL

Hello!

Sorry if this topic already exists somewhere. I have now searched for at least two hours but have not found any helping post.

My problem is that my MQTT binding give me NULL values for certain Items. Let me explain:

  • I have added a MQTT broker thing as a connection to iobroker. There I gather values from my EV and some other things
  • I have added a System MQTT Broker thing and added multiple channels there
  • All the values for my EV items are updated normally (The topic is for example “/iobroker/vw-connect/1/WVWZZZE1ZM_______/status/batteryStatus/currentSOC_pct”)
  • All the other values from other sources that can also be seen in iobroker and can also be accessed with MQTT Explorer return a NULL value. No matter if they are strings, numbers, json,… (Example topic: “/iobroker/mqtt/0/wasserzaehler/main/json”

I don’t know what to do…

MQTT Broker Code:

UID: mqtt:broker:d5151216e1
label: MQTT Broker - Zu ioBroker
thingTypeUID: mqtt:broker
configuration:
  lwtQos: 0
  publickeypin: true
  clientid: ebbacdb8-a04d-4bed-8b5c-fd79902adb32
  keepAlive: 60
  birthRetain: true
  secure: false
  certificatepin: true
  shutdownRetain: false
  password: ----
  qos: 1
  reconnectTime: 60000
  port: 1888
  host: 127.0.0.1
  lwtRetain: true
  enableDiscovery: true
  username: ----

System MQTT Broker

UID: mqtt:topic:d5151216e1:0ce999aa35
label: ioBroker
thingTypeUID: mqtt:topic
configuration: {}
bridgeUID: mqtt:broker:d5151216e1
channels:
  - id: SOC
    channelTypeUID: mqtt:number
    label: SOC
    description: ""
    configuration:
      stateTopic: /iobroker/vw-connect/1/WVWZZZE1ZM_______/status/batteryStatus/currentSOC_pct
  - id: Last_Update
    channelTypeUID: mqtt:datetime
    label: Last Update
    description: ""
    configuration:
      stateTopic: /iobroker/vw-connect/1/WVWZZZE1ZM_______/status/batteryStatus/carCapturedTimestamp
  - id: Range
    channelTypeUID: mqtt:number
    label: Range
    description: ""
    configuration:
      stateTopic: /iobroker/vw-connect/1/WVWZZZE1ZM________/status/batteryStatus/cruisingRangeElectric_km
  - id: State
    channelTypeUID: mqtt:string
    label: State
    description: ""
    configuration:
      stateTopic: /iobroker/vw-connect/1/WVWZZZE1ZM_______/status/chargingStatus/chargingState
  - id: Remaining_Charge
    channelTypeUID: mqtt:number
    label: Charging Time
    description: ""
    configuration:
      stateTopic: /iobroker/vw-connect/1/WVWZZZE1ZM_______/status/chargingStatus/remainingChargingTimeToComplete_min
  - id: Control_Charge
    channelTypeUID: mqtt:switch
    label: Control Charge
    description: ""
    configuration:
      postCommand: false
      retained: false
      qos: 1
      commandTopic: /iobroker/vw-connect/1/WVWZZZE1ZM_______/remote/charging/set
      stateTopic: /iobroker/vw-connect/1/WVWZZZE1ZM_______/remote/charging
      off: "false"
      on: "true"
  - id: Control_Climate
    channelTypeUID: mqtt:switch
    label: Control CLimate
    description: ""
    configuration:
      commandTopic: /iobroker/vw-connect/1/WVWZZZE1ZM_______/remote/climatisation/set
      stateTopic: /iobroker/vw-connect/1/WVWZZZE1ZM_______/remote/climatisation
      off: "false"
      on: "true"
  - id: Max_AC
    channelTypeUID: mqtt:string
    label: Max AC
    description: ""
    configuration:
      stateTopic: /iobroker/vw-connect/1/WVWZZZE1ZM_______/status/chargingSettings/maxChargeCurrentAC
  - id: Refresh
    channelTypeUID: mqtt:switch
    label: Refresh
    description: ""
    configuration:
      commandTopic: /iobroker/vw-connect/1/refresh/set
      stateTopic: /iobroker/vw-connect/1/refresh
      off: "false"
      on: "true"
  - id: Steckerverbindung
    channelTypeUID: mqtt:string
    label: Steckerverbindung
    description: ""
    configuration:
      stateTopic: /iobroker/vw-connect/1/WVWZZZE1ZM_______/status/plugStatus/plugConnectionState
  - id: Steckerverriegelung
    channelTypeUID: mqtt:string
    label: Steckerverriegelung
    description: ""
    configuration:
      stateTopic: /iobroker/vw-connect/1/WVWZZZE1ZM_______/status/plugStatus/plugLockState
  - id: Target_SCO
    channelTypeUID: mqtt:number
    label: Target SOC
    description: ""
    configuration:
      stateTopic: /iobroker/vw-connect/1/WVWZZZE1ZM________/status/chargingSettings/targetSOC_pct
  - id: wasserzaehler
    channelTypeUID: mqtt:string
    label: Wasserzähler
    description: ""
    configuration:
      stateTopic: /iobroker/mqtt/0/wasserzaehler/main/json

The log sometimes shows errors like this:

2022-03-11 15:43:44.496 [WARN ] [.incoming.MqttIncomingPublishService] - No publish flow registered for MqttStatefulPublish{stateless=MqttPublish{topic=wasserzaehler/main/json, payload=102byte, qos=AT_LEAST_ONCE, retain=true}, packetIdentifier=60, dup=false, topicAlias=0, subscriptionIdentifiers=[]}.

Thank you for your help!!

Please use the correct wording! A “System MQTT Broker” is a MQTT broker which is (better was) build into openHAB. You are obviously do NOT use such, the posted YAML code shows a “MQTT Generic Thing” using correctly the “MQTT Broker Thing” as the bridge to your used MQTT broker (iobroker?).
Looking at the different topics your multiple channels are connected to, I think you should have used more then one “Generic MQTT Thing”. I can’t really say if doing such would solve your reported problem.

Are you using exactly the same topics on openHAB as in MQTT Explorer?

I‘m sorry. I did not mean to use the wrong terminology.

Yes, I use the exact same topic in MQTT explorer.

No, I have already tried to use a separate Generic MQTT Thing and the malfunction is still present.

Might the warning message from the log be a hint to the problem? The ‚wasserzaehler‘ topic is the only one that is mentioned in such a warning.

I also find it odd that there seems to be payload according to the warning. But the data is not updated to the item.

In the WARNING I would have expected the exact topic that you tried to subscribe to and not only parts of it.

It sounds like you may have created both ordinary broker Bridge Thing and set up the System Broker, which is done elsewhere in the UI, and definitely not wanted.
Look in your openhab.log for broker connect messages at start up, you may see both.

I noticed your stateTopics start with a /. From what I know, usually MQTT topics don’t start with a slash.

I have found a solution. Even though I have set the MQTT setting in ioBroker to always add /iobroker/ at the beginning and despite the fact that the connection to vwconnect works, I needed to remove some parts of the topics prefix. It now is „ wasserzaehler/main/json“ and works just fine. Than you all, your suggestions made me check the specific topic name again.