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