# \[APP\]\[Pro\] Xiaomi Mi Home App

**URL:** <https://community.homey.app/t/app-pro-xiaomi-mi-home-app/118>\
**Category:** Apps\
**Tags:** app, homey-pro\
**Created:** [August 22, 2018, 11:14am UTC](https://community.homey.app/t/app-pro-xiaomi-mi-home-app/118 "2018-08-22T11:14:52Z")\
**Posts on this page:** 20\
**Page:** 66

<div class="post-metadata">

**Author:** ![Eternity](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/eternity/32/102113_2.png) [@Eternity](https://community.homey.app/u/Eternity)\
**Post date:** [June 26, 2023, 8:38am UTC](https://community.homey.app/t/app-pro-xiaomi-mi-home-app/118/1334 "2023-06-26T08:38:58Z")

</div>

Seems the crashing of the App happens on a daily bases:

 ![Schermafbeelding 2023-06-26 om 10.34.44](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/3/a/3a36fccb96f47eb726ca08c42dbf79a2f02613d1.jpeg)

After a restart of the App, all is fine again.

Unfortunately, I can’t sent a diagnostic code (Android beta App crashes when opening the App settings). The restart solves it, so no real problem for me. Just wanted to inform you @Phuturist

---

<div class="post-metadata">

**Author:** ![Jan\_Peeters](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/jan_peeters/32/86660_2.png) [@Jan\_Peeters](https://community.homey.app/u/Jan_Peeters)\
**Post date:** [June 26, 2023, 11:34am UTC](https://community.homey.app/t/app-pro-xiaomi-mi-home-app/118/1335 "2023-06-26T11:34:32Z")

</div>

Same here. People will blame you for not having a … whatever.  
I handle this situation with a flow. Twice a day, the app is restarted. Once at 11h55 and once at 23h55.  
Problem solved. Mostly.

---

<div class="post-metadata">

**Author:** ![Phuturist](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/phuturist/32/49_2.png) [@Phuturist](https://community.homey.app/u/Phuturist)\
**Post date:** [June 26, 2023, 5:38pm UTC](https://community.homey.app/t/app-pro-xiaomi-mi-home-app/118/1336 "2023-06-26T17:38:54Z")

</div>

> [@Eternity](#):
>
> Unfortunately, I can’t sent a diagnostic code (Android beta App crashes when opening the App settings).

Without any information it’s hard to troubleshoot this. The crashing app settings is a known issue and I assume is being worked on by Athom. Do send a diagnostic report when it works again. In the mean time, could you check the apps memory usage from Insights to see if it increases over time. This would indicate a memory leak.

---

<div class="post-metadata">

**Author:** ![Jan\_Peeters](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/jan_peeters/32/86660_2.png) [@Jan\_Peeters](https://community.homey.app/u/Jan_Peeters)\
**Post date:** [June 26, 2023, 6:28pm UTC](https://community.homey.app/t/app-pro-xiaomi-mi-home-app/118/1337 "2023-06-26T18:28:51Z")

</div>

> [@Phuturist](#):
>
> e apps memory usage from Insights to see if it increases over time. This would indicate a memory leak.

I really think you shouldn’t bother about this. I believe this to be a zigbee-issue.

---

<div class="post-metadata">

**Author:** ![Eternity](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/eternity/32/102113_2.png) [@Eternity](https://community.homey.app/u/Eternity)\
**Post date:** [June 27, 2023, 8:21am UTC](https://community.homey.app/t/app-pro-xiaomi-mi-home-app/118/1338 "2023-06-27T08:21:21Z")

</div>

I have the App restart a couple of times a day. I do see the memory usage increase:

 ![Schermafbeelding 2023-06-27 om 10.20.08](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/d/b/db466418821f3eb46b5f77574067ef6b3c85cce8.png)

I will disable the ‘restart flow’ and see what happens!

PS  
This is the graph of this week…

 ![Schermafbeelding 2023-06-27 om 10.23.25](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/a/0/a020b9028aa0d6c48b616b9dd0a7de5284c5c33d.png)

---

<div class="post-metadata">

**Author:** ![Phuturist](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/phuturist/32/49_2.png) [@Phuturist](https://community.homey.app/u/Phuturist)\
**Post date:** [June 27, 2023, 12:24pm UTC](https://community.homey.app/t/app-pro-xiaomi-mi-home-app/118/1339 "2023-06-27T12:24:43Z")

</div>

That definitely looks like a memory leak. These are really hard to fix.

As @Jan_Peeters suggests it’s probably somewhere in the libraries used to connect the ZigBee devices and it would explain why some users are affected by this. These libraries are mostly not maintained anymore.

Could you list the devices you have connected through the Xiaomi Mi Home app. If we can see a pattern among the users affected perhaps that helps a bit

---

<div class="post-metadata">

**Author:** ![chiroptera](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/chiroptera/32/47346_2.png) [@chiroptera](https://community.homey.app/u/chiroptera)\
**Post date:** [June 27, 2023, 5:40pm UTC](https://community.homey.app/t/app-pro-xiaomi-mi-home-app/118/1340 "2023-06-27T17:40:34Z")

</div>

> [@Phuturist](#):
>
> There are no code related errors in the log.

I have temporary moved the fan close to the WiFi router, but this does not change anything. Controlling the fan by the Xiaomi Home App works without problems. Do you have any other ideas or suggestions?

---

<div class="post-metadata">

**Author:** ![Phuturist](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/phuturist/32/49_2.png) [@Phuturist](https://community.homey.app/u/Phuturist)\
**Post date:** [June 27, 2023, 6:57pm UTC](https://community.homey.app/t/app-pro-xiaomi-mi-home-app/118/1341 "2023-06-27T18:57:23Z")

</div>

Nope sorry, not a clue. As there is no official API some none descriptive error like user ack timeout could be anything really. Do some googling and you’ll see more weird issues with Xiaomi devices using this non official way of integration.

---

<div class="post-metadata">

**Author:** ![Eternity](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/eternity/32/102113_2.png) [@Eternity](https://community.homey.app/u/Eternity)\
**Post date:** [June 28, 2023, 6:35am UTC](https://community.homey.app/t/app-pro-xiaomi-mi-home-app/118/1342 "2023-06-28T06:35:46Z")

</div>

Yes, I see memory use increase:

 ![1000032376](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/f/f/ffafe92d213f5e21b9e0f36dcfd87346aab8218e.png)

These are the devices I have included to your App:

 ![1000032377](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/0/2/02578d681a6e712000b945a0e2a4c0cb27a64eee.jpeg)

Let me know if you need more information! Happy to help.

---

<div class="post-metadata">

**Author:** ![Phuturist](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/phuturist/32/49_2.png) [@Phuturist](https://community.homey.app/u/Phuturist)\
**Post date:** [June 28, 2023, 8:20am UTC](https://community.homey.app/t/app-pro-xiaomi-mi-home-app/118/1343 "2023-06-28T08:20:47Z")

</div>

Can you also send me a diagnostic report after the app has been running for some time (preferably shortly before it crashes which should be around 80Mb of men usage).

---

<div class="post-metadata">

**Author:** ![Eternity](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/eternity/32/102113_2.png) [@Eternity](https://community.homey.app/u/Eternity)\
**Post date:** [June 28, 2023, 3:28pm UTC](https://community.homey.app/t/app-pro-xiaomi-mi-home-app/118/1344 "2023-06-28T15:28:58Z")

</div>

![1000032420](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/e/e/ee0b08246bd071d0f0c9e70f3de69261d87cb73a.png)

Seems a bit more stable (slower to eat away memory).

I sent diagnose report (perhaps multiple, the new Android beta app is not so clear)

---

<div class="post-metadata">

**Author:** ![Phuturist](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/phuturist/32/49_2.png) [@Phuturist](https://community.homey.app/u/Phuturist)\
**Post date:** [June 28, 2023, 3:56pm UTC](https://community.homey.app/t/app-pro-xiaomi-mi-home-app/118/1345 "2023-06-28T15:56:34Z")

</div>

> [@Eternity](#):
>
> I sent diagnose report (perhaps multiple, the new Android beta app is not so clear)

From the app settings (and not the Homey settings)? I havent received any reports.

---

<div class="post-metadata">

**Author:** ![Eternity](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/eternity/32/102113_2.png) [@Eternity](https://community.homey.app/u/Eternity)\
**Post date:** [June 28, 2023, 4:03pm UTC](https://community.homey.app/t/app-pro-xiaomi-mi-home-app/118/1346 "2023-06-28T16:03:00Z")

</div>

Yes, via the App settings. Will try again!

ccdd8f3e-284e-4458-8e6e-b25a44e247e6

---

<div class="post-metadata">

**Author:** ![Phuturist](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/phuturist/32/49_2.png) [@Phuturist](https://community.homey.app/u/Phuturist)\
**Post date:** [June 28, 2023, 4:16pm UTC](https://community.homey.app/t/app-pro-xiaomi-mi-home-app/118/1347 "2023-06-28T16:16:34Z")

</div>

Too bad, nothing in there that points to something like a memory leak.

---

<div class="post-metadata">

**Author:** ![Eternity](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/eternity/32/102113_2.png) [@Eternity](https://community.homey.app/u/Eternity)\
**Post date:** [June 28, 2023, 4:42pm UTC](https://community.homey.app/t/app-pro-xiaomi-mi-home-app/118/1348 "2023-06-28T16:42:32Z")

</div>

I will post another one when the memory is higher. Perhaps that helps…

New one: 0f359447-a6da-4177-8835-7258422c7357

---

<div class="post-metadata">

**Author:** ![Eternity](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/eternity/32/102113_2.png) [@Eternity](https://community.homey.app/u/Eternity)\
**Post date:** [June 28, 2023, 9:15pm UTC](https://community.homey.app/t/app-pro-xiaomi-mi-home-app/118/1349 "2023-06-28T21:15:23Z")

</div>

After the App updated, the memory issue seems solved:

Na de laatste update is de App herstart (duh…) en het geheugen gebruik:

 ![1000032477](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/a/6/a60849227d912d7d92b6ad46223a9183e5587295.png)

---

<div class="post-metadata">

**Author:** ![Phuturist](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/phuturist/32/49_2.png) [@Phuturist](https://community.homey.app/u/Phuturist)\
**Post date:** [June 29, 2023, 5:08am UTC](https://community.homey.app/t/app-pro-xiaomi-mi-home-app/118/1350 "2023-06-29T05:08:45Z")

</div>

Please let it run for a while. If it really is solved the memory leak might actually have been in a WiFi driver and most likely even related to Homey’s SDK (instead of external libraries).

---

<div class="post-metadata">

**Author:** ![Eternity](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/eternity/32/102113_2.png) [@Eternity](https://community.homey.app/u/Eternity)\
**Post date:** [June 29, 2023, 5:44am UTC](https://community.homey.app/t/app-pro-xiaomi-mi-home-app/118/1351 "2023-06-29T05:44:22Z")

</div>

Seems solved!

 ![1000032485](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/c/a/ca612291dd7c9936cd37a9abcce2ccd4c774ad36.png)

After the update, the memory used does’t built up.

I’ll keep it running and let you know if it stays this stable.

---

<div class="post-metadata">

**Author:** ![Sharkys](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/sharkys/32/54029_2.png) [@Sharkys](https://community.homey.app/u/Sharkys)\
**Post date:** [June 29, 2023, 8:08am UTC](https://community.homey.app/t/app-pro-xiaomi-mi-home-app/118/1352 "2023-06-29T08:08:54Z")

</div>

> [@Eternity](#):
>
> After the update, the memory used does’t built up.

I can confirm, great job @Phuturist . Just out of curiosity, is it specific to your app or it might influence also to some others apps ? Just curious…

---

<div class="post-metadata">

**Author:** ![Phuturist](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/phuturist/32/49_2.png) [@Phuturist](https://community.homey.app/u/Phuturist)\
**Post date:** [June 29, 2023, 5:26pm UTC](https://community.homey.app/t/app-pro-xiaomi-mi-home-app/118/1353 "2023-06-29T17:26:50Z")

</div>

> [@Eternity](#):
>
> After the update, the memory used does’t built up.

> [@Sharkys](#):
>
> I can confirm, great job @Phuturist .

That’s good to hear. The memory leak is/was probably specific to my app although I cant be sure. It’s related to a setTimeout function which sets the device as unavailable when an error is encountered. The function which is then triggered in my app contains some miio related code which I guess was causing a leak. As I fixed a bug in the Dmaker fan the device was not set as unavailable anymore and the code probably causing the leak is not triggered anymore.

[Previous page](https://community.homey.app/t/app-pro-xiaomi-mi-home-app/118.md?page=65)

[Next page](https://community.homey.app/t/app-pro-xiaomi-mi-home-app/118.md?page=67)
