diff --git a/homeassistant/components/upnp/sensor.py b/homeassistant/components/upnp/sensor.py index 06e4a86401f..81fd5c025b9 100644 --- a/homeassistant/components/upnp/sensor.py +++ b/homeassistant/components/upnp/sensor.py @@ -126,6 +126,9 @@ class RawUPnPIGDSensor(UpnpSensor): @property def state(self) -> str: """Return the state of the device.""" + if self._state is None: + return None + return format(self._state, "d") @property