Mysterious CommandService.executeAction() call?

I have a SmartApp which is processing JSON data via POST, and calling a custom device type method. The relevant SmartApp code is:

devices.eachWithIndex { it, i -> if ( devices[i].deviceNetworkId == ) devices[i].setPoints(request.JSON.points) }

This call and resulting device type code works perfectly, but the SmartApp raises the following error in the log:

groovy.lang.MissingMethodException: No signature of method: physicalgraph.device.CommandService.executeAction() is applicable for argument types: (physicalgraph.device.cache.DeviceDTO, org.codehaus.groovy.grails.web.json.JSONObject) values: [UPS-AVcloset, [input_frequency:59.9, input_voltage:122, ...]] @ line 46

I’m not sure I care, except that SmartThings is sending a 500 (error) response-code to the external api client. I’d prefer to do things a little more gracefully.

If my call to the device’s setPoints() method is working, why is the app throwing this exception?


Can you post a gist or github link to your code?

I believe this has to do with your custom device type. My suspicion is that you’re UPS-AVcloset is not being seen as an instance of DeviceDTO class.


Frankly, I’ve spent much more time on the other end of this API (to be posted on github when not completely shameful), but these the Smartthings pieces so far are up now.

Thoughts, @kris? Is there a way to explicitly classify a devices as “DeviceDTO” (or not?). There’s not much to the device definition itself.

Sorry for the delay. I’ve filed a bug recently about this since it seems like an internal issue with the type that’s being returned from one of our methods. I’ll let you know when there’s movement on it.

Thanks Kris. It was easy to refactor so the smartapp code doesn’t have to pass JSON data to the device method. Woud be nice if we could pass the JSON content directly.

I was wondering if anybody found a workaround for this problem.

I have a very similar one, although in a somewhat different context :

  1. a custom Device Handler, including a custom Command properly declared [metadata {definition (… command “reportNext”]

  2. a SmartApp which send this Command to a Device controlled by this Decice Handler [<my_device>.reportNext()]

  3. then when the SmartApp executes, the Command IS sent, and the Device DOES execute the Command properly

  4. +++BUT+++ the SmartApp aborts with the same incomprehensible message :

    “groovy.lang.MissingMethodException: No signature of method: physicalgraph.device.CommandService.executeAction() is applicable for argument types: (physicalgraph.device.cache.DeviceDTO, java.lang.Boolean) values: [JJG, true] @ line 93”

This is very annoying since my SmartApp is supposed to run periodically, and not be a “one shot” item.
I opened a Support Ticket [#98757], but they don’t seem to have any idea either.