MQTT Firing Every Second on WiFi

I have a MQTT connection setup to my Roomba; I’ve noticed when I push a rule which I have logic in the rules not to execute during this push that the MQTT WiFi rule is getting executed very second.

Please ignore the “Script Interrupter can’t be obtain” - this is by design.

2019-10-09 13:23:54.425 [ERROR] [ntime.internal.engine.RuleEngineImpl] - Rule 'Roomba Wifi Stat JSON Received Update': Script interpreter couldn't be obtain
2019-10-09 13:23:54.426 [ERROR] [ntime.internal.engine.RuleEngineImpl] - Rule 'Roomba Wifi Stat JSON Received Update': Script interpreter couldn't be obtain
2019-10-09 13:23:54.426 [ERROR] [ntime.internal.engine.RuleEngineImpl] - Rule 'Roomba Wifi Stat JSON Received Update': Script interpreter couldn't be obtain
2019-10-09 13:23:54.427 [ERROR] [ntime.internal.engine.RuleEngineImpl] - Rule 'Roomba Wifi Stat JSON Received Update': Script interpreter couldn't be obtain
2019-10-09 13:23:54.427 [ERROR] [ntime.internal.engine.RuleEngineImpl] - Rule 'Roomba Wifi Stat JSON Received Update': Script interpreter couldn't be obtain
2019-10-09 13:23:54.428 [ERROR] [ntime.internal.engine.RuleEngineImpl] - Rule 'Roomba Wifi Stat JSON Received Update': Script interpreter couldn't be obtain
2019-10-09 13:23:54.428 [ERROR] [ntime.internal.engine.RuleEngineImpl] - Rule 'Roomba Wifi Stat JSON Received Update': Script interpreter couldn't be obtain
2019-10-09 13:23:54.429 [ERROR] [ntime.internal.engine.RuleEngineImpl] - Rule 'Roomba Wifi Stat JSON Received Update': Script interpreter couldn't be obtain
2019-10-09 13:23:54.430 [ERROR] [ntime.internal.engine.RuleEngineImpl] - Rule 'Roomba Wifi Stat JSON Received Update': Script interpreter couldn't be obtain
2019-10-09 13:23:54.431 [ERROR] [ntime.internal.engine.RuleEngineImpl] - Rule 'Roomba Wifi Stat JSON Received Update': Script interpreter couldn't be obtain
2019-10-09 13:23:54.432 [ERROR] [ntime.internal.engine.RuleEngineImpl] - Rule 'Roomba Wifi Stat JSON Received Update': Script interpreter couldn't be obtain

How can I slow down the MQTT traffic and/or rule firing?

Thing:

Bridge mqtt:broker:roomba "Roomba Main Floor" @ "Main Floor" [ clientID="xxxxx", host="192.168.0.143", port=8883, secure=true, username="xxxxx", password=":1:1531533625:xxxxx", certificatepin=false, publickeypin=false ] 
{
  Thing topic state "Roomba Cleaner State" @ "Main Floor" {
    Channels:
      Type string : wifistat "WiFi"    [ stateTopic="wifistat" ]
      Type string : shadow   "Status"  [ stateTopic="$aws/things/xxxxxx/shadow/#" ]
  }
}

Item:

String	RoombaWifistatJSON				"Main Roomba WiFi [%s]"  																				{ channel="mqtt:topic:roomba:state:wifistat" }

Rule:

rule "Roomba Wifi Stat JSON Received Update"
	when
		Item RoombaWifistatJSON received update
	then

		if (systemStarted.state != ON) {

			var String json = RoombaWifistatJSON.state.toString
			
			if (systemStarted.state != ON && json !== null && json != NULL && json != UNDEF) {
	
			    for (String key: transform("JS", "roomba.js", json).split(",")) {
	
			      if (key == "localtimeoffset") {
	
				      } else if (key == "mac") {
				      } else if (key == "netinfo") {
				      } else if (key == "signal") {
				      } else if (key == "pose") {
				      } else if (key == "utctime") {
				      } else if (key == "wifistat") {
				      } else if (key == "wlcfg") {
				      } else {
		
				        	logInfo("Roomba Wifi - Untagged Variable : ", "Roomba JSON: " + json + " Key: " + key)
				      }
			     }
			}
		}
end

Just trying to reduce the excess traffic; I’d be happy with once a minute OR 5 minutes.

Best, Jay

Do you think could be useful to change the trigger from received update. To changed ?

So the rule will fire only if there is a change in the state and not every time you get an update.

Alessio had the only solution that you can manage from OH. The reason the Rule is triggered so often is because the Roomba is publishing a message that often. So you either need to configure the role to ignore the messages you don’t care about, or change the Roomba to publish less frequently.

In all likelihood, you really only care to trigger the rule when something changes so using a changed trigger is probably your best bet.