diff --git a/src/panels/lovelace/strategies/home/home-area-view-strategy.ts b/src/panels/lovelace/strategies/home/home-area-view-strategy.ts index 3fa3e94e1e..1c8a5372b4 100644 --- a/src/panels/lovelace/strategies/home/home-area-view-strategy.ts +++ b/src/panels/lovelace/strategies/home/home-area-view-strategy.ts @@ -168,9 +168,17 @@ export class HomeAreaViewStrategy extends ReactiveElement { const summaryEntities = Object.values(entitiesBySummary).flat(); + // Automations section + const automationFilter = generateEntityFilter(hass, { + domain: "automation", + entity_category: "none", + }); + const automations = areaEntities.filter(automationFilter); + // Rest of entities grouped by device const otherEntities = areaEntities.filter( - (entityId) => !summaryEntities.includes(entityId) + (entityId) => + !summaryEntities.includes(entityId) && !automations.includes(entityId) ); const entitiesByDevice: Record = {}; @@ -295,6 +303,21 @@ export class HomeAreaViewStrategy extends ReactiveElement { sections.push(...deviceSections); } + // Show automations last, if they exist + if (automations.length > 0) { + sections.push({ + type: "grid", + cards: [ + computeHeadingCard( + hass.localize("ui.panel.lovelace.strategy.home.automations"), + "mdi:robot", + "/config/automation/dashboard" + ), + ...automations.map(computeTileCard), + ], + }); + } + // Allow between 2 and 3 columns (the max should be set to define the width of the header) const maxColumns = clamp(sections.length, 2, 3); diff --git a/src/translations/en.json b/src/translations/en.json index f3de6f19be..639c83c779 100644 --- a/src/translations/en.json +++ b/src/translations/en.json @@ -6943,7 +6943,8 @@ "areas": "Areas", "other_areas": "Other areas", "unamed_device": "Unnamed device", - "others": "Others" + "others": "Others", + "automations": "Automations" }, "common_controls": { "not_loaded": "Usage Prediction integration is not loaded.",