diff --git a/custom_components/xiaomi_home/binary_sensor.py b/custom_components/xiaomi_home/binary_sensor.py index 9ec6e83..fd31dda 100644 --- a/custom_components/xiaomi_home/binary_sensor.py +++ b/custom_components/xiaomi_home/binary_sensor.py @@ -88,4 +88,7 @@ class BinarySensor(MIoTPropertyEntity, BinarySensorEntity): @property def is_on(self) -> bool: """On/Off state. True if the binary sensor is on, False otherwise.""" + """If it is a door and windows sensor, revert the value.""" + if self._attr_device_class == 'door': + return not (self._value is True) return self._value is True