Setting a custom attribute

I'm using @Cobra driver https://cobra-apps.co.uk/ Multi Status Switch & Button. I can use the custom status attribute to control program flow like this image

I the next line I want to set the custom 'status' attribute to 'Auto'. I can't see where this can be done. Does anyone know how to set a custom attribute when the driver has the "switch" and "PushableButton" capability?

Custom Attributes are a way to connect to the internal procedures of a driver. Often these are not listed as a capability.

I'm going by memory so I may be off a step or two.

When you get to the point in RM where you would add an action type "select custom action"

Next screen:

Now you pick the device whose driver contains the custom action you want to use.

Then Select the "custom action" you want to use.

Hope this helps.

Thanks for the information. I had a play around with that. I can only see my 'Blind Automation' (which is a vertual Multi Status Switch & Button) under switches or buttons which makes sense to me since as that is what the drivrs capabilities are. When I select either of those I only get the standard button and switch custom commands.
I can't see the Multi Status Switch & Button listed as an action device.

I tried modifying the driver to add
def Status(NewStatus)
{
state.status1= NewStatus
}

Hoping that would add another custom command. But it didn't.

You have to define custom commands in the driver metadata, and define the method.

:point_up:

Hi Bravenel,

I'm new working with drivers but do program. It sounds like from your comment that the 'Select custom comand' drop down list is populated by the driver that is built and not the commands available in the capabilities assigned to the driver?

If that is the case I added the code as a method above thinking that was logical as the 'off', 'on', 'push' commands showing as a 'custom comand' are also methods. I can't see any other definitions in the driver code defining the existing methods to expose them as a command.

If it's simple enough any assistance would be appreciated.

As an aside,
Is there a link you know of that that describes the internal commands and syntax available like sendLastEvent()
sendEvent(name: "switch", value: "on", isStateChange: true)
log.info

This is just a custom method I coded to set a couple of attributes (Date & Time)

Other commands/methods etc. are documented here:
https://docs.hubitat.com/index.php?title=Developer_Documentation

I have also added code to the driver so you can use RM to set the status values via pushbutton commands
Latest version V1.1.0 should do what you want

You just need to get RM to 'push' the relevant button number
e.g for 'Status Three' push button 3

Andy

1 Like

No, it should get all of the commands available for the driver. This can be a combination of commands associated with the capability (e.g. on, off) and custom commands defined explicitly in the driver metadata.

Thanks

From an app you can use this to see what a device supports:

device.supportedCommands

That's where RM gets the list of Custom Commands for a device.