Kitchen Lighting Automation: Double Tap and Motion Override

I’ve been diving into home automation lately, and I’m trying to perfect my kitchen lighting setup. My goal is to make the system as user-friendly as possible, especially since my wife spends a lot of time cooking. Here’s what I’ve been working on:

The Setup:
I’ve installed motion sensors and a smart button in the kitchen. The main lights are set to turn on only with a press of the button, which I’ve linked to an automation in Home Assistant. The idea is that when she presses the button once, the lights come on at full brightness. If she presses it again, they should turn off. Simple enough, right?

The Issue:
While the lights do come on when she presses the button, the double press isn’t working as intended to turn them off. Instead, it just toggles the state, which isn’t what we want. Plus, the motion sensors aren’t picking up small movements, like when she’s chopping vegetables or moving around the kitchen. This means the lights often turn off too soon or not at all when she’s actively cooking.

The Desired Outcome:
What I really want is for the button to act as a cooking mode override. When pressed once, the lights go to full brightness and disable the motion sensor timeout for 30 minutes. If pressed twice, the lights should turn off. Additionally, I’d like this override to apply to the under-cabinet lights as well, setting them to daylight mode for optimal visibility.

The Challenge:
The main challenge here is getting the button to recognize single and double taps distinctly and then triggering the appropriate automations. I’ve tried setting up different scenes and using templates in my configuration.yaml, but I’m running into issues with the button not responding as expected.

What I’ve Tried So Far:

  1. Scene Automation: I’ve created scenes for ‘Cooking Mode’ and ‘Normal Mode’, but linking them to the button presses hasn’t been straightforward.
  2. Template Switches: I attempted to use template switches to handle the state changes, but the logic isn’t quite there yet.
  3. Custom Scripts: I’ve written some custom scripts to handle the button presses and override the motion sensors, but they’re not entirely reliable.

Seeking Advice:
If anyone has experience with setting up similar automations, I’d love to hear your tips! Specifically, how do you handle different button presses and ensure that the system overrides motion sensors temporarily? Also, any advice on making the system self-heal after the override period would be greatly appreciated.

I’m really excited about the potential of this setup, and I’m hoping to get it working smoothly. Let me know if you’ve tackled something similar or have any suggestions to make this a reality!

Cheers,
[Your Name]