Rule Machine Best Practices

Just to add my approach, which hopefully nobody will shoot down in flames. :slight_smile:

I have created naming standards for my RM rules: Variable Set, Sub (Routine), Security, Schedule, Presence, etc. I use these phrases as the first word in my Rule name which has the benefit of grouping similar rules together in the list as well as clarifying what the purpose of the rule is when scanning through the list at a later date.

The 'Sub' classification is for repetitive actions that get used in multiple rules. This makes maintenance of rules easier over time and also introduces consistency. e.g. I send notifications to my and my wife's phone for security and excess temperatures etc. So I have created a global variable %notification% which I populate within each relevant rule then add that to a standard header text in a rule called 'Sub Notification Both Phones'. I then add an action when I want to send a notification 'Run Actions: Sub Notification - Both Phones'. Likewise for my security rules if I want to have certain Hue lights to flash red as a result of a security trigger, I add 'Run Actions: Sub Flash Lights Red'.

Using these Sub (Routines) also allows for Repeats of rules within Repeats, which isn't currently allowed within RM.

Here is an example of my 'Security Panic Button Pressed' rule:

2 Likes