Message malformed

Hi, I’m trying to write my first blueprint. I checked the code in several YAML validators and they showed zero issues. After I create an automation based on my blueprint, I see an error:

Message malformed: extra keys not allowed @ data[‘action’][0][‘choose’][0][‘sequence’][1][‘if’]

This is my blueprint:

blueprint:
  name: Button with counter
  description: Increase counter by clicking the ON button, announce the status by clicking OFF.
  domain: automation
  input:
    button_entity:
      name: Button
      selector:
        device:
          integration: zha
          manufacturer: IKEA of Sweden
          model: TRADFRI on/off switch
    counter_entity:
      name: Counter
      selector:
        entity:
          domain: counter
    counter_max:
      name: Counter max
      description: Numeric input helper for counter max value.
      selector:
        entity:
          domain: input_number
    announce_bool:
      name: Announce on/off
      description: Boolean to controll announcements
      selector:
        entity:
          domain: input_boolean
    announce_time:
      name: Announce time
      selector:
        entity:
          domain: input_datetime
    announce_not_met:
      name: Max not met message
      selector:
        entity:
          domain: input_text
    announce_met:
      name: Max met message
      selector:
        entity:
          domain: input_text

trigger:
  - platform: device
    domain: zha
    device_id: !input button_entity
    type: remote_button_short_press
    subtype: turn_on
    id: counter_inc
  - platform: device
    domain: zha
    device_id: !input button_entity
    type: remote_button_short_press
    subtype: turn_off
    id: counter_info
  - platform: time
    at: !input announce_time
    id: counter_announce

action:
  choose:
    - alias: If incrementing
      conditions:
        - condition: trigger
          id: counter_inc
      sequence:
        - service: counter.increment
          target:
            entity_id: !input counter_entity
        - if:
          condition: numeric_state
          entity_id: !input counter_entity
          above: !input counter_max
          then:
            service: notify.alexa_media
            data:
              message: !input announce_met
              target: Alexa livingroom
    - alias: If info
      conditions:
        - condition: trigger
          id: counter_info
      sequence:
        if:
          condition: numeric_state
          entity_id: !input counter_entity
          below: !input counter_entity
          then:
            service: notify.alexa_media
            data:
              message: !input announce_not_met
              target: Alexa livingroom
          else:
            service: notify.alexa_media
            data:
              message: !input announce_met
              target: Alexa livingroom
    - alias: If announce
      conditions:
        - condition: trigger
          id: counter_announce
      sequence:
        if:
          - condition: numeric_state
            entity_id: !input counter_entity
            below: !input counter_entity
          - condition: state
            entity_id: !input announce_bool
            state: "on"
          - then:
            service: notify.alexa_media
            data:
              message: !input announce_not_met
              target: Alexa livingroom

The point of the blueprint is to use Ikea Tradfri dimmer as a double button to track if fish were fed or my family were given vitamins and also provide feedback via Alexa (Fish were fed / Fish are still hungry).

Could you, please, help me and point me in the right direction? Many thanks.

You have 3 ‘if:’ sequences. Each of the 3 are formatted differently. Which of them were

The error specifically says that the if has a syntax error in the second sequence(sequence [1]) of the first choose(choose[0]) of the first action(action[0]).

Sometimes the error tells you exactly where to look.

Thank you very much.