Light Automation with Motion and Disabling of Automation

Hello,

I’m new to Home Assistant (but not new to home automation) and I’d like to adapt the light functionalities of my current home automation system to Home Assistant:

  • Each room has a lamp and a connected switch, some of them also have motion detectors.
  • The switch turns the room’s lamp on/off (so far, so good).
  • If there’s a motion detector and it detects movement, it turns on the room’s lamp (nothing out of the ordinary here).
  • However, the duration for which the light stays on after motion is detected varies for each room.
  • Most importantly (and this is crucial), if the switch is pressed to turn off the light and then pressed to turn back on the light, it disables the motion detection (and thus the automatic turning off of the lamp) until the next manual turn off.

Is this possible in Home Assistant? And more importantly, how can I achieve this: using simple automations, NodeRed? This feature will determine whether I switch to Home Assistant or not.

Ideally, I’d like to avoid managing a dozen individual automations. In my current setup, the timing data is stored in the entities of the switches, and I only have two automations:

  • One triggered by each motion detection, which identifies the room from the motion sensor and turns on the lamp for that room if it’s in automatic mode and not manual mode.
  • One triggered by each switch press to manage the transition between manual and automatic mode for the room’s lighting controlled by that switch.

Thank you in advance for your help. Looking forward to your responses!