Nested conditions in automation

HI,
I have prepared following script to automate my humidifier in a room.

- alias: turn on humidifier when humidity lower than 45
  trigger:
    - platform: numeric_state
      entity_id: sensor.humidity_158d0001100418
      below: 45
      value_template: '{{ state.state }}'
  condition:
    condition: and
    conditions: 
      - condition: or
        conditions:
          - condition: time
            after: '15:00:00'
            before: '07:00:00'
            weekday:
              - mon
              - tue
              - wed
              - thu
              - fri
          - condition: time
            weekday:
              - sat
              - sun
      - condition: state
        entity_id: binary_sensor.door_window_sensor_158d000130e59b
        state: 'off'
  action:
    service: switch.turn_on
    entity_id: switch.plug_158d00012a0d00

The goal is to switch on a plug once humidity fals below 45% and the window is closed and (it is a weekend or weekday after 3pm and before 7am)

There is no error reported by HA yet the rule does not trigger. May I ask for review of the script if there is anything I should fix? I think (but not certain) that once humidity on a sensor goes from above to below on a state update, the rule triggers. When I restart HA and humidity is below 45, the rule also triggers however no action when running for some time.

I am using Xiaomi windowr open sensor, humidity sensor and a plug.
Thank you for help

Just a recommendation but if your conditions get this compley you might consider either switching to AppDaemon or using one template condition.

~Cheers

What do you mean? Could you please expand? I am quite new to HA

With AppDaemon you can use “regular” python conditions because you are practically writing an app. With template conditions you have the comfort of jinja2 templating engine. Your conditions above would look like this with a template:

condition:
  condition: template
  value_template: '{{ ((now().hour <= 7 or now().hour >= 15) or (now().weekday() == 5 or now().weekday() == 6)) and states.binary_sensor.door_window_sensor_158d000130e59b == 'off' }}'

Which for me is easier to read ^^

~Cheers