Multiple Triggers Need To Be True

So I looked around a bit and having a problem with Multiple Triggers having to be true.
I know that triggers operate under the or condition. If I want both triggers to be true before looking at conditions, is this the way to do it?

- alias: Bed Time
  initial_state: true
  trigger:
    - platform: state
      entity_id: sensor_a
      to: 'on'
      from: 'off'
      for:
        minutes: 2
    - platform: state
      entity_id: sensor_b
      to: 'on'
      from: 'off'
      for:
        minutes: 2
  condition:
      condition: and
      conditions:
        - condition: sun
          after: sunset
        - condition: time
          before: '23:59:00'
  action:
    - service: light.turn_off
      data:
        entity_id:
          - group.all_lights

Use a template trigger: https://www.home-assistant.io/docs/automation/trigger/#template-trigger

This should be easier once the change I made to add the for option to the template trigger is released. See PR #24330. If things go normally it will be in the 0.95.x release.

With that change you’ll be able to do this:

  trigger:
    platform: template
    value_template: >
      {{ is_state('sensor.a', 'on') and is_state('sensor.b', 'on') }}
    for:
      minutes: 2

EDIT: It appears to be in 0.95.0b0.

Thanks! Do you know when the expected release date is for this version?

0.95.0b0 is available today. I think in general betas last a week and then the x.y.0 release is made, but I guess it depends how the beta goes. That’s not something I’m really involved with.