I have a MQTT trigger which is being picked up by a Groovy script for processing. I have created a MQTT trigger channel and this works fine.
tele/NSPanel/RESULT
I also want to create some regular text rules which run off the the same MQTT message.
Firstly I tried using the same channel. This did not work using the rule below:
rule "Test Button press"
when
Channel "mqtt:topic:7e07b147f2:dd3a2fe5ec:nxpanel_page_trigger" triggered
then
logInfo("nspanelrule","nxpanel_page_triggered")
end
I then created a new channel using the same MQTT topic with an item attached. The Item value updates in the openhab gui but does not make it through to the rule.
rule "Test Item update"
when
Item NSPanel_ResultfromNXPAnel changed
then
logInfo("nspanelrule","Button 1 has been pressed" + NSPanel_ResultfromNXPAnel.state.toString )
end
Finally I created another rule that works from the channel
rule "Test Channel trigger"
when
Channel "mqtt:topic:7e07b147f2:dd3a2fe5ec:NXPanel_result" triggered
then
logInfo("nspanelrule","nxpanel_page_triggered")
end
This rule does not give any results but all of a sudden the previous rule starts working? If I comment out the last rule the Item stops being updated. This seems like a strange workaround - am I doing something wrong.
Here you are - the two that are causing problems are nxpanel_page_trigger which fires the groovy rules and - id: NXPanel_result which runs the text rules