How to copy files to home/homeassistant directory?

Hi,
I’m brand new here, also first time raspberry pi user, so sorry the questions sounds dumb.
I got everything set up ok for now and everything kind of working.

I’m playing around with integrating a floorplan, and as part of the exercise have to move files inside the directory mentioned above. I can access the config directory via samba and set-up my HA, but I was wondering how I can write files in the home directory?
Looked through the forum here now for an hour but can’t find anything.

in all the floorplan tutorials it always just says “copy files xxx to the home assistant directory”, but nobody explains how it’s working. (probably because it’s plain simple for everyone who has little experience in this, but unfortunately I don’t).

So would appreciate if someone could explain the easiest way to move files, thanks :slight_smile:

Tom

5 Likes

I have installed SSH addon https://www.home-assistant.io/addons/ssh/ and use:

  • PuTTY https://www.putty.org/ for console commands
  • Netbox in Far Manager (Alt+F2, 2, shift+F4 and so on) https://www.farmanager.com/ for copying and editing files. Make sure that your text editor use UNIX-like line breaks (Use hot key Shift+F2 for save in Far Manager)

My desktop PC running by Windows 8.1

1 Like

cool, thanks. SSH was the keyword :slight_smile:

I want to get floorplan running and in the rep it’s explained to copy the files into “~/.homeassistant”, but I
can’t find that folder.

in the documentary here it says with hass.io home assistant is managed in the file called “/config” not “~/.homeassistant”,
so does that mean I copy my files/folders inside “config” and not “.homeassistant”?
floorplan has to be installen inside that folder.

can someone confirm that I’m putting it in the right folder?

Correct. It is merely referring to where your configuration files are.

Yes, because .homeassistant doesn’t exist in a docker container.

cool, got it working, thanks!!

Artem, you still didn’t explain “how” to copy the files. You only listed the tools that you use, but shared no explanation on how it’s done…

Would be helpful if people would actual post workflow, rather than just listing tools and expecting people to learn by osmosis. Unfortunately I’m finding that seems to be the trend here in the Home Assistant forums. :unamused:

5 Likes

When SSH is up and running the protocoll for transfering files is SFTP. For how to use SFTP on Linux check here and here.
On Windows you can use WinSCP which is used like the windows explorer, means drag & drop

3 Likes

Thank you, Joerg! Much appreciated…

1 Like

Well, SFTP sure is life-changing. I was pasting data out of nano…

1 Like

If you login from Linux system, will be easier if yo copy files directly with scp command:

scp myfile.png root@<your_ip>:/root/config/www/myfile.png
2 Likes

I wanted to post the guide on how to scp / sftp files to home assistant here, but apparently new users are not allowed to upload images, so I created this blog post: » How to SCP / SFTP Files to Home Assistant dominikdorn.com

This only works with text files, but what if I want to copy the jpeg images? Receiving the following with scp and rsync:

scp

❯ scp -r www/persons/photo.jpeg hass:/root/config/www/persons/
photo.jpeg                                                 0%    0     0.0KB/s - stalled -
❯

Why is it stalled?

rsync

❯ rsync -avz --progress www/persons/photo.jpeg hass:/root/config/www/persons/
building file list ...
1 file to consider
photo.jpeg
       83972 100%   16.28MB/s    0:00:00 (xfer#1, to-check=0/1)

client_loop: send disconnect: Broken pipe
rsync: connection unexpectedly closed (34 bytes received so far) [sender]
rsync error: unexplained error (code 255) at /AppleInternal/Library/BuildRoots/0032d1ee-80fd-11ee-8227-6aecfccc70fe/Library/Caches/com.apple.xbs/Sources/rsync/rsync/io.c(453) [sender=2.6.9]
❯

The empty file of 0 bytes size is created on my homassistant filesystem((
Did anyone experience anything like that?

Why not use the File Editor Add-in?
You can upload any file to any folder.
Not handy for bulk upload, but works for couple of files.
Capture

@Floriszz Thank you very much! That works!

Additionally.
If you want to upload files higher up in the root, make sure the ‘Enforce Basepath’ option is unchecked in the configuration tab of File Editor Add-in;