Conditional action within automation

I’ve been working on this automation for a while and just can’t seem to get it right so would appreciate any help please.

The automation closes my window blind in the evening. At the moment it asks for the windows to be closed regardless whether they are open or closed so I want to make the speech part conditional. It should only speak if one or both windows are open so that we can close the windows before the blind closes. I have added the section for the condition but can’t figure out what I’m doing wrong with the logic.

- alias: 'Lounge Blind - close at night'
  initial_state: true
  trigger:
    
    platform: numeric_state
    entity_id: sun.sun
    value_template: '{{ state.attributes.elevation }}'
    below: 0    

  action:
#  The  service: tts.google_say routine should run only if one or both
#  of the windows are open. The rest of the automation should run
#  every time. 

  - condition: state
    entity_id:
      - binary_sensor.lounge_window_left
      - binary_sensor.lounge_window_right
    state: 'open'  

  - service: tts.google_say
    entity_id: media_player.chromecast_hass
    data:
      message: 'Please close the windows.'

#  End of conditional part - run rest of automation every time

  - delay: '00:00:30' 

  - service: cover.close_cover
    data:
        entity_id:
          - cover.lounge_blind

I don’t think you can run an action within a a condition. Simplest way would be to run two automations, one to say “shut the windows” if the windows are open. Second one, say a minute later, will close the blind.

You can add a condition to an action, just wondering what’s not working? Is the state of the sensor correct open/close or on/off?

Thanks for the responses. The sensors are working OK, but I am getting an error when I check it:

Invalid config for [automation]: [condition] is an invalid option for [automation]. Check: automation->action->0->condition. (See /config/configuration.yaml, line 27). Please check the docs at https://home-assistant.io/components/automation/

And it is preventing automation from being set up:
error

I think your indentation is off but reading the docs I do not think it’s going to work anyway;

If the result of a condition is false, the action will stop there so any service calls after that condition will not be executed.

So the action will stop if the windows are open completely. @nickrout suggestion is probably the easiest.

Thanks very much, both, I will do as you recommend!