Unable to save automations

I appear to be having issues trying to save automations. I’m new to creating home assistant automations. Each time I create one and hit save, I receive an error message in the home assistant log and the automation doesn’t seem to save.

Below is a copy of the error:

  • Invalid config for [automation]: expected dictionary. Got OrderedDict([(‘default_config’, {}), (‘tts’, [OrderedDict([(‘platform’, ‘google_translate’)])]), (‘group’, {}), (‘automation’, ‘include automations.yaml’), (‘script’, {}), (‘http’, OrderedDict([(‘ip_ban_enabled’, True), (‘login_attempts_threshold’, 3), (‘cors_allowed_origins’, [‘https://cast.home-assistant.io’]), (‘ssl_profile’, ‘modern’), (‘server_port’, 8123)]))]). (See ?, line ?).

Any help would be appreciated. I have tried troubleshooting and searching the forms, and I can’t seem to find a solution.

Could you show us the yaml for your automation. Be sure to use the code formatting in your message.

Please see attached:

- id: '1670126602739'

  alias: Camera Automation

  description: ''

  trigger:

  - platform: device

    device_id: b167284684be313992c29ef9e68aaceb

    domain: device_tracker

    entity_id: device_tracker.samsung

    type: leaves

    zone: zone.home

  condition: []

  action:

  - type: turn_on

    device_id: f3c1a2eea42075ea0b5abe675a503a18

    entity_id: switch.living_room_camera_power

    domain: switch

  - type: turn_on

    device_id: 42885047c075898016569b817a07ad1c

    entity_id: switch.lizard_room_camera_power

    domain: switch

  mode: single

- id: '1670127043459'

  alias: Camera Automation

  description: Automatically torn on webcams when leaving home zone

  trigger:

  - platform: device

    device_id: b167284684be313992c29ef9e68aaceb

    domain: device_tracker

    entity_id: device_tracker.samsung

    type: leaves

    zone: zone.home_2

  condition: []

  action:

  - type: turn_on

    device_id: f3c1a2eea42075ea0b5abe675a503a18

    entity_id: switch.living_room_camera_power

    domain: switch

  mode: single

The code you have provided seems to contain two automations.

Are you creating your automation using the automation editor UI or, are you editing the yaml file directly?

I’m using the automation editor UI. When I save the automation, it doesn’t show up on the automations list, and the logs notify me of the above error. I assume the reason why the automation is copied twice is because I’ve tried to create automation twice.