Automation to turn off brightness

Hi, I am new to HA and I would like to create an automation to turn off auto brightness on my phone. This is just an exercise for this type of automations. It should be quite easy but I can’t get it to work

this is the YAML file of my automation

automation:
  - alias: Turn off automatic screen brightness
    trigger: ...
    action:
      - service: notify.mobile_app_device_m2101k6g
        data:
          message: command_auto_screen_brightness
          data:
            command: turn_off
alias: test_auto_brightness

However, when I save it I get the error:
extra keys not allowed @ data automation

I found the solution by doing an automation in this way:

alias: turn_off_auto_brightness
description: This automation turns off auto brightness on XXXXXX's phone
trigger: []
condition: []
action:
  - device_id: 60c948fc4da393fa371da2b2ea5a9d5c
    domain: mobile_app
    type: notify
    message: command_auto_screen_brightness
    data:
      command: turn_off
mode: single