[..]Exception: groovy.lang.MissingMethodException: No signature of method: user_driver_.getCommandString() is applicable for argument types: (java.lang.String, java.lang.String) values: [SerialSend1, 10;PING;] (on)

First time poster! I've set myself the task of building upon the excellent work of Marcus for the RFLink driver. I am building the send part, using lots of debug statements, because athough I am a programmer, I find it hard to get information on Groovy and/or Hubitat. Nevertheless, I am chugging on rather nicely. That is until I stumbled onto this errormessage that I don't seem to be able to solve but above all, don't understand...
org.codehaus.groovy.runtime.InvokerInvocationException: groovy.lang.MissingMethodException: No signature of method: user_driver_tasmota_Tasmota___RF_IR_Switch_Toggle_Push__Child__461.getCommandString() is applicable for argument types: (java.lang.String, java.lang.String) values: [SerialSend1, 10;NewKaku;01e99452;1;ON;] (on)

My code is as follows (child):

private def on() {
def theMap = [:]
def cmds = []
varAction = "ON"
rfData = "10;"
sendEvent(name: "switch", value: "on", isStateChange: true)

state.actions.each { entry -> 
    theMap = parseAsMap(entry.value)
    if (theMap.CMD == varAction) {
        theMap.every {
          rfData += it.value + ';'
        }
    }
}

if (rfData) {
     cmds << getAction(getCommandString("SerialSend1", rfData))   
}      
return cmds
}   

Comparable function call (from the parent):

def refreshAdditional() {
logging("refreshAdditional()", 10)
def cmds = []
cmdData = "10;PING;"
cmds << getAction(getCommandString("SerialSend1", cmdData))
return cmds

}

And this is the culprit (parent):

def getCommandString(command, value) {
    def uri = "/cm?"
    if (password) {
        uri += "user=admin&password=${password}&"
    }
	if (value) {
		uri += "cmnd=${command}%20${value}"
        logging(value.class, 1)
	}
	else {
		uri += "cmnd=${command}"
	}
    return uri
}

Both the calling methods report both parameters as class java.lang.String. Then why don't I get an exception from refreshAdditional() and yet do I get one from on()? It doesn't even work when I manually set rfData to "10;PING".

I am puzzled. Hope anyone can help!

Are you saying the getCommandString method is defined in a parent driver, along with refreshAdditional, but the "on" method is defined in the child driver? If so, then I expect you will need to change the call to getCommandString in "on" to be parent.getCommandString.

1 Like

Thanks a lot! That seems to be it! The thought just started to dawn on me when your reaction came!

1 Like

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.