diff --git a/src/data/logbook.ts b/src/data/logbook.ts index ac6f342f7b..c1ff44b6fe 100644 --- a/src/data/logbook.ts +++ b/src/data/logbook.ts @@ -7,8 +7,12 @@ export interface LogbookEntry { entity_id?: string; domain: string; context_user_id?: string; + context_event_type?: string; + context_domain?: string; + context_service?: string; context_entity_id?: string; context_entity_id_name?: string; + context_name?: string; } const DATA_CACHE: { diff --git a/src/panels/logbook/ha-logbook.ts b/src/panels/logbook/ha-logbook.ts index d95ee7e156..831a394e95 100644 --- a/src/panels/logbook/ha-logbook.ts +++ b/src/panels/logbook/ha-logbook.ts @@ -118,18 +118,26 @@ class HaLogbook extends LitElement { ? ` (${item_username})` : ``} - ${!item.context_entity_id + ${!item.context_event_type ? "" - : html` - by + : item.context_event_type == "service_call" + ? // Service Call + html` by service ${item.context_domain}.${item.context_service}` + : item.context_entity_id == item.entity_id + ? // HomeKit or something that self references + html` by + ${item.context_name + ? item.context_name + : item.context_event_type}` + : // Another entity such as an automation or script + html` by ${item.context_entity_id_name} - `} + >`}