Automation - YAMLException: unacceptable kind of an object to dump [object Undefined]

Hi,

I have a problem with on of my automation. The automation works fine without any error and I can also edit it in the UI. But when I click on “edit YAML code” I get the following error:

There was an error converting to YAML: YAMLException: unacceptable kind of an object to dump [object Undefined]

The automation is quite simple and it´s a trigger for actionable notifications. This is the code:

- id: '1613935004196'
  alias: Notification Action - Close Cover Back Door
  description: ''
  trigger:
    platform: event
    event_type: mobile_app_notification_action
    event_data:
      action: terrase_tuer_close
  action:
    service: cover.close_cover
    target:
      entity_id: cover.fibaro_system_fgrm222_roller_shutter_controller_2_level_6

How can I solve this?

Try to use double quote for alias:

  alias: "Notification Action - Close Cover Back Door"

Just tried, but same result.
Also my other automations, without this problem, does not have double quotes for the alias.

Ok, solved it.
I changed the action from this:

  action:
    service: cover.close_cover
    target:
      entity_id: cover.fibaro_system_fgrm222_roller_shutter_controller_2_level_6

to this:

  action:
    service: cover.close_cover
    data: {}
    entity_id: cover.fibaro_system_fgrm222_roller_shutter_controller_2_level_6