Xiaomi sensors state issues

Hi, first of all sorry for my english. Im having problems with my door and motion sensors. When the sensor is on (door opened or motion sensor activated) in the system start, it shows “state: on” in the dev-state, when the door is closed or the motion sensor don’t detect anything, it changes to off.

The problem is that it never changes the state back to “on” when I open the door. From the Mi Home APP it shows the changes well in the logs.

My other sensors (temperature and humidity) update just well in the home assistant.