Variable ring and gate opening

it’s the first time I’m writing, sorry for the bad English. I’m italian :slight_smile: . I have a RING bell and I would like to create rules, when I press 1 time it rings the bell, if I hold it down for 3 seconds it opens the gate. how can I do? Thank you

Hi @andrea_visentini, welcome to the community. Are you using SmartThings or Hubitat hub? Press the button one time to ring the bell is how Ring doorbell is programmed, and cannot be changed by any automation tool, so you don’t need to anything for that. To verify if SmartThings supports Ring Doorbell button held, can you go to SmartThings IDE site, login, tap My Locations at top, select your location, and top My Devices at top, then select your Ring Doorbell device. Check what values are displayed in the supportedButtonValues field as shown in the screenshot below from my SmartThigns button device for your reference.

I don’t have a Ring Doorbell to test with as this moment, but I remember SmartThings only supports single button press event if I remember correctly.

yes correct I can only use one function. if I press once it opens the gate. but i can’t do 2 functions. I was wondering if creating a rule could be done. I use SmartThings

@andrea_visentini, thanks for the clarification. Can you please take a screenshot of the Ring device page in the SmartThings IDE site? So we can see what button event that SmartThings supports for Ring doorbell.

The other way to find out to create a rule, and use the doorbell’s button changes to “held” as the trigger as shown in the screenshot below, and send yourself an email in the Flow, and then trying to hold the button on the Ring doorbell to see if you get an email to verify if the rule was triggered.

I tried as you advised. holding down no mail arrives.


Thanks for the updates. I am not surprised that SmartThings only supports Ring doorbell “pressed” but not "held’ though. So you will need to find another way to control your gate, since the “held” event is not supported in SmartThings fundamentally in this case.

ok thanks, they advised me to create rules. can you advise me?

It is possible using variables in Sharptools.

Create a numeric variable that increments in value each time the bell is pressed. When the value = 2 then open the gate and reset the variable back to 0. this is what they advised me. but i don’t understand how to create a rule with variables

Ah, I think I found the relevant reply by @Danny_Richman here:

https://www.facebook.com/groups/2899495783708548/posts/3206169766374480/

As Danny mentioned, you would press the doorbell multiple times in a row to trigger your desired automation. I’m not sure if Ring reports the events quick enough to SmartThings (and SharpTools) for this to work consistently, but I am happy to help you put together a rule to test it!

Here’s the rule I put together and it seemed to work fine with a Virtual Button:

  1. First, create a variable to keep track of how many times the button has been pressed. From a Rule, you can tap the ... in the top-right corner and Manage Variables, then tap Create Variable at the bottom.

    image

    Give the variable a name (ButtonPressCount), set the type to Number, and set the initial value as 0.

  2. Recreate the Rule Flow and Triggers from my screenshot above.

    • The first item in the flow is an IF_Condition > Variable
      • This checks if the ButtonPressCount is 0 or less. Otherwise it must have already been pressed one time and we are on the second press.
    • In the Then, we set the Variable to 1 (first press)
    • In the Else, we know it has been pressed twice so we can run our device action and then set the variable back to 0
      • Note that I showed setting the ButtonPressCount variable to 2 as the first step in the Else to make the flow more readable, but it is totally unnecessary and does not need to be included.

Also, you mentioned in the Facebook post that variables require premium – I’d be happy to reset your trial for you if you’d like. Just send a note to support@sharptools.io asking to reset your trial. :smiley:

1 Like

ok thanks, it works perfectly. I press once it rings, I press another time it opens the gate. therefore it is not possible to keep the key pressed, but only to press twice. the problem is that if the courier presses twice, he opens the gate for me, I should add that the gate opens only if my phone is in the area. you say it can be done?

Yes, you can update the rule to include the additional condition to check whether your phone is present if you have added your phone to be the presence sensor in SmartThings. See the screenshot below for example, and you will need to test the rule out a bit because it may take a few minutes for several different reasons before the phone reports the presence status to SmartThings.

I would probably do it slightly different than James and only make the garage action conditional on presence (rather than the whole flow).

If you’ve already created the original rule above:

  1. Delete the existing Gate action
  2. Tap the + icon in the existing THEN side of the flow and add an IF Condition > Device
  3. Configure the nested IF condition for your device presence is ‘present’ and save it
  4. Inside the new nested IF condition’s THEN, add your gate action
  5. (Optionally) Drag the IF condition up to the spot where your gate action was originally (using the in the top-right corner of the IF card)
    • It’s actually OK to set the variable back to 0 before the device command as it will prevent the gate command from running again if the button is pressed multiple times.
    • And just to reiterate, setting the value to 2 was just to make the flow more readable and isn’t necessary either.

Side Note: Reset Push Count

And now that I think about it, the button count probably needs to periodically get reset. Otherwise someone could push the doorbell once… then hours later when it’s pressed again that would count as 2 presses.

It’s probably easiest to create a separate rule to handle the reset. Something like the following would work where we use a state stays condition on the variable and then just reset it.

thank you very much to all 2. tonight I’ll try again with the new conditions and update you. Thanks again

2 Likes

everything works thank you very much. the only negative note is that when I press the bell you have to wait 10 seconds and then press again to open the gate. but I think that’s how it is. thanks for the help

2 Likes