"Thumb turn", "by keypad"

I see the 2 conditions being generated in the Hub Variables. Bellow is the condition that I would want to trigger turning things off. How do I accomplish this

Why do you want to trigger on this variable instead of just doing whatever actions you want (like the notification) in the same rule that sets (and, cruciallly for this, the tests) the rule? This is exactly what is done in the example @aaiyar linked to above, but you can customize the actions inside the IF THEN or ELSE to your needs--though I'm not sure if you'll need to.

1 Like

Robert, I’m not certain on what I should do at this point. I’m following the advice of all the folk that have so kindly contributed. My aim for this Rule Machine is when the lock displays “locked by keypad” I turn off a bunch of features like the electric fire places and lights as no one is home. That is my final aim.

I’m unaware on how to get there, just going along with what I’m being told.

I would create the exact rule linked to above, but do whatever want instead of the notification actions. In your case, that sounds like turning switches off (instead of the notification). The rest of the rule would be similar. There is no need to create a second rule, though it technically would work too.

1 Like

Appreciate the advice Robert, my brain has not wet been elevated to understanding the subtleties of the advice received. Given that I want to pursue in the direction that you are proposing, what is the next programming step I must do towards getting this Rule Machine and hub variable to toggle off switches when the lock is locked by keypad. Is it a condition in the Rule Machine or a trigger in Rule Machine?

Hi @ngbergeron

Can I suggest doing exactly that @bertabcd1234 suggested? Follow this rule as an example:

For the Trigger, use a change in lock status (@terminal3 also suggested this).

For the actions:

  1. Start by setting the contents of your variable, "Ouimet Lock Code Variable" to be %text%. Exactly as shown in the example above for the variable "descriptionText".

  2. Next, evaluate the content of your variable, "Ouimet Lock Code Variable". If it contains "locked by keypad [physical], then proceed with the actions of your choice. Meaning - replace the notification action with actions of your choice.

  3. If it doesn't contain the text, you can perform alternative actions (or no actions at all), and then exit the rule.

1 Like

So if I follow the screen shot above my next expression is an IF.
So I did this, and am stuck


Which is my selection to continue. I’m terribly sorry to require so much hand holding, this is still not intuitive for me. I have not yet grasped the logic of how the parts all work together.

New Condition

There is no pre-existing condition. So far you've created a variable that contains the content of %text%. Next you have to create a condition that evaluates the contents of that variable.

Your condition will be to test whether your variable, "Ouimet Lock Code Variable" contains "locked by keypad [physical]".

I’m I going in the right direction with this.


I seem to be able to only select 1 action meaning turning 1 light off rather than being able to select a whole bunch as in Basic Rules.

There are several things wrong here:

  1. I think you have mistakenly created TWO conditions.

    a. One of them evaluates the content of your variable
    b. The second tests whether Kitchen switch is off.

  2. You probably need to delete the second condition.

  3. Then, go back and look at the example posted above. The second (and subsequent) action should be within an IF-ELSE-ENDIF block. The IF will start by testing if your condition is true (or false).

I think I managed to remove the 2nd condition. I confused it with an action.


Is this correct now.

Is it acceptable for a contributor to hop on my screen with teamviewer and just do it for me.

In searching on community posts I read that back in 2018, lock code manager was an app that was going to be developed eventually. Lock code manager now exists and is very useful to me. It would stand to reason that shutting things off in your home when you lock the door with the keypad would be an activity that most people would want to do, so just like lock code manager at some time in the future this capability will be built in and all a novice like myself will have to do is select it, rather than having to invent it.

You are getting there. You've started creating the IF block. Now you need to add some actions to it.

There are some community members who offer professional paid support. I am not one of them. But you can post a request for such support in the Lounge.

Lock code manager exists for one explicit purpose - managing lock codes. This means creating/deleting lock codes. It is not designed for any other purpose.

Your automation is quite easy to create within Rule Machine. Have you read the Rule Machine documentation?

What is the next action I need to add to the if statement?

I don't know. What do you want the action to be? Control lights? In my example posted above, the action was a Notification.

Please read the Rule Machine documentation because it describes the structure of a rule, under the section "Anatomy of a Rule".

@bertabcd1234 - any comments?

Also, these three videos from the Hubitat YouTube channel may be useful:

1 Like

I’ve watched the videos a while ago and read the documentation prior to trying to accomplish this task. I get the feeling that a midway option between Basic Rule and Rule Machine is needed for people without a programming background like myself.

I appreciate the screen shots sent by Robert, indicating what the end result looks like. But it’s the steps leading to that end result which are stabs in the dark for me.

Six months ago when I initiated the conversion of my 4 sites from Wink to Hubitat, I followed the 30+ steps on how to create a lock code variable. I succeeded, but again it was spelled out with a lot of detail. The documentation was a detailed step by step process easy to follow. Although I appreciate immensely the help I’m getting here, I’m not getting the level of detail that I need to be able to progress forward. Most often I don’t understand what I am to do even if I reread numerous times the steps I’m told to pursue. I have my PC looking at documentation, my phone readying posts and my tablet attempting to do what is being told to me. Consulting 3 screens at a time in the hopes that I’m getting somewhere…

This hub is powerful, it can do anything I am convinced of that. But the success of pushing it out to a greater number of users is to minimize the level of frustration in getting actions working.

I wouldn’t be here if Wink was reliable. I suspect I am but one of many that are looking at Smart Things and Hubitat and other platforms to solve the lacklustre service of Wink. Wink offers absolutely no support. Hubitat is fantastic in the way that the community offers its time to new users like myself. But a dumb down tool is needed if the Hubitat Gods expect each household to adopt this product.

So, what is the next step in my IF statement

This was answered in the post directly above yours in this thread. And in multiple other posts in this thread.

I realize it has not been easy for you to duplicate what is shown in screenshots for similar rules. But I’m out of ideas on how to convey the information that has already been provided in a way that makes it easier for you to reproduce.

So I’m stepping out of this thread. As indicated above, there are community members who offer paid unofficial support, and may agree to create your rules remotely. You can use the Lounge to advertise for help.

3 Likes

Here's an alternative idea since you seem to have problems finding the right actions in the Rule Machine UI. I've created an example rule that should do more or less what you want, assuming I'm interpreting your description correctly and your lock reports events in this way. I've exported this rule to a file/download. To import:

  1. Download this file from the link below.
  2. Go to Settings > Restore Apps on your hub.
  3. Select the file you download above to import this app.
    (See also the documentation for this tool.)

The file is here (will probably eventually be deleted for anyone who finds this in the way future, but creating the rule yourself should still work):

The finished rule will look something like this, but you'll be prompted to substitute your actual devices on import:

You may need to make minor modifications, including adding additional lights to turn off (click/tap into the "Select Actions to Run" box and then click/tap the actual action in the table to edit it, e.g., to select different devices). You might also need to change the condition to whatever you need to make work with the way your device actually reports events; I'm assuming manual locks/unlocks say "physical" somewhere in the event description text; if not, you'll have to modify something according to whatever your device does (sounds like it does something; there just aren't any clues above as to what).

Hopefully this helps.

2 Likes

Robert, I was able to import the file.

1 Like