Configuring message filtering
The plugin makes use of different filters to filter messages.
Topic filtering
For topic filtering, the Filter_topic and Filter_topic_exact_match tags are used.
-
Filter_topic
Regular expression or exact text that must match the message topic for the filter to be satisfied. This is optional. By default it would match any topic.
-
Filter_topic_exact_match
Indicates whether what is specified in filter_topic will be treated as a regular expression (0) or as an exact text (1). It is optional. Default value is 0.
Examples
Using the Filter_topic and Filter_topic_exact_match filters we can choose the topic to subscribe to.
We can directly indicate the name of the topic or look for a regex pattern in it.
Suppose you have a MQTT topic called:
sensors/temperature/livingroom