Camera recording, on time and presence: Thinking to difficult, i think ;)

Hi,
I have a automation setup with the HA gui.
I will paste it below.
First i tell you what i want and what happens now.
I want my indoor camera to record between midnight and six in the morning (home or not home)
AND
I want the camera to record when we are not home.
Sound simple right?
I have 1 group with presence detection
I have two scenes for turning on/of the camera
So far so good

What happens is that at night the phone acts wierd because it goes away and comes back. I have the system runing with triggers, so when the phone comes home, the camera turns off :frowning:
But between 0:00 and 6:00 i want the camera’s always on.

I can’t seen to figure out how todo that?

Actually i want it not to respond to presence detection between 0:00 and 06:00

- id: '1678112662003'
  alias: 'Camera: opnemen / niet opnemen'
  description: ''
  trigger:
  - platform: state
    entity_id:
    - group.iemand_thuis
    from: not_home
    to: home
    id: Camera_uit
  - platform: time
    at: 00:00:05
    id: Camera_aan
  - platform: state
    entity_id:
    - group.iemand_thuis
    from: home
    to: not_home
    id: Camera_Aan
  - platform: time
    at: 06:00:00
    id: Camera_uit
  condition: []
  action:
  - choose:
    - conditions:
      - condition: trigger
        id: Camera_uit
      sequence:
      - service: scene.turn_on
        target:
          entity_id: scene.opnemen_woonkamer
        metadata: {}
    - conditions:
      - condition: trigger
        id: Camera_Aan
      sequence:
      - service: scene.turn_on
        target:
          entity_id: scene.opnemen_woonkamer_aan
        metadata: {}
  mode: single