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.
Managing commands
One or more commands can be removed by selecting them in Delete Custom Commands, then Delete commands now, then done.
Tips:
â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.
Cautions:
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.
Thanks, Mike