Automation to switch automation

Hi there, I’m stucked with a little problem:
I have a mmWave sensor in my bedroom to switch on light when I enter the room. I also want the light on, when I’m in bed and watch TV (that’s why I use mmWave and not PIR). But when I want to sleep, I turn off the light, move around and light is on again. :sweat_smile: So when I turn off the light by voice, the automation to turn on the light by movement or presence, should turn off. Best would be, even my dog can walk around without light going on.
But… When I wake up in the morning and leave the bed, it should turn on again. I was thinking about special zone (ld2450) to turn on light in morning and restart automation, when I go into bathroom, light off, back in bedroom, light on…

I’m kinda confused in my head how to do this and hope someone can point me into right direction how to turn on and off my presence detection automation, based on switching off light manually and back on. I have a condition with time for now, but I don’t like it because I often go to bed more early or later…

alias: Wohnzimmer Präsens erkannt
description: ""
trigger:
  - type: turned_on
    platform: device
    device_id: 8e6a201f57b513faf2c8253cd33a5e61
    entity_id: 98e990edf3740019eb656e8ee9ecbeed
    domain: binary_sensor
condition:
  - condition: numeric_state
    entity_id: sensor.esp32_mic_speaker_illuminance
    below: 11
  - condition: time
    after: "08:00:00"
    weekday:
      - sat
      - fri
      - thu
      - sun
      - wed
      - tue
      - mon
    before: "23:30:00"
action:
  - service: light.turn_on
    target:
      entity_id: light.fernseher
    data: {}
  - service: light.turn_on
    target:
      entity_id: light.couch
    metadata: {}
    data: {}
mode: single

I have the best success when I break down a complicated automation into simple building blocks.

Fundamentally every light automation may have

a) triggers - what triggers the turning on - mm wave sensor
b) occupancy - what keeps it on - mm wave sensor, tv is on
c) holds - not needed for your use case - I usually use a double tap on the switch to have it stay on until it’s manually turned off.
d) inhibits - I’ve used my voice to turn it off and it’s not morning, luminance too high

Try to create binary sensor templates where needed for each of the triggers, inhibits, etc. Once those a working it’s easy to create the automation. And you can look at history chart to see why stuff is happening or not.