"Thumb turn", "by keypad"

I'd like to set up rules where when a guest leaves and locks the door by keypad I can shut off some lights. Thumb turn and by keypad appear in the logs but not in the pulldowns. Does this mean I need to create a variable for that lock information that is generated?

If the log shows the keywords you are looking for, then you could probably put %value% or %text% in a local string variable and look at the variable for the keyword in question.

1 Like

Yup. You can do this as suggested by @terminal3. The entire automation can be done using Rule Machine.

Here's an example of something similar:

I'm struggling at moving forward with the screen shot. Is there a step by step description similar to what was created for the lock code variable?

I believe I correctly created the trigger per the screen shot. What is the selection I must choose to create the action per that screen shot.

Set variable.

Ok I selected variable


According to the screen shot I should select %text% but my only choice is %device%. Was I not to select “Set variable” on the right?

You need to create a text variable first. Either a hub variable or a local variable within the rule.

What is my initial value?

Whatever you want - how about "this is an initial string"?

No, %text% and %device% are built-in variables. They are also read-only, being set by triggers (and sometimes other events/actions) in the rule, not anything you need to set yourself. If you manually created a variable named "%device%", as it appears you did, remove it. The built-in variables can be referenced like any variable by typing %device% or %text% (literally) in any context where a string variable is allowed. They will not appear in (most? all?) drop-down lists of variables like variables you create do, so this is how you use them (the same trick works for any variable but is necessary for these for this reason).

In the example rule linked to above, the variable you are setting -- and the only one you have to create yourself -- is called descriptionText. (It doesn't really matter as long as you know what you called it, except I'd avoid names of built-in variables to avoid confusion -- and possible problems if you actually need the built-in variables, as yo do.)

To set a "real" variable to the value of a built in variable, as in the first action of that rule, you'll need to do something like this (just with the appropriate variable names under "Select Variable to Set" and, as applicable, "String to set [variable name] to"):

2 Likes

Hi Robert, ok so I deleted my last attempt and will try again. Just to ensure I have my brain wrapped around the concept, I need to create a variable that I will call 10LockVarKeypad and 12LickVarKeypad which would be to identify when the Plaza10 lock and/or the Plaza12 lock.is locked by the keypad indicating that guests have left the space.

In earlier posts aaiyar referred to a local variable vs a hub variable. Does a local variable mean that it can only be used within the rule that the variable has been created and a hub variable is kind of a virtual device so it will appear in most pull downs to invoke on the same hub. Is this the way of distinguishing between both.

Another contributor said that I must create the variable 1st then set up the rule, is that the case. I think this makes sens as that variable is my trigger.

The screen shot you displayed at the end of what you wrote is found in Machine Rule or Hub Variables?

Is this what I need to do to create the variable?

1 Like

Essentially correct.

That was from Rule Machine.

I don't think the variable should be your trigger.

Your trigger should be a change in the status of the lock.

The actions of your rule should check whether your string variable contains the text of your choice. With further actions being dependent on whether that text is present or absent.

Ok I’ve got this now.


What is my next step.

How do I put in the string of my choice. “Lock was locked by keypad [physical]

%text% gets filled automatically. It will be a text string describing what triggered the rule.

So your trigger should be Lock status changed.

So set the trigger and then activate the lock. Your rule will run and you can look at the value of your variable, Right now it is null, because the rule has yet to be triggered.

I think after triggering the rule a couple of times locking and unlocking you will see what is happening.

2 Likes

I installed the same variable and Rule machine at my home location as it is easier to generate the lock unlock records.

This is what I now see in the variable screen. I think I can erase the bottom record must be a miss step.

Now that I have this information being generated, how do I link it to create an action?