How to create a download file from Homey?

Hello developers,

My app collects statistical data, and I would like to offer an export as CSV and JSON files.

At the moment, I can already generate both formats and display the output in a field within the settings page. However, I have been struggling to add a download button that would allow users to download the generated file, either in the Homey app and/or in the browser.

So far, every approach I tried either resulted in an error or simply did nothing.

Is there any documentation about this, or do you have any advice on how to implement it properly?

Thanks in advance,
Pascal

Maybe you can upload it to the userdata folder and then access it via https://[cloudid].connect.athom.com/app/[your app id]/userdata/[filename]. You can get the Cloud ID via this.homey.cloud.getHomeyId()

2 Likes