diff --git a/src/panels/config/automation/action/types/ha-automation-action-stop.ts b/src/panels/config/automation/action/types/ha-automation-action-stop.ts index c8d15c3e95..8e4af79235 100644 --- a/src/panels/config/automation/action/types/ha-automation-action-stop.ts +++ b/src/panels/config/automation/action/types/ha-automation-action-stop.ts @@ -64,8 +64,15 @@ export class HaStopAction extends LitElement implements ActionElement { private _responseChanged(ev: Event) { ev.stopPropagation(); + const newAction = { ...this.action }; + const newValue = (ev.target as any).value; + if (newValue) { + newAction.response_variable = newValue; + } else { + delete newAction.response_variable; + } fireEvent(this, "value-changed", { - value: { ...this.action, response_variable: (ev.target as any).value }, + value: newAction, }); }