Custom Command - Custom Name

I love the Create Custom Command feature in RM and I have a lot.

I think (eventually) I am going to forget the reason (or the literal command) I customized and why.

For instance, I created a custom command to play a pandora station through Sonos. The custom command name displayed in RM is playtrack(songs . . . .).

Could you please allow us to save a custom command with a custom name (ie - classical radio station).

2 Likes

This could also be done by allowing an attribute to be associated and displayed with any command. I did this in SmartThings and the tile displayed the station name (i.e., 60's Folk Radio (from Pandora).

Yes, please Bruce (@bravenel)

Just started playing with custom commands, and I too would like the ability to have a custom name for the command. Real world scenario: 3 exact same devices, need to expose the same command. They all show up with the same name & no easy way to differentiate between them based on the name displayed in RM.

image

Thanks
J

You don't need 3 identical.

I don't know if I can explain it well.. but you're using ONE driver to expose the commands (methods) it has implemented (or at least says it's implemented.) Once that's exposed you can ask Hubitat to use that. If you tell Hubitat to use it for a device driver that doesn't have the command, it won't do anything, at least nothing you're expecting. :slight_smile:

Said another way... You're using one driver to define how the command is spelled. (In your case, P.. I.. N... G, no parameters.) You can then ask any driver to use the command, spelled that way. If the driver has the command, spelled that way, it will do it. If not, an error gets logged.

I've created several Custom Commands. One is from a Dual Relay driver. Has an On and Off command, one for each "side" of the physical device. The specific commands are "on1()", "on2()", "off1()", "off2()".

Yet I can tell RM to use the command on any switch type device. In this case a virtual switch that tests sending words out a speaker. In other words a completely fake use.

When I cause the rule to run, I get this error in the log:

app:9082018-10-11 08:52:39.436:errorjava.lang.ArrayIndexOutOfBoundsException: 2 (installed)

But unlike Star Trek or any SciFi story, flames and smoke did not come out of my Hubitat. :smiley:

You are talking about a case when there is only one device of specific type. What if there are two or more. For example, one have 2 Aeotec power strips and two identical custom commands are created to turn on outlet. If custom name can't be changed then both be named on1(). How it can be defined which command corresponds to specific strip in RM? Only guessing I think. So we obviously need to be able to change Custom Command label for clarity.

As @csteele points out, you only need a single ping command. Custom commands, once defined, just become part of RM's 'vocabulary' of actions. Define it with one device, use it with any device that has that command.

Thanks Guys. Duly noted & implemented!

J

To @JDogg016 original point - it would be nice to have a configurable name for a custom command. My use case is like his/hers - Play a sonos playlist. Right now it shows up as:
playTrack('x-sonosapi-radio:ST%3a36601058461575458?sid=236&flags=8300&sn=6')

I'd like it to show up as: sonos play top hits playslist

Bump.

Will it be possible to name a custom command?

1 Like

I second this request. Some custom commands in their current notation are absolutely unreadable and it can easily be forgotten what this particular command is for.

Here's an example. There are two custom commands with setEffect in their title. The setEffect(4) is for my Front Porch Aeotec LED Bulb. It has a flashing red/blue effect called "Police" which I set so that if my alarm has gone off, there is a visual outside. The setEffect(9) is for my NanoLeaf and I call that particular effect for my evening lights.

So now I have to be careful if I want to use the number 4 effect of my NanoLeaf as I will get confused with the Aeotec bulb.

Yes I have the same problem with the Aeotec bulbs, custom commands need user friendly names so I remember what set effect 1-6 actually do

It's on the list. Haven't gotten to it yet. Will bump it up...

Thank you sir!