Creating a Smart 'Away' Mode Automation

Hey everyone, I’ve been trying to set up a smart ‘Away’ mode in my home automation system, and I’d love to share my journey and see if others have similar setups or tips.

The Goal:
I want my home to automatically adjust settings based on whether I’m leaving during the day, evening, or night. For example, during the day, I’d like lights to turn off and maybe some security cameras to activate. At night, I’d prefer certain lights to stay on for safety but others to dim.

The Challenge:
Initially, I thought it would be straightforward—just create an ‘Away’ mode and set some rules. But as I started digging into the details, I realized I needed a more nuanced approach. How do I make sure the system knows whether it’s daytime or nighttime? And how do I ensure that the automation doesn’t conflict with other routines?

The Solution:
After some research and experimentation, I decided to use a combination of time-based triggers and state variables. Here’s a simplified version of what I came up with:

plaintext
rule “Away Mode Automation”
when
Item away_mode changed to ON
then
if (current_hour >= 6 && current_hour < 18) {
// Daytime away mode
executeDaytimeAwayActions();
} else {
// Nighttime away mode
executeNighttimeAwayActions();
}
end

Daytime Actions:

  • Turn off all interior lights
  • Activate outdoor security cameras
  • Set thermostat to energy-saving mode

Nighttime Actions:

  • Turn on motion-activated porch lights
  • Arm security system
  • Set thermostat to a slightly lower temperature

The Outcome:
It’s been working beautifully! I no longer have to manually adjust settings when I leave the house. The system handles everything based on the time of day. Plus, I’ve added some visual feedback on my dashboard so I can quickly see if the ‘Away’ mode is active.

Lessons Learned:

  1. Start simple and test each part of the automation before adding complexity.
  2. Use time-based conditions to make your automations more context-aware.
  3. Don’t forget to provide feedback to yourself (and others in your household) about the system’s state.

Looking for Feedback:
Has anyone else tackled a similar project? I’d love to hear about different approaches or any improvements you might suggest. Also, if you have tips on how to make this even more efficient, please share!

Happy automating! :rocket: