diff --git a/src/panels/config/automation/automation-rename-dialog/dialog-automation-rename.ts b/src/panels/config/automation/automation-rename-dialog/dialog-automation-rename.ts
index ffcc401094..e97976e3f7 100644
--- a/src/panels/config/automation/automation-rename-dialog/dialog-automation-rename.ts
+++ b/src/panels/config/automation/automation-rename-dialog/dialog-automation-rename.ts
@@ -8,6 +8,7 @@ import { haStyle, haStyleDialog } from "../../../../resources/styles";
import type { HomeAssistant } from "../../../../types";
import type { AutomationRenameDialog } from "./show-dialog-automation-rename";
import "../../../../components/ha-textarea";
+import "../../../../components/ha-alert";
import "../../../../components/ha-textfield";
@customElement("ha-dialog-automation-rename")
@@ -16,6 +17,8 @@ class DialogAutomationRename extends LitElement implements HassDialog {
@state() private _opened = false;
+ @state() private _error?: string;
+
private _params!: AutomationRenameDialog;
private _newName?: string;
@@ -25,7 +28,9 @@ class DialogAutomationRename extends LitElement implements HassDialog {
public showDialog(params: AutomationRenameDialog): void {
this._opened = true;
this._params = params;
- this._newName = params.config.alias || "";
+ this._newName =
+ params.config.alias ||
+ this.hass.localize("ui.panel.config.automation.editor.default_name");
this._newDescription = params.config.description || "";
}
@@ -49,9 +54,20 @@ class DialogAutomationRename extends LitElement implements HassDialog {
@closed=${this.closeDialog}
.heading=${createCloseHeading(
this.hass,
- this.hass.localize("ui.panel.config.automation.editor.rename")
+ this.hass.localize(
+ this._params.config.alias
+ ? "ui.panel.config.automation.editor.rename"
+ : "ui.panel.config.automation.editor.save"
+ )
)}
>
+ ${this._error
+ ? html`