I found there is a illumination sensor inside the Xiaomi gateway, and I’m very surprised by it. When I managed to use this sensor have a automation project, here is the trouble come. This sensor’s data update period very very very slow, even some time it will not update the data to HA until I turn on/off or switch on/off the light/switch. So is there any ways to make it update faster like update the data in second.
(Btw, my temporary solution is set up a automation project, which is turn on and off the nightlights, so that the sensor data can update rapidly, but I absolutely can’t use my nightlight…)
It’s known issue. I gave up and create some automation on the gateway itself. What is interesting, when I did it, the ilumination sensor start to working OK. Some people try something like turn it on with 0 brightness and just change the brightness to get “really” turn on. Looks like the gateway go to some sleep mode and not sending illumination attribute in real time.
So, what automation did you created?
At mihome app at the gateway directly (choose the gateway and there is an option to add an automation) to turn on light when is dark and motion sensor triggered.