That is just the thing - I am running HA core in a virtualised Python environment. I can’t use the add-on store or Supervisor or any of these methods, I have to edit the YAML-files in some form of editor. And nano is just the editor that came with my operating system.
So in order to view or edit the YAML-files using Notepad++, I have to download them from my RasPi but cannot upload them because I get an error message:
You are using a configuration that is totally foreign to me.
The error message is likely a permissions thing. Go into the configuration folder and do an ls-al
. Who owns the files? Try chmod 777 automations.yaml
and see if it uploads now.
Scratch that. Show me a screenshot from Filezilla showing the remote site files. I want to know who is the owner/group. In my case its “root/root”, but on the pi it might be “pi/pi”.
Have you seen this?
Again? What do you get?
I use Home Assistant Core which is apparently more of a “bare metal” installation types of HA, see this.
I would love to just use HASS.IO but I only have one Rasperry Pi and I run a bunch of other services on it that would not be possible if I ran HASS.IO.
I posted the output of my nano --version earlier, here it is again:
Here is a screenshot from Filezilla:
One other thing I just thought of: would it be possible to delete my automations.yaml and let HA just generate a new one? Is this how this works?
There are two quick fixes you can do:
- on your server, run (in the directory where
automations.yaml
exists):
This will make the file writable for any user, so you should be able to upload it through Filezilla.sudo chmod 666 automations.yaml
- OR: remove any characters in your
automations.yaml
that can cause issues (basically anything that falls outside of the regular ASCII table, so no accented characters or symbols like€
).
Thank you for your reply!
I tried changing the permissions and it kinda worked: I was able to upload my backed up automations.yaml that was encoded in UTF-8. However, after I tried editing an automation from the web UI I once again get the error 500. And after I downloaded the automations.yaml it is once again formatted as ANSI.
Check if Filezilla perhaps has an option to convert text files to some particular encoding.
After adjusting the permissions I was able to edit the file via File Zilla and convert it to UTF-8. But the underlying problem seems to be unresolved: I can validate my config - I try to edit any automations via the web UI - after saving I get the same error message as before and my automations.yaml is once again formatted as ANSI.
That would suggest the web UI editor saves the file with the incorrect encoding, which sounds strange.
That was my thought as well. Stranger even is the fact that I can add and edit any of my integrations via the web UI without error. My configuration.yaml is consistently saved as UTF-8. However, I found that I cannot add or edit any scenes without getting the same 500 error. And after that my scenes.yaml is also saved as ANSI.
They are cheap- if you can find one. Micro-Center stores had stock the last time I visited them. If you switch to HAOS on a dedicated computer things will be much easier to manage. No VMs, no containers, no port conflicts. Highly recommended.
I can’t say for sure, but I doubt it. As you create an automation in the UI, it just writes to the automations.yaml file. If you delete it, then it would be as if you never created the automations in the first place.
I really think your problem is in file permissions. Who owns the YAML files on the Pi?
I’m in Germany, so I guess we don’t have Micro-Center here ;). Anyway, Amazon sells them too, but the markup is insane, 199 Euros for Rasperry Pi is a bit steep for me. However, I completely agree with you, I would love to host Home Assistant on a dedicated machine and I will migrate as soon as possible =).
In the meantime: hm, I figured as much concerning deleting the YAML file :(.
All my YAML files are owned by the user “homeassistant” which is the user that I specifically created during the installation process.
Amazon doesn’t ever own any of the things they sell- it’s just a marketplace and warehouse for the sellers. Yes, that’s a huge markup for a Pi.
Have you tried other editors, like Vim?
Yeah, I agree.
Haha, I actually just tried Vim (holy hell, that was a wild ride). I edited my automations.yaml but only a little bit. After saving I still get the error message, that apparently this file is again encoded using ANSI.
I also tried updating HA to version 2022.5.3 but to no avail. After restarting my config is marked as valid and as soon as I try to edit my automations I once again am greeted by the same error.
Totally a mystery platform here. Your experience is an example of why I wanted to go native. You might do some research into whatever is providing the Python environment. I think the UTF-8 problem is deeper than Home Assistant of Nano.
A couple of things to try:
nano -u automations.yaml
From man nano:
Save a file by default in Unix format. This overrides nano’s default behavior of saving a file in the
format that it had. (This option has no effect when you also use --noconvert.
Use find to see if you have a nano.rc file.
How do you know it is encoding in ANSI?
Here’s a brute-force idea. Since you can edit and save configuration.yaml, make a copy of it. Call this file temp.yaml.
Nano -f temp.yaml
thenCTRL-r
to copy the contents of automations.yaml.- Now open a second terminal window and rename automations.yaml to something like automations.bak.
- Back to nano, edit your automations.yaml as desired then do a save-as (CTRL-o) to save the file as automations.yaml.
Then test it.
My first UNIX editor (not counting the punch cards) was vi. Vim was an improvement.
Just to remove any confusion: it’s not being saved in “ANSI” format (which isn’t a thing), it’s being saved in iso-latin-1 (or possibly win-1252).
And FWIW, “unix format” has to do with line endings only, not with encoding.
Hey guys, just wanted to thank you profoundly for all your help and patience, it is very much appreciated!
I’m happy to report that I solved my problems (kinda…). I just installed HA OS on a virtual machine using my old laptop. I am blown away by all the possibilities in comparison to HA Core on my Raspi.
I am almost done with this new installation and I will remove HA Core from my Raspi when everything is set up.
Just wanted to let you know and really wanted to say thank you, this community is awesome! =)
Lol I’ve been following this thread waiting to see what the resolution was out of curiosity and whilst I’m happy you found the glory that is HAOS (I did just this week myself too) I really wish you worked out what the real fix was