# Generic MQTT Thing throws warning in logs

**URL:** <https://community.openhab.org/t/generic-mqtt-thing-throws-warning-in-logs/86572>\
**Category:** Items & Sitemaps\
**Created:** [November 30, 2019, 2:08pm UTC](https://community.openhab.org/t/generic-mqtt-thing-throws-warning-in-logs/86572 "2019-11-30T14:08:04Z")\
**Posts on this page:** 5\
**Page:** 2

<div class="post-metadata">

**Author:** ![ElwoodSC](https://community.openhab.org/letter_avatar_proxy/v4/letter/e/cdc98d/32.png) [@ElwoodSC](https://community.openhab.org/u/ElwoodSC)\
**Post date:** [January 9, 2020, 8:52am UTC](https://community.openhab.org/t/generic-mqtt-thing-throws-warning-in-logs/86572/21 "2020-01-09T08:52:39Z")

</div>

> [@rossko57](#):
>
> Maybe you could restructure with one topic Thing with many channels, not sure if it helps.

This sounds like a good idea - I’ll try that as soon as possible.  
The general setup is that my RF-Brige (OpenMQTTGateway) has only two topics to work wir RF-Codes. The payload contains the received/sent RF-Code and (currently with MQTT 1.x) my items react on that payload. MQTT 2.x seems to do things differently or even have a bug when more than one things listens/writes to the same topic.

> [@rossko57](#):
>
> I’ve made an assumption that you have several actual devices and OH Items, and presumably topic Things.  
> And assuming the warning you see comes from a Thing that is _not_ targeted by current payload? Are we on the right lines?

You are correct with your assumption - depending on the payload only one of my things has the correct on= or off= statement, the warning is thrown from the other things that don’t match the payload.  
But I have not only the warnings but also interconnection between the things - if I send the payload for thing A it also triggers thing B which listens to a different payload. Only the thing, that was defined first works without triggering the other things.

However, I like the idea of different channels in the same thing and will see whether this brings me to my goal! I’ll report back as soon as I tried this.

---

<div class="post-metadata">

**Author:** ![ElwoodSC](https://community.openhab.org/letter_avatar_proxy/v4/letter/e/cdc98d/32.png) [@ElwoodSC](https://community.openhab.org/u/ElwoodSC)\
**Post date:** [January 9, 2020, 10:55am UTC](https://community.openhab.org/t/generic-mqtt-thing-throws-warning-in-logs/86572/22 "2020-01-09T10:55:19Z")

</div>

I rebuilt my things-file for my RF-devices and now have semi-success. Functionality looks good, but still warnings in the log.  
Current things-file:

```csv
Thing mqtt:topic:flomqtt:MQTT_FSD "FSDs" (mqtt:broker:flomqtt) {
Channels:
    Type switch : fsd_a [stateTopic="home/OpenMQTTGateway/433toMQTT", commandTopic="home/OpenMQTTGateway/commands/MQTTto433", on="1394001", off="1394004"]
    Type switch : fsd_c [stateTopic="home/OpenMQTTGateway/433toMQTT", commandTopic="home/OpenMQTTGateway/commands/MQTTto433", on="1397841", off="1397844"]
    Type switch : fsd_d [stateTopic="home/OpenMQTTGateway/433toMQTT", commandTopic="home/OpenMQTTGateway/commands/MQTTto433", on="1398033", off="1398036"]
    Type string : fsd_all [stateTopic="home/OpenMQTTGateway/433toMQTT"]
}

```

the corresponding items are defined as follows:

```csv
String SW_FSD_RC "RC Eingabe" { channel="mqtt:topic:flomqtt:MQTT_FSD:fsd_all" }
Switch SW_FSD_WoZi "Licht Wohnzimmer A" <light> (gLicht) [Switchable] { channel="mqtt:topic:flomqtt:MQTT_FSD:fsd_a" }
Switch SW_FSD_Lichterkette "FSD Lichterkette ('C')" { channel="mqtt:topic:flomqtt:MQTT_FSD:fsd_c" }
Switch SW_FSD_LK_Kinder "FSD Lichterkette ('D')" { channel="mqtt:topic:flomqtt:MQTT_FSD:fsd_d" }

```

and the warnings in the log look like this:

```csv
2020-01-09 11:50:43.507 [WARN] [ab.binding.mqtt.generic.ChannelState] - Command '1394004' not supported by type 'OnOffValue': No enum constant org.eclipse.smarthome.core.library.types.OnOffType.1394004

2020-01-09 11:50:43.507 [WARN] [ab.binding.mqtt.generic.ChannelState] - Command '1394004' not supported by type 'OnOffValue': No enum constant org.eclipse.smarthome.core.library.types.OnOffType.1394004

```

So for each defined switch-channel which listens to the command-topic I get a warning if the received payload does not match the on/off statement.

---

<div class="post-metadata">

**Author:** ![rossko57](https://community.openhab.org/user_avatar/community.openhab.org/rossko57/32/70263_2.png) [@rossko57](https://community.openhab.org/u/rossko57)\
**Post date:** [January 9, 2020, 11:02am UTC](https://community.openhab.org/t/generic-mqtt-thing-throws-warning-in-logs/86572/23 "2020-01-09T11:02:50Z")

</div>

> [@ElwoodSC](#):
>
> and the warnings in the log look like this:

Not surprised really. Many things or many channels, same issue. Each tries to process incoming payload and warn about mis-matches.  
Note it’s only a warn - I assume it does not incorrectly set your Item to UNDEF - so it’s only a nuisance.

The REGEX method I believe overcomes all that by stopping processing of payload when there is a no-match.

> [@ElwoodSC](#):
>
> also interconnection between the things - if I send the payload for thing A it also triggers thing B

Well, yes. This will be a natural consequence of everything on the same topic.

---

<div class="post-metadata">

**Author:** ![ElwoodSC](https://community.openhab.org/letter_avatar_proxy/v4/letter/e/cdc98d/32.png) [@ElwoodSC](https://community.openhab.org/u/ElwoodSC)\
**Post date:** [January 9, 2020, 11:16am UTC](https://community.openhab.org/t/generic-mqtt-thing-throws-warning-in-logs/86572/24 "2020-01-09T11:16:10Z")

</div>

> [@rossko57](#):
>
> Well, yes. This will be a natural consequence of everything on the same topic

The strange thing was - the first defined thing worked as I expected, could switch ON and OFF without interfering with the other things. Then, when I added more things to the same file the behaviour got wild. And the beaviour even changed slightly after I restarted OH…  
Nevertheless - I guess I can live with that now, the use of channels instead of things even tidied my files further. 🙂

As you seem to be a REGEX-expert, do you have advice for me on how to solve my problem?  
Wallplug A switches ON with payload 1394001 and switches OFF with 1394004 🙏 😆

---

<div class="post-metadata">

**Author:** ![rossko57](https://community.openhab.org/user_avatar/community.openhab.org/rossko57/32/70263_2.png) [@rossko57](https://community.openhab.org/u/rossko57)\
**Post date:** [January 9, 2020, 11:21am UTC](https://community.openhab.org/t/generic-mqtt-thing-throws-warning-in-logs/86572/25 "2020-01-09T11:21:21Z")

</div>

> [@ElwoodSC](#):
>
> As you seem to be a REGEX-expert

I am not. I merely observe how it’s been used with MQTT, with the quirky but useful feature of silently suppressing no-match.  
I guess you want a REGEX for “this OR that”.

[Previous page](https://community.openhab.org/t/generic-mqtt-thing-throws-warning-in-logs/86572.md?page=1)
