diff --git a/homeassistant/components/tahoma/__init__.py b/homeassistant/components/tahoma/__init__.py index f3dd51bed96..1a6b326f4e5 100644 --- a/homeassistant/components/tahoma/__init__.py +++ b/homeassistant/components/tahoma/__init__.py @@ -66,6 +66,8 @@ TAHOMA_TYPES = { "rts:RollerShutterRTSComponent": "cover", "rts:OnOffRTSComponent": "switch", "rts:VenetianBlindRTSComponent": "cover", + "somfythermostat:SomfyThermostatTemperatureSensor": "sensor", + "somfythermostat:SomfyThermostatHumiditySensor": "sensor", } diff --git a/homeassistant/components/tahoma/sensor.py b/homeassistant/components/tahoma/sensor.py index 20364a243b3..8ceb07e1a9f 100644 --- a/homeassistant/components/tahoma/sensor.py +++ b/homeassistant/components/tahoma/sensor.py @@ -56,6 +56,13 @@ class TahomaSensor(TahomaDevice, Entity): return None if self.tahoma_device.type == "rtds:RTDSMotionSensor": return None + if ( + self.tahoma_device.type + == "somfythermostat:SomfyThermostatTemperatureSensor" + ): + return TEMP_CELSIUS + if self.tahoma_device.type == "somfythermostat:SomfyThermostatHumiditySensor": + return UNIT_PERCENTAGE def update(self): """Update the state.""" @@ -86,6 +93,19 @@ class TahomaSensor(TahomaDevice, Entity): float(self.tahoma_device.active_states["core:TemperatureState"]), 1 ) self._available = True + if ( + self.tahoma_device.type + == "somfythermostat:SomfyThermostatTemperatureSensor" + ): + self.current_value = float( + f"{self.tahoma_device.active_states['core:TemperatureState']:.2f}" + ) + self._available = True + if self.tahoma_device.type == "somfythermostat:SomfyThermostatHumiditySensor": + self.current_value = float( + f"{self.tahoma_device.active_states['core:RelativeHumidityState']:.2f}" + ) + self._available = True _LOGGER.debug("Update %s, value: %d", self._name, self.current_value)