diff --git a/homeassistant/components/logbook/__init__.py b/homeassistant/components/logbook/__init__.py index 8d216b5c6f0..de0f901be3b 100644 --- a/homeassistant/components/logbook/__init__.py +++ b/homeassistant/components/logbook/__init__.py @@ -647,7 +647,7 @@ def _augment_data_with_context( return attr_entity_id = event_data.get(ATTR_ENTITY_ID) - if not attr_entity_id or ( + if not isinstance(attr_entity_id, str) or ( event_type in SCRIPT_AUTOMATION_EVENTS and attr_entity_id == entity_id ): return