[APP][Pro] Archive Insights - export all your Insights data to a NAS, FTP or web folder

I am gonna take a look at the new api right now, try to fix this issues.

@Gruijter
Changes i made:

  • Using the new homey-api 3.0.2. now

  • It works for me on the HP2023 and on the HP2019!
    But, the homey-api doesn’t handle the correct solution on HP2019!, so this cannot be rolled out yet!
    Already created a message on slack!

  • Before, for every app or exported entity, because of how the loops where, you keep reloading all apps, all devices, all logs, etc.
    Now, it retrieves all information just once, then starts looping through the to be exported entities.
    Saves a lott of resources and speeds it all up!

  • You wait 10 seconds between each entity, to reduce overloading.
    But with 45 apps, that 7.5 minutes waiting for nothing!
    I have created a settings for it, by default still 10 seconds, but you can change that now.
    When set to 0, the timeout will still be 1 millisecond, so the process will not be killing homey.
    And for me, 0 seconds works fine and there is no crashing issue or anything.
    So, perhaps the default should be 0, so people can increase it themself?

  • There were some reloading of logs right after each other, i have changed that for performance.

  • Because it now goes way faster (if wanted), the resolution of one hour is less out of sync between entities.

  • Booleans (Yes/No) don’t use the resolution. This creates a lott of double information, because all Booleans that are still saved in the device insights, are included, even if it falls outside the resolution.
    I have changed this by manually ignore log-entries that fall outside the resolution given.
    Thus: Booleans now also respect the given resolution.
    Please note tho: resolution on HP2019 is based on local tike, but on the hp2023, its based on utc.
    I have informed Athom about this.

  • Saving the zip files is now await for, thus no timeout needed!
    Goes way faster this way!

Exporting all stuff on my HP2019 took about 11-12 minutes before.
Now it does it in about 2-3 minutes!

But again: Before the homey-api is fixed for the HP2019 (and older i guess), this cannot be rolled out, because resolution is not handled at all!

But, the sourcecode seems fine and works correct with both HP2019 and HP2023!


2 Likes