I had a similar problem.
You can't prevent it from going into sleep mode.
but...
According to recommendations I found online,
I made several changes to the sensor.
Goto Internet & Security >> Advanced - Developer Settings
Check the box of "Enable CoIoT"
Set the "CoIoT peer:" to <HA-IP:5683> (Exp. 192.168.1.107:5683)
Goto Sensor Settings >> Temperature threshold
Set "Temperature threshold" to 1
Sensor Settings >> Humidity threshold
Set "Humidity threshold" to 2
The above settings causes the sensor to update the HA more often effectively.