Generic MQTT Thing throws warning in logs

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.

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.

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:

Thing mqtt:topic:flomqtt:MQTT_FSD "FSDs" (mqtt:broker:flomqtt)  {
    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:

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:

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.

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.

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. :slight_smile:

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 :pray: :laughing:

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”.