10000 add upload file action · home-assistant/home-assistant.io@2b60b8c · GitHub
[go: up one dir, main page]

Skip to content

Commit 2b60b8c

Browse files
committed
add upload file action
1 parent 95d3513 commit 2b60b8c

File tree

1 file changed

+36
-0
lines changed

1 file changed

+36
-0
lines changed

source/_integrations/immich.markdown

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,42 @@ The following {% term sensors %} are created. For some of those the API key need
5858
| **Disk used by photos** | Used disk space by photos (_admin only_) ||
5959
| **Disk used by videos** | Used disk space by videos (_admin only_) ||
6060

61+
## Actions
62+
63+
### Upload file
64+
65+
This action allows you to upload a media file to your Immich instance. It takes the following arguments:
66+
67+
| Argument Name | Argument key | Required | Description |
68+
| --- | --- | --- | --- |
69+
| Immich instance | `config_entry_id` | yes | Select the Immich instance where to upload the file. |
70+
| File | `file` | yes | The path to the file to be uploaded.<br>_This path must be an entry in the `allowlist_external_dirs` in your [`homeassistant:`](/integrations/homeassistant/) section of your {% term "`configuration.yaml`" %} file._ |
71+
| Album id | `album_id` | no | The album where to put the file in after upload.<br>_To get the album id, open the Immich instance webui in a browser and navigate to the corresponding album, the album id can now be found ion the URL `https://your-immich-instance/albums/<ALBUM-ID>`_ |
72+
73+
#### Example script
74+
75+
Take a snapshot of a camera entity via the [`camera.snapshot`](/integrations/camera/#action-snapshot) action and upload it to the Immich instance in a specific album.
76+
77+
{% raw %}
78+
79+
```yaml
80+
sequence:
81+
- variables:
82+
file_name: /tmp/camera.yourcamera_{{ now().strftime("%Y%m%d-%H%M%S") }}.jpg
83+
- action: camera.snapshot
84+
data:
85+
filename: "{{ file_name }}"
86+
target:
87+
entity_id: camera.yourcamera
88+
- action: immich.upload_file
89+
data:
90+
config_entry_id: 01JVJ0RA387MWA938VE8HGXBMJ
91+
file: "{{ file_name }}"
92+
album_id: f2de0ede-d7d4-4db3-afe3-7288f4e65bb1
93+
```
94+
95+
{% endraw %}
96+
6197
## Troubleshooting
6298
6399
In any case, when reporting an issue, please enable [debug logging](/docs/configuration/troubleshooting/#debug-logs-and-diagnostics), restart the integration, and as soon as the issue re-occurs, stop the debug logging again (_download of debug log file will start automatically_). Further, if still possible, please also download the [diagnostics](/integrations/diagnostics/) data. If you have collected the debug log and the diagnostics data, provide them with the issue report.

0 commit comments

Comments
 (0)
0