downloader integration provides a service to download files. It will raise an error and not continue to set itself up when the download directory does not exist. The directory needs to be writable for the user that is running Home Assistant.
To enable it, add the following lines to your
# Example configuration.yaml entry downloader: download_dir: downloads
Use the service
Go to the “Developer Tools”, then to “Services”, and choose
downloader/download_file from the list of available services. Fill the “Service Data” field as shown in the example below and hit “CALL SERVICE”.
This will download the file from the given URL.
|Service data attribute||Optional||Description|
||no||The URL of the file to download.|
||yes||Download into subdirectory of download_dir|
||yes||Determine the filename.|
||yes||Whether to overwrite the file or not, defaults to
Download Status Events
When a download finished successfully, Home Assistant will emit a
downloader_download_completed event to the event bus which you can use to write automations against.
In case download failed another event
downloader_download_failed is emitted to indicate that the download did not complete successfully.
Along with the event the following payload parameters are available:
- alias: "Download Failed Notification" trigger: platform: event event_type: downloader_download_failed action: service: persistent_notification.create data: message: " download failed" title: "Download Failed"