This is the forum archive of Homey. For more information about Homey, visit the Official Homey website.

The Homey Community has been moved to https://community.athom.com.

This forum is now read-only for archive purposes.

[How to] Backup Insight data on another device

WRosWRos Member
edited March 2017 in Questions & Help
I thought the data in Insight was stored for 6 month. But that's wrong. A Full Reset of Homey has removed the data.
The Insight data is imported for me the make analyses over years. That's the reason the investigate possibilities to download the data.

A Raspberry Pi is every evening downloading the data. Now I'm sure, I never loss my data.  Because this data is also in sync with another device in another neighborhood.

I want to share this Script with the Homey community. So you could all use this same method.
It's a bash script that make a script with a lot of Curl command to download the data. In Linux, you need the curl and the jq commands.


Comments

  • I meant the download function:


    This give a great logfile:
    Sun Aug 07 2016 22:27:27 GMT+0200 (CEST),19.07
    Sun Aug 07 2016 22:47:32 GMT+0200 (CEST),18.97
    Sun Aug 07 2016 22:57:28 GMT+0200 (CEST),18.96
    Sun Aug 07 2016 23:42:30 GMT+0200 (CEST),18.68
    Sun Aug 07 2016 23:47:30 GMT+0200 (CEST),18.97
    Sun Aug 07 2016 23:57:30 GMT+0200 (CEST),18.68
    Mon Aug 08 2016 00:12:36 GMT+0200 (CEST),18.78
  • I don't think 6 months is a limit, I have insights (two measurements per minute, 20MB file) dating back to april 27th for my thermosmart, guess it was the last time I did a full reset. Both for WU, Homey presence, Thermosmart etc data for more then 6 months...
  • Thanks @bvdbos, a full reset can be the reason, but I can't remember that I did a full reset. The Flows I've made are present from april 2016.
    Nice to hear that the log file in Homey would be "Endless".
    To be secured that I don't lost any data, I would automatic backup the data on another device.

    Have somebody got the knowledge to download or push the data to another device?


  • Downloading is done through Insights BTW...
     

    Don't know about automation but there is a thread here about storing values in a google spreadsheet through ifttt...
  • WRosWRos Member
    edited February 2017
    I've searching a download link for the log file: https://__Homey_ID__homey.athom.com/api/manager/insights/log/homey:device:893ad295-320c-436a-a809-d56edb7ffbec/dim/entry?access_token=undefined That's make it possible to download the file. Now I've found a solutions by myself. Now a have the registrate all the device ID's. And than I gonna make a Script in my server to download every week all the data from Homey.
  • This Evening I made the Script for the server to download the Insight logs.
    For other people who wants to download the values automatically too:

    curl -H "Authorization: Bearer 12345678910asdfghjkluytre1234" -o Temperatuur.log "https://tralalalhomeyididididid.homey.athom.com/api/manager/insights/log/homey:device:0f0dcd68-32cf-49bc-ae2b-2b3deb2dafaa/measure_temperature/entry?access_token=undefined"

  • WRosWRos Member
    edited March 2017
    To download all insight data on another device, I've created a bash script:
    https://github.com/WesRos/download.insight.homey/blob/master/homeydatascript

    This Script is bash: curl and jq are needed to execute.
    This script is creating another script, with all the curl command to download the data in right named log files.
  • WRosWRos Member
    edited March 2017
    An important change in the script: Merge the existing logfile with the new one.
    The script generated many, many logfiles for backup, of to integrate in another monitorings tool.

  • Thank. It would be cool if there was an integrated function into Homey, which you can use to download the log files of all of your devices at once.
  • WRosWRos Member
    While the script is downloading data from Homey, Homey is restarting at a point.
    I think the reason is that Homey is writing into the log.
    The same response from the web interface.
Sign In or Register to comment.