## Introduction
The Xiaomi Home Assistant is a smart home system designed to integrate and control various devices within a home. However, a user has reported an issue where two control devices are available for the same switch, leading to desynchronization of their states. This article aims to describe the problem, provide steps to reproduce it, and propose potential solutions.
## Problem Description
The problem occurs when two control devices, a switch and a button, are used to control the same device. When the switch is turned on and the button is pressed, the device turns off, but the switch's state remains as 'on'. This creates a discrepancy between the two control devices, causing confusion and potentially leading to incorrect device operation.
## Steps to Reproduce
To reproduce the issue, follow these steps:
1. Open the Xiaomi Home app and navigate to the device control page.
2. Identify the device with two control devices (switch and button).
3. Turn on the device using the switch.
4. Press the button to turn off the device.
5. Observe the switch's state, which should be 'off' but remains as 'on'.
## Expected Behavior
The expected behavior is for the switch's state to update to 'off' when the device is turned off using the button.
## System Information
The issue was reproduced on January 3, 2025, at 10:30, using the following system configuration:
* Home Assistant Core Version: 2024.12.3
* Home Assistant Operation System Version: Docker
* Xiaomi Home Integration Version: v0.4.0
* Log Timezone: Asia/Shanghai
## Conclusion
The desynchronization of control device states is a significant issue that needs to be addressed to ensure the reliability and usability of the Xiaomi Home Assistant. Further investigation is required to identify the root cause of the problem and develop a solution to resolve it. The community is encouraged to provide feedback and suggestions to help resolve this issue and improve the overall performance of the Xiaomi Home Assistant.