diff --git a/homeassistant/components/sleepiq/__init__.py b/homeassistant/components/sleepiq/__init__.py index 60614fcf97f..f6ba5a0393f 100644 --- a/homeassistant/components/sleepiq/__init__.py +++ b/homeassistant/components/sleepiq/__init__.py @@ -99,6 +99,11 @@ class SleepIQSensor(Entity): self.bed.name, self.side.sleeper.first_name, self._name ) + @property + def unique_id(self): + """Return a unique ID for the bed.""" + return f"{self._bed_id}-{self._side}-{self.type}" + def update(self): """Get the latest data from SleepIQ and updates the states.""" # Call the API for new sleepiq data. Each sensor will re-trigger this diff --git a/homeassistant/components/sleepiq/binary_sensor.py b/homeassistant/components/sleepiq/binary_sensor.py index f901851c0b5..f821a569254 100644 --- a/homeassistant/components/sleepiq/binary_sensor.py +++ b/homeassistant/components/sleepiq/binary_sensor.py @@ -41,7 +41,8 @@ class IsInBedBinarySensor(SleepIQSensor, BinarySensorEntity): """Initialize the sensor.""" super().__init__(sleepiq_data, bed_id, side) self._state = None - self._name = SENSOR_TYPES[IS_IN_BED] + self.type = IS_IN_BED + self._name = SENSOR_TYPES[self.type] self.update() @property