diff --git a/src/data/logbook.ts b/src/data/logbook.ts index 5d66e4ce14..74d2231f4a 100644 --- a/src/data/logbook.ts +++ b/src/data/logbook.ts @@ -44,11 +44,12 @@ export const getLogbookData = async ( ); for (const entry of logbookData) { - if (entry.state) { + const stateObj = hass!.states[entry.entity_id!]; + if (entry.state && stateObj) { entry.message = getLogbookMessage( hass, entry.state, - hass!.states[entry.entity_id!], + stateObj, computeDomain(entry.entity_id!) ); }