This device has no voice for this language. You can add one in your device’s speech settings.
Rules That Work Every Day – Not Just When Everything Is Perfect
A rule that works when you test it is not necessarily a reliable rule. Real homes are full of small surprises: sensors that report a strange value, a battery that runs flat, a power cut in the middle of the night, a visitor who does something unexpected.
Reliable automation is designed for these situations. It behaves sensibly when information is missing, recovers by itself after a restart and never surprises the people who live in the home.
This guide builds on the basics of triggers, conditions and actions (Guide 4) and explains the techniques that turn a working rule into a dependable one.
1. What Makes a Rule Reliable?
A reliable rule has a few typical qualities:
- Predictable – people can understand what it will do.
- Stable – it does not switch back and forth because of small changes.
- Tolerant – it copes with missing or unusual information.
- Self-correcting – it ends up in the right state again after a restart or a missed message.
- Safe – when something goes wrong, the result is harmless.
The following sections show how to achieve each of these.
2. Separate On and Off Limits
When a rule switches something on and off at the same value, it will switch repeatedly whenever the measurement moves around that value. Sensor readings always vary slightly, so this happens more often than you might expect.
The solution is to use two different limits – a technique called hysteresis:
WHEN the bathroom humidity rises above 70%,
THEN switch on the extractor fan.
WHEN the bathroom humidity falls below 60%,
THEN switch off the extractor fan.
Between 60% and 70% nothing changes. The gap must be larger than the normal variation of the sensor. Thermostats use the same principle to avoid switching the heating on and off every few seconds.
3. Minimum Durations and Delays
Many unwanted actions are caused by short, unimportant events: a door opened for two seconds, a cloud passing in front of the sun, a single strange sensor value. Requiring a condition to last for a certain time filters these out:
- "The window has been open for more than five minutes" before the heating is turned down.
- "The light level has been low for two minutes" before the outdoor lights switch on.
- "No motion for three minutes" before the light switches off.
Equipment such as pumps, compressors and heat pumps should also have a minimum running time and minimum pause, so that they are not started and stopped too often. Follow the manufacturer’s recommendations.
4. Missing and Unusual Values
Sooner or later every sensor will stop reporting or send a value that cannot be right. A reliable rule is prepared for this:
- Check that the sensor is available before using its value. Most controllers show a device as "unavailable" or "unknown" when it stops responding.
- Ignore values that are physically impossible, such as a room temperature of −40 °C or 120 °C.
- Decide what the rule should do when information is missing – usually nothing, or a safe default.
- Send a notification when an important sensor has not reported for a long time.
An example of a sensor watchdog:
WHEN the water leak sensor under the dishwasher has not reported for 24 hours,
THEN send a notification: "Check the battery of the leak sensor."
5. Rules That Survive a Restart
Controllers restart after updates, power cuts and changes. A rule that only reacts to changes can miss an event that happened while the controller was offline. For example, if the controller restarts while the bathroom fan is running, the "humidity below 60%" event may never arrive, and the fan keeps running.
There are two good ways to avoid this:
- Check the state at start-up – add a rule that runs when the controller starts and sets important devices to the correct state.
- Compare states, not only events – a rule that runs every few minutes and checks "is the humidity below 60% and the fan still on?" corrects any missed event.
Timers and delays that were running at the time of a restart may also be lost. For long delays, such as "switch off after two hours", it is often more reliable to store the end time and check it, rather than relying on a running timer.
6. Avoid Conflicts Between Rules
As a system grows, rules start to influence each other. Typical problems are:
- Two rules control the same device with different goals.
- A rule reacts to a change made by another rule.
- A manual change is immediately undone by an automation.
Good practices:
- Give each device one rule – or one group of rules – that is responsible for it.
- Use modes (Home, Away, Night) to decide which rule applies.
- Let rules check who caused a change, if your controller supports it, so that manual changes are respected.
- Keep a list of which rules control which devices.
7. Choose Safe Defaults
Think about what is harmless if a rule fails, and design towards that result:
| Function | Safe Result if Something Fails |
|---|---|
| Heating | A moderate temperature, not maximum and not off in winter |
| Water protection | The valve closes when a leak is detected; it should be possible to open it by hand |
| Lighting | Lights can always be switched by hand |
| Pumps and fans | They stop after a maximum running time |
| Outdoor lights and garden | Switch off after a fixed time, even if the off signal is missed |
For important functions, a maximum running time is a simple safety net: "whatever happens, switch the pump off after 30 minutes". Guide 28 explains fail-safe design in more detail.
8. Test Like Real Life
Before you rely on a rule, test it in realistic situations:
- Trigger it in the normal way and check the result.
- Test the conditions: at night, during the day, with and without people at home.
- Switch the device by hand while the rule is active.
- Remove the battery from a sensor, or switch it off, and watch what happens.
- Restart the controller while the rule is in the middle of its work.
- Check the history or log afterwards to confirm the rule ran as expected.
Use the history and logs of your controller regularly. They show not only that a rule ran, but also why – which makes problems much easier to find.
9. Keep It Simple
Complex rules are harder to understand, test and repair. A few simple habits help:
- One purpose per rule, with a clear name.
- Use helper values or modes instead of long lists of conditions.
- Prefer the controller’s built-in functions to complicated workarounds.
- Write down why a rule exists and what it depends on.
- Review your rules once in a while and remove those that are no longer needed.
Final Thoughts
Reliable automation is not about clever rules but about careful ones. Separate on and off limits, minimum durations and checks for missing information stop rules from reacting to noise.
Rules that check the state at start-up, safe defaults and maximum running times make sure the system recovers by itself when something goes wrong.
Test your rules in real situations, keep them simple and review them regularly – and your automation will work quietly in the background every day.
MISOLIMA® – Technology Made Practical.
Practical knowledge for understanding, designing and building home automation.
Continue reading
Back to the topGuide 15