Help with time condition inside an action

Would some one help with this automation, the condition is invalid.

# Doorbell
- alias: Doorbell pressed
  initial_state: on
  mode: restart
  trigger:
    platform: event
    event_type: xiaomi_aqara.click
    event_data:
      entity_id: binary_sensor.switch
      click_type: single
  action:
  - service: notify.alexa_media
    data:
      message: Someone just pressed the doorbell
      data:
        type: announce
      target: 
        - media_player.kitchen
        - media_player.living_room

# Why is this part not valid
  - condition:
      condition: time
      after: "08:00:00"
      before: "17:00:00" 
# Why is this part not valid
     
  - service: notify.alexa_media
    data:
      message: Someone just pressed the doorbell
      data:
        type: announce
      target: 
        - media_player.bedroom_2

basically i dont want the announcement to bedroom at night time

I think it should just be:

  - condition: time
    after: '08:00:00'
    before: '17:00:00'

not the double condition

2 Likes

Thanks!! For some reason I thought I already try that…