Using Custom Commands Generated in R-M

I'm trying to use a RM Custom command to trigger a dimmer in my garage.
My Front Entrance is an Inovelli Dimmer which reports manual actions.

I want the garage dimmer to go on when the Front entrance is turned ON "manually" (even if the FE is already on) but not by a rule

Then I want the garage dimmer to go off in a similar fashon as the on function.

I've created the custom commands but have not found the proper procedure to use them in a RM Rule.

In this case they are: (also see below)

  • PressUPX1()
  • PressDOWNX1()

My guess is the is a button or option I've overlooked but I can't seem to find it.

Suggestions?

Thanks
John

Custom commands are used in rules, triggers and actions, in the action section. It will be the last action section, called Run Custom Commands. These are available for any rule. Just select the one you want in there.

@JohnRob Here's an example I got some help with that really clarified the process for me. I have an Insteon sensor that tucks so nicely behind a toilet, but since there's no Insteon support in HE (yet :wink:), I had to get creative. There isn't (or wasn't at the time) a way for a virtual switch to trigger a leak notification in HSM, so it had to come from a leak sensor.

So how the Insteon part works isn't important here. What the point is, is that a virtual switch turning on triggers a leak detection via custom command and a few lines code.

/**

  • Copyright 2014 SmartThings
  • Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
  • in compliance with the License. You may obtain a copy of the License at:
  •  http://www.apache.org/licenses/LICENSE-2.0
    
  • Unless required by applicable law or agreed to in writing, software distributed under the License is distributed
  • on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License
  • for the specific language governing permissions and limitations under the License.

*/
metadata {
// Automatically generated. Make future change here.
definition (name: "Simulated Water Sensor", namespace: "smartthings/testing", author: "SmartThings") {
capability "Water Sensor"
capability "Sensor"

    command "wet"
    command "dry"

}

tiles {
standardTile("water", "device.water", width: 2, height: 2) {
state "dry", icon:"st.alarm.water.dry", backgroundColor:"#ffffff", action: "wet"
state "wet", icon:"st.alarm.water.wet", backgroundColor:"#00A0DC", action: "dry"
}
standardTile("wet", "device.water", inactiveLabel: false, decoration: "flat") {
state "default", label:'Wet', action:"wet", icon: "st.alarm.water.wet"
}
standardTile("dry", "device.water", inactiveLabel: false, decoration: "flat") {
state "default", label:'Dry', action:"dry", icon: "st.alarm.water.dry"
}
main "water"
details(["water","wet","dry"])
}
}

def parse(String description) {
def pair = description.split(":")
createEvent(name: pair[0].trim(), value: pair[1].trim())
}

def wet() {
log.trace "wet()"
sendEvent(name: "water", value: "wet")
}

def dry() {
log.trace "dry()"
sendEvent(name: "water", value: "dry")
}

@SmartHomePrimer

Thank for the reply. So in your Toilet leak example, as I try to created a similar rule I get to here and the custom condition I created is not available as a trigger.

Or are you saying I need to modify your app to get what I need?

@bruce

I cannot find any option that is titled Run Custom Command. Can you give me a hint as to the path to this option?

John

Custom commands are run in the action section of a rule.

In my example, the custom command is triggered by the virtual switch "HE Toilet". In your rule, the choice would be "Switch" for the condition. When the switch turns on, it creates a rule truth that runs the custom command wet() to the simulated leak sensor "Toilet leak sensor", changing its state to "wet"

!
37%20PM!

HI, resurrecting this thread a bit here. I am interested in running a custom command from RM but my Actions section doesn't include many of the options shown above... am I down level firmware wise or something? I just got this thing...so I would think not... but thoughts?

You have to first setup Custom Commands from the Rule Machine main page: Read about it here: Rule Machine - Hubitat Documentation

@bravenel

Bruce, Is it possible to create a custom command with a variable?

A simplistic use might be "change lighting configuration to step 5" or perhaps change all thermostats to 64°.

Thanks
John

Not at present.

OK thanks :slight_smile:

John