diff --git a/src/panels/config/automation/add-automation-element/ha-automation-add-from-target.ts b/src/panels/config/automation/add-automation-element/ha-automation-add-from-target.ts index 9986f2f8ce..f7fb75a3b6 100644 --- a/src/panels/config/automation/add-automation-element/ha-automation-add-from-target.ts +++ b/src/panels/config/automation/add-automation-element/ha-automation-add-from-target.ts @@ -911,6 +911,10 @@ export default class HaAutomationAddFromTarget extends LitElement { const services: Record = {}; unassignedDevices.forEach(({ id: deviceId, entry_type }) => { + const device = this.devices[deviceId]; + if (!device || device.disabled_by) { + return; + } const deviceEntry = { open: false, entities: @@ -1012,6 +1016,10 @@ export default class HaAutomationAddFromTarget extends LitElement { const devices: Record = {}; referenced_devices.forEach(({ id: deviceId }) => { + const device = this.devices[deviceId]; + if (!device || device.disabled_by) { + return; + } devices[deviceId] = { open: false, entities: