diff --git a/src/panels/config/automation/action/types/ha-automation-action-device_id.ts b/src/panels/config/automation/action/types/ha-automation-action-device_id.ts index 1a4565f870..5aa1cecbf2 100644 --- a/src/panels/config/automation/action/types/ha-automation-action-device_id.ts +++ b/src/panels/config/automation/action/types/ha-automation-action-device_id.ts @@ -107,6 +107,11 @@ export class HaDeviceAction extends LitElement { private _devicePicked(ev) { ev.stopPropagation(); this._deviceId = ev.target.value; + if (this._deviceId === undefined) { + fireEvent(this, "value-changed", { + value: HaDeviceAction.defaultConfig, + }); + } } private _deviceActionPicked(ev) { diff --git a/src/panels/config/automation/condition/types/ha-automation-condition-device.ts b/src/panels/config/automation/condition/types/ha-automation-condition-device.ts index 74277a4680..b158625876 100644 --- a/src/panels/config/automation/condition/types/ha-automation-condition-device.ts +++ b/src/panels/config/automation/condition/types/ha-automation-condition-device.ts @@ -111,6 +111,11 @@ export class HaDeviceCondition extends LitElement { private _devicePicked(ev) { ev.stopPropagation(); this._deviceId = ev.target.value; + if (this._deviceId === undefined) { + fireEvent(this, "value-changed", { + value: { ...HaDeviceCondition.defaultConfig, condition: "device" }, + }); + } } private _deviceConditionPicked(ev) { diff --git a/src/panels/config/automation/trigger/types/ha-automation-trigger-device.ts b/src/panels/config/automation/trigger/types/ha-automation-trigger-device.ts index 6dc84a01f2..43ddbeeb14 100644 --- a/src/panels/config/automation/trigger/types/ha-automation-trigger-device.ts +++ b/src/panels/config/automation/trigger/types/ha-automation-trigger-device.ts @@ -111,6 +111,11 @@ export class HaDeviceTrigger extends LitElement { private _devicePicked(ev) { ev.stopPropagation(); this._deviceId = ev.target.value; + if (this._deviceId === undefined) { + fireEvent(this, "value-changed", { + value: { ...HaDeviceTrigger.defaultConfig, platform: "device" }, + }); + } } private _deviceTriggerPicked(ev) { diff --git a/src/panels/developer-tools/state/developer-tools-state.js b/src/panels/developer-tools/state/developer-tools-state.js index 58a4d9ad58..e90e0365ce 100644 --- a/src/panels/developer-tools/state/developer-tools-state.js +++ b/src/panels/developer-tools/state/developer-tools-state.js @@ -400,7 +400,7 @@ class HaPanelDevState extends EventsMixin(LocalizeMixin(PolymerElement)) { } entityIdChanged() { - if (this._entityId === "") { + if (!this._entityId) { this._entity = undefined; this._state = ""; this._stateAttributes = "";