Notification for changed state of door lock conditional to what state the lock was in before the change

If you're totally new to Rule Machine, the UI can be a bit awkward. To figure out how to get the IFs, I see you've already done so, but maybe watching the videos would help:

The docs are also good. I know they sound boring, but they're full of good examples. :slight_smile: Here is my preferred location for those (though you can also find this in the docs site): [Released] Rule 4.0

Finally, to give you even more ideas, locks generally only report a "locked" or "unlocked" state (some can do "unknown" and "unlocked with timeout" is apparently also an option that I'm not sure I've ever seen). Rule Machine also includes a few built-in variables you can use. Combining these facts, the following rule should work about the same:

Triggers:

Kitchen Door Lock *changed*

Actions:

Notify Pixel 3 XL: '%device% is %value'

Here, this relies on the fact that %device% is a string variable with the display name of the last triggering device (always going to be your lock here, since that's all there is) and %value% is a variable containing the value of the attribute ("lock," in this case, with likely values "locked" or "unlocked"--see "Current States" on the device page for what yours does) of the device that matched your trigger.

That being said, I'd just use the Notifications app for this myself. :slight_smile:

2 Likes