diff --git a/homeassistant/components/automation/state.py b/homeassistant/components/automation/state.py index 9c12a37f9b8..90a8f2adce4 100644 --- a/homeassistant/components/automation/state.py +++ b/homeassistant/components/automation/state.py @@ -80,7 +80,8 @@ def async_trigger(hass, config, action): return # If only state attributes changed, ignore this event - if from_s.last_changed == to_s.last_changed: + if (from_s is not None and to_s is not None and + from_s.last_changed == to_s.last_changed): return @callback