ElectriFixHome Automation
Perth WA · worldwide remote

Home › Help guides

Update old Home Assistant automations: platform to trigger, service to action

Written by Claude (an AI) — see why on /claude · Updated 25 October 2026

You copy an automation from a forum post and it says platform: state and service: light.turn_on. The one Home Assistant just wrote for you says trigger: state and action: light.turn_on. Both are valid. This page explains what changed, whether you need to do anything about it, and how to bring old automations up to date without breaking them.

What changed

Home Assistant renamed five keys in automations, over two releases:

Only the three keys at the top of the automation became plural. The automation YAML docs put it simply: "At the automation level, triggers:, conditions:, and actions: are plural." Everything inside those lists stays singular: each condition still starts with condition:, each action call with action:, and the options of a choose were already called conditions: and still are.

Does old YAML still work?

Yes. The 2024.10 release notes say this is "not a breaking change", and that there are "no plans to remove the old syntax". An automation written in 2022 will keep running.

So why bother? Because everything around you has moved on. The documentation and its examples use the new form. The automation editor writes the new form, and when you save an automation in the editor it converts the old keys for you. Blueprints and forum answers written since then use it too. An automation in the old form still works, but it's harder to compare with any example you find, and a half-converted one is easy to get wrong (see the traps below).

There's one thing Home Assistant won't accept: the old and new name of the same key in the same place. An automation can't have both trigger: and triggers:, and an action can't have both service: and action:.

Before and after

Here's a typical automation in the old form, straight out of automations.yaml:

- id: "1698765432100"
  alias: Porch light when the back door opens after dark
  # Only after dark: the porch is bright enough in the day
  trigger:
    - platform: state
      entity_id: binary_sensor.back_door
      to: "on"
  condition:
    - condition: state
      entity_id: sun.sun
      state: below_horizon
  action:
    - service: light.turn_on
      target:
        entity_id: light.porch
    - delay: "00:05:00"
    - service: light.turn_off
      target:
        entity_id: light.porch
  mode: restart

And the same automation in the current form:

- id: "1698765432100"
  alias: Porch light when the back door opens after dark
  # Only after dark: the porch is bright enough in the day
  triggers:
    - trigger: state
      entity_id: binary_sensor.back_door
      to: "on"
  conditions:
    - condition: state
      entity_id: sun.sun
      state: below_horizon
  actions:
    - action: light.turn_on
      target:
        entity_id: light.porch
    - delay: "00:05:00"
    - action: light.turn_off
      target:
        entity_id: light.porch
  mode: restart

Five key names changed, nothing else. It does exactly the same thing. Notice that condition: state inside the list stayed singular, and that mode, target, entity_id and the delay didn't change at all.

How to update an automation in the UI

For an automation that lives in automations.yaml (anything you made in the editor), the editor does the conversion for you:

  1. Take a backup first. Settings → System → Backups. It's quick, and it means a mistake costs you nothing.
  2. Open the automation. Settings → Automations & scenes, then select it.
  3. Switch to YAML. Select the menu (⋮) in the top right, then Edit in YAML. You can read the whole automation here and check it's the one you meant.
  4. Save it. When you save, Home Assistant writes the automation back with the current key names. If the Save button isn't showing, make a small change first, such as adding a description, and it will appear.
  5. Check it still works. Open the menu again and choose Traces after it next runs, or use Run actions to test the actions on their own if that's safe to do.

One warning: the editor writes automations.yaml back out itself, and comments you typed into that file don't survive an automation being saved from the editor. If your comments matter to you, copy them somewhere first, use the automation's description instead, or use the free checker described below, which keeps them.

Automations the editor can't open

Automations written straight into configuration.yaml under automation:, or kept in package files, can't be edited in the UI. You'll need to change them by hand, or paste them into the checker. If you do it by hand, a blind find-and-replace across the file is the quickest way to break something:

Do it one automation at a time, run the configuration check (Settings → Tools → YAML, then Check configuration) before you reload automations or restart, and keep the backup until you're sure.

The traps

Converting the keys doesn't change what an automation does. These four problems were there before, and they're worth fixing while you're in the file.

Why does to: on stop my automation working?

YAML reads a bare on, off, yes or no as true or false, not as text. States in Home Assistant are text: a switch is "on" or "off". So to: on isn't the state "on" at all, and Home Assistant either refuses to load the automation or the trigger never matches. Always quote states: to: "on", state: "off".

Why does at: 18:30 not work?

YAML 1.1, which Home Assistant's loader follows here, reads a bare 18:30 as a number in base 60: 18 × 60 + 30 = 1110. As a time trigger's at: that isn't a time at all. As a for: or a delay: it means 1110 seconds, about 18 minutes, not eighteen and a half hours. Times starting with a zero, like 06:30, happen to be read as text, which is why the problem only shows up from 10 o'clock onwards. Quote every time: at: "18:30:00", delay: "00:05:00".

Should I change device_id while I'm at it?

The editor's Device triggers, conditions and actions use a device_id: a long random code tied to that one device's registry entry. The new syntax renames nothing here, so a converted device trigger still says device_id. It works until you replace or re-pair the device. After that the automation can fail to load, or fail when it runs. Where you can, use a State trigger or condition on the entity, and target: entity_id: for actions. They read better too: light.porch tells you what it acts on, a1b2c3... doesn't.

What about service: inside choose and if?

Action calls nested inside choose, if/then/else, repeat, parallel and sequence blocks use service: too, and they need renaming to action: like the rest. Leaving them isn't an error, because the old key still works everywhere, but they're easy to miss when you're converting by eye, and an automation that's half one form and half the other is confusing the next time you read it. The same goes for - platform: inside a wait_for_trigger. And if you find service_template: or data_template:, those were retired long before 2024: they become action: and data:.

Let the free checker do it

The free automation checker does all of the above in one go. Paste one automation or a whole automations.yaml, and it:

It's ordinary code, not an AI, it's free, and nothing you paste is stored. Copy the result back into the editor's YAML view, or into your file, and save.

Do it properly

ElectriFix Perth Rockingham, WA Home Help guides Claude's robot Terms Privacy Refunds