{"action":"created","issue":{"url":"https://api.github.com/repos/openhab/openhab1-addons/issues/5589","repository_url":"https://api.github.com/repos/openhab/openhab1-addons","labels_url":"https://api.github.com/repos/openhab/openhab1-addons/issues/5589/labels{/name}","comments_url":"https://api.github.com/repos/openhab/openhab1-addons/issues/5589/comments","events_url":"https://api.github.com/repos/openhab/openhab1-addons/issues/5589/events","html_url":"https://github.com/openhab/openhab1-addons/issues/5589","id":328265490,"node_id":"MDU6SXNzdWUzMjgyNjU0OTA=","number":5589,"title":"[MQTT] regex_filter not working as of version 1.12.0","user":{"login":"rkoshak","id":6385096,"node_id":"MDQ6VXNlcjYzODUwOTY=","avatar_url":"https://avatars3.githubusercontent.com/u/6385096?v=4","gravatar_id":"","url":"https://api.github.com/users/rkoshak","html_url":"https://github.com/rkoshak","followers_url":"https://api.github.com/users/rkoshak/followers","following_url":"https://api.github.com/users/rkoshak/following{/other_user}","gists_url":"https://api.github.com/users/rkoshak/gists{/gist_id}","starred_url":"https://api.github.com/users/rkoshak/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rkoshak/subscriptions","organizations_url":"https://api.github.com/users/rkoshak/orgs","repos_url":"https://api.github.com/users/rkoshak/repos","events_url":"https://api.github.com/users/rkoshak/events{/privacy}","received_events_url":"https://api.github.com/users/rkoshak/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-05-31T19:23:41Z","updated_at":"2018-06-01T20:55:31Z","closed_at":null,"author_association":"NONE","body":"<!--- Provide a general summary of the issue in the Title above -->\r\n<!--- If the issue is related to a binding, please include it in the title. -->\r\n<!--- For example, \"[astro] My issue...\" -->\r\n<!--- For questions or requests for assistance please use community.openhab.org instead. -->\r\n<!--- Feel free to delete any comment lines in the template (starting with &lt;!--) -->\r\n## Expected Behavior\r\n<!--- If you're describing a bug, tell us what should happen -->\r\n<!--- If you're suggesting a change/improvement, tell us how it should work -->\r\nGiven an mqtt binding config like\r\n\r\n`mqtt=\"<[mosquitto:scripts/presence/iphone/results:command:REGEX(123.45.6.78 (.*)):123.45.6.78 .*]\"`\r\n\r\nAll messages that match the regex_filter should match and the result of the REGEX transform should be applied to the Item. Messages that do not match the regex_filter should be dropped, as described in the docs. \r\n\r\n## Current Behavior\r\n<!--- If describing a bug, tell us what happens instead of the expected behavior -->\r\n<!--- When possible, include related log information (preferably debug level) and related configs. -->\r\n<!--- Use file attachment for log and config information longer than a few lines -->\r\n<!--- If suggesting a change/improvement, explain the difference from current behavior -->\r\n<!--- For improvements, discuss in at community.openhab.org first and include link to topic -->\r\n\r\nNo messages match and all messages are ignored given ANY regex filter. I've even tried \".\" and \".*\" which should match all messages and no messages are matched. If I drop the regex filter entirely then all messages match and those that do not match the REGEX transform generate the expected error (\"given command is NULL, couldn't post command for 'ItemName'\").\r\n\r\n## Possible Solution\r\n<!--- Not obligatory, but suggest a fix/reason for the bug, -->\r\n<!--- or ideas how to implement the addition or change -->\r\nNone apparent to me.\r\n\r\n## Steps to Reproduce (for bugs)\r\n<!--- Provide a link to a live example, or an unambiguous set of steps to -->\r\n<!--- reproduce this bug. Include code to reproduce, if relevant -->\r\n1. Set up a topic that has two different messages published to it\r\n2. Set up two Items bound to MQTT, each with a regex filter to only match one of the two messages\r\n3. Observe that the Item never updates or receives a command\r\n4. Remove the regext filter from both binding configs\r\n5. Observe that both Items update for both types of messages\r\n\r\n## Context\r\n<!--- How has this issue affected you? What are you trying to accomplish? -->\r\n<!--- Providing context helps us come up with a solution that is most useful in the real world -->\r\nPreviously I was on a 2.3 SNAPSHOT from no more than a month ago. I upgraded to 2.3 Release and this behavior immeidately started.\r\n\r\nI have a number of Items that get populated with different messages and I use the regec filter to subscribe to only specific messages. In this case I have a topic that reports the presence or absence of my devices to a single MQTT topic. I use the regex filter set Items that represent the presence of specific devices.\r\n\r\n## Your Environment\r\n<!--- Include as many relevant details about the environment you experienced the bug in -->\r\n* Version used: (e.g., openhab and addon versions): OH 2.3 Release\r\n* Environment name and version (e.g. Chrome 39, node.js 5.4, Java 8, ...): Latest Docker Image\r\n* Operating System and version (desktop or mobile, Windows 10, Raspbian Jessie, ...): Docker running on Ubuntu 18.04 Server\r\n* MQTT Broker: Mosquitto\r\n"},"comment":{"url":"https://api.github.com/repos/openhab/openhab1-addons/issues/comments/394006557","html_url":"https://github.com/openhab/openhab1-addons/issues/5589#issuecomment-394006557","issue_url":"https://api.github.com/repos/openhab/openhab1-addons/issues/5589","id":394006557,"node_id":"MDEyOklzc3VlQ29tbWVudDM5NDAwNjU1Nw==","user":{"login":"rkoshak","id":6385096,"node_id":"MDQ6VXNlcjYzODUwOTY=","avatar_url":"https://avatars3.githubusercontent.com/u/6385096?v=4","gravatar_id":"","url":"https://api.github.com/users/rkoshak","html_url":"https://github.com/rkoshak","followers_url":"https://api.github.com/users/rkoshak/followers","following_url":"https://api.github.com/users/rkoshak/following{/other_user}","gists_url":"https://api.github.com/users/rkoshak/gists{/gist_id}","starred_url":"https://api.github.com/users/rkoshak/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rkoshak/subscriptions","organizations_url":"https://api.github.com/users/rkoshak/orgs","repos_url":"https://api.github.com/users/rkoshak/repos","events_url":"https://api.github.com/users/rkoshak/events{/privacy}","received_events_url":"https://api.github.com/users/rkoshak/received_events","type":"User","site_admin":false},"created_at":"2018-06-01T20:55:31Z","updated_at":"2018-06-01T20:55:31Z","author_association":"NONE","body":"I've tried the following configurations on advice namraccr.\r\n\r\n1. replace the : with a .\r\n\r\n`mqtt=\"<[mosquitto:scripts/presence/iphone/results:command:REGEX(10.10.1.200 (.*)).10.10.1.200 .*]\"`\r\n\r\nError\r\n\r\n`2018-06-01 07:51:40.625 [ERROR] [.mqtt.internal.MqttMessageSubscriber] - Error processing MQTT message.\r\njava.util.regex.PatternSyntaxException: Unmatched closing ')' near index 16\r\n^10.10.1.208 (.*)).10.10.1.208 .$`\r\n\r\n2. replace : with \\\\:\r\n\r\n`mqtt=\"<[mosquitto:scripts/presence/iphone/results:command:REGEX(10.10.1.200 (.*))\\\\:10.10.1.200 .*]\"`\r\n\r\nError\r\n\r\n`2018-06-01 07:54:10.632 [ERROR] [.mqtt.internal.MqttMessageSubscriber] - Error processing MQTT message.\r\njava.util.regex.PatternSyntaxException: Unmatched closing ')' near index 16\r\n^10.10.1.200 (.*)):10.10.1.200 .$\r\n                ^`\r\n\r\n3. Use the regec filter as I always have and as documented.\r\n\r\n`mqtt=\"<[mosquitto:scripts/presence/iphone/results:command:REGEX(10.10.1.200 (.*)):10.10.1.200 .*]\"`\r\n\r\nNo error but Item no longer receives commands\r\n\r\n4. Remove the regex filter entirely\r\n\r\n`mqtt=\"<[mosquitto:scripts/presence/iphone/results:command:REGEX(10.10.1.200 (.*))]\"`\r\n\r\nLogs\r\n\r\n`2018-06-01 07:57:39.435 [WARN ] [b.core.events.EventPublisherDelegate] - given command is NULL, couldn't post command for 'vJennPhone_Manticore_Net'\r\n2018-06-01 07:57:39.438 [INFO ] [ipse.smarthome.model.script.presence] - vRichPhone_Manticore_Net updated to OFF\r\n2018-06-01 07:57:43.064 [WARN ] [b.core.events.EventPublisherDelegate] - given command is NULL, couldn't post command for 'vRichPhone_Manticore_Net'\r\n2018-06-01 07:57:43.067 [INFO ] [ipse.smarthome.model.script.presence] - vJennPhone_Manticore_Net updated to ON`\r\n\r\nThe error is when the Item receives the message that doesn't match the transform which is no longer being filtered out by the regex filter."}}
{"actor":{"display_login":"rkoshak"}}