The miio integration in home-assistant is broken with the current version. These changes works as a override in my setup.