Rule Machine Expert Features
Bruce has been gracious enough to humor my request to add some previously unavailable functionality (unavailable anywhere), to his fantastic Rule Machine.
This feature is available in version 1.6 and later, see: Rule Machine
Expert Features extends the Select Action choices in your rules with a new Run custom device command option.
This feature allows you to control devices that have custom (IE non stock, un published or yet to be published capabilities)
These devices could be devices that you or someone else has created.
Notable examples of published devices with custom capabilities:
-Fibaro RGBW controller, all of the buttons in the device detail tile have associated custom commands.
-Sonos and other Speaker devices, playTrackAndRestore and playTrackAndResume being two.
-Thing Shields, every thing shield has nothing but custom commands, you can now run these commands directly from Rule Machine.
Have a multi channel relay, and you want to ditch all those virtual switches?, well here you go…
Basically any device that formally required a custom smartApp to support could be a candidate to migrate and control using Rule Machine.
Here’s a few examples that I’m using in Rule Machine
–softwhite() and deepfade() on an Fibaro RGBW controller that uses @twack device type
–playTrackAndRestore(‘https://s3.amazonaws.com/smartthingssmartapps/Boss+is+arriving.mp3’,6,30) on a Samsung Speaker
–fanOff() on a custom AEON dual switch device that I wrote
The cool thing about expert is you don’t even need to know what commands the device supports, it will give you a list to choose from and experiment with. (see cautions below)
There are two steps required to use custom commands in your rules.
-Create/test and save your command
-Select the device and command to execute in your rule
Create/test and save your command
–Open Rule Machine
–Select Expert Features, then Configure Custom Commands
–Select a device to extract the available commands from (any device with capability actuator will be shown)
–Select New Custom command, then select Available device commands (all standard and custom commands will be displayed)
–Select the command you wish to create from the above list, the results of the command execution will be immediately shown.
–Add any required parameters to the command.
–After the command is executing against the device as expected, select save command now, then done, then done again to return to the Custom Commands page.
–The saved command will now be available in the “saved command to test” list, and also in your new and existing rules.
Select the device and command to execute in your rule
–Create a new rule or edit an existing one
–In the Actions section (at the very bottom), select the custom device(s) and the command (saved above) to execute against them.
–If multiple devices are selected, each one should support the selected command, any errors will be trapped and show in the logs.
One or more commands can be removed by selecting them in Delete Custom Commands, then Delete commands now, then done.
–Un-select your test device or the “saved command to test” before leaving the custom commands page, otherwise the command will execute the next time you open the page.
–Un-Select “available device commands” after saving the new command, otherwise the command will execute the next time you open the page.
–Un-Select “parameter type” for each of your parameters, in reverse order (ie 3,2,1) after saving the new command, this is just a convenience thing.
–The success or failure of any parameters can’t be determined by expert, use the logging in the IDE if you’re having issues getting a command to function.
–If your wizBang device isn’t in the list, add capability actuator to it.
Expert will expose commands on device types that aren’t published by ST, when you find these commands and play with them, you are doing so at your own. Neither Bruce, ST or myself are going to have any sympathy when you successfully execute wipeDisk() on your new Samsung appliance and have bricked it.
So, be advised it’s probably better to play with device types and commands that you have the code for, there I said it.
Please post any questions or issues with expert to this thread.