Action calling a custom Attribute resulting in "No Signature Method" error

I have a custom driver containing a method "requestMeasRM()" (see below). I do not need to pass any parameters (from RM) as the sendHubCommand does not change.

When I created the Rule defining a custom action "requestMeasRM()" from the dropdown box, when the parameter input was offered I simply ignored it and completed the rule.

Now it seems the interaction between RM rule and the driver code don't seem to match resulting in an error. I guess I could have RM pass a dummy parameter but I would like to understand what I missed.

Thanks
John

RM Rule:

Log ERROR:

Code Being Called:
def requestMeasRM() {
sendHubCommand(new HubAction(sendtodevice("@."), Protocol.ZIGBEE))
}

Please share the custom command declaration from your driver.

1 Like

It looks like you are passing a single null parameter to your custom command, whereas it's defined as taking none. Fixing whichever of those is the problem should fix the problem here (if it's not supposed to take any parameters and you don't see RM claiming to send any, I'd try just removing and re-creating that line in the rule--and being sure not to add any parameters).

1 Like

I'm learning by example so I'll guess some of the pieces I put together don't match. I actually included the command "requestMeasRM to force a "button" on the device page.

metadata {
  definition (name: "Garage Ultrasonic v03", namespace: "johnrob", author: "various") {
    capability "Actuator"       // our device has commands...
    capability "Sensor"         // our device has attributes...
    capability "PresenceSensor" // ENUM["present", "not present"]
    capability "Configuration"  // capability "Configuration"  commands: configure()

    command "requestMeasRM"

    attribute "vehiclePresent", "bool"
    attribute "lastActivity", "String"
    attribute "distance", "Integer"
}

}

Looks like an issue with the rule, then. Verify that your custom command/action in Rule Machine isn't sending any parameters--looks like it's sending an empty/null one from the logs above, when it should be none at all.

1 Like

That's what I saw in the error text. I'll have to delete the rule and start over.

Thanks
John

I don't think you'd need to delete the rule--just that action should be enough, and make sure you don't add any parameters when you re-do the custom command in RM. But, of course, either way should work if this is really the problem.

Thanks,
I've modified that code a few times. Its now ready for the wipe clean and restart. Its really not a big deal as I have the logic written down so its just a matter of entry.

Probably not related, but I understand that using “Integer” in a driver can cause some RM issues (typically seen when creating a rule though, not when running it...). The recommendation is to use “Number”.

1 Like

As far as I recall, the only place the attribute type matters is for custom attributes in conditions. There are many places that the actual value matters, for example a driver not sending a decimal value in an integer context. When using custom actions, parameter type is important, as is the number of parameters, for the same reason: the definition of the method being called in the driver.

2 Likes

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