diff --git a/homeassistant/components/mobile_app/sensor.py b/homeassistant/components/mobile_app/sensor.py index ef7dd122496..d802dc92b52 100644 --- a/homeassistant/components/mobile_app/sensor.py +++ b/homeassistant/components/mobile_app/sensor.py @@ -110,6 +110,9 @@ class MobileAppSensor(MobileAppEntity, RestoreSensor): SensorDeviceClass.DATE, SensorDeviceClass.TIMESTAMP, ) + # Only parse strings: if the sensor's state is restored, the state is a + # native date or datetime, not str + and isinstance(state, str) and (timestamp := dt_util.parse_datetime(state)) is not None ): if self.device_class == SensorDeviceClass.DATE: