Overriding automations - am I doing it right?

I wanted to post this to check if I’m doing things right, or check if there are better ways to implement ideas like this going further.

I have an aqara fp2 motion sensor that turns on/off dining area lights at 1% brightness, and this automation is configured with a timer. I’ve learned to use timers with lights which is a nice idea. The timer will start when no motion is detected, but will go back to clear state if motion is detected again before the lights are off.

Now I added a zigbee wall switch to manually turn on/off the lights, and this switch will turn the dining area lights at full brightness for 10 minutes. The intention is to only have the lights at full brightness when someone is sitting on the table. Whereas if someone just passing through the dining area, lights only turn on at 1%

In order to override the original automation, I setup a similar type of automation with a new 10 minute timer, and in the actions I chose to disable the original automation when I physically click the TURN ON switch. Likewise, when the new 10 minutes are done or if I manually switch the lights off, the original automation will be enabled again.

Here’s the example for enabling the original automation (note that I only use the visual editor):

action: automation.turn_on
metadata: {}
target:
  entity_id: automation.dining_area_low_brightness_via_aqara
data: {}

I’m intending to add one additional layer by introducing of a pressure sensor. When someone sits on the chair, the lights will turn on at full brightness.

I’m guessing that this should be setup in similar way to the wall switch. If the pressure sensor is active, the original automation should be disabled and the lights will turn ON at full brightness, and I’ll have a timer for when nobody is sitting on the chair, it would turn off the lights and enable the original automation once again.

I wonder if all this could be done in a simpler or possibly a better way? Thanks!

Turning automations on and off is not a great practice and should be avoided.
Better practice is to use and entity like a toggle or button or the state of another switch or light in the top conditions: key to allow the automation to trigger, or not allow it.
If the logic is more complex, using choose: statements in the action: key can include many scenarios.

Especially your use of timers makes it easier to keep automations enabled but inactive. You can cancel unwanted timers or check if other timers are running. For instance, the motion timer should be canceled when manual operations occur, and the motion automtions can check if the manual override timer is or is not running.

Thank you. I’ve looked into this and implemented a boolean toggle, which I agree makes things simpler !

1 Like

Hi, please take the time to mark the post with the solution as the answer, you do that by selecting the three dots under the post:

image

Then select the check box:

image
By doing so:

  • this thread can be useful to other users as well (this thread comes up as solution when starting a thread which is similar to yours).
  • this prevents that someone else steps in trying to help

Thanks for giving back to the community! :+1:


= = = = = = = = = = = = = = = = = = =
To all of you & your loved ones: a happy, healthy & fun 2025!

Big thank you to all contributing to this wonderful piece of software! (& making it even better all the time)

HA Core 2025.12.1 on Proxmox LXC
ESPHome | Squeezebox | FritzBox Callmonitortor | Kodi | KNX | Mobile App | Z2M | Frigate | Powercalc | Reolink | Zoneminder