I have a peculiar problem ever since I updated my Home Assistant Core installation on my Raspberry Pi 4 to version 2022.5.1: I can’t edit any of my automations from the UI, all I get is “Error loading automation (500)”. Additionally, my YAML config check tells me “Error loading /home/homeassistant/.homeassistant/configuration.yaml: ‘utf-8’ codec can’t decode byte 0xfc in position 3057: invalid start byte”.
After some research I found that my automations.yaml is (for some reason) ANSI-encoded and not UTF-8-encoded - I have no idea why. I did not change anything other that updating.
My problem is that I am no Linux expert and I’m trying desperately to change the encoding back to UTF-8.
The thing that confuses me the most however, is that all my current automations are working fine. I just can’t edit them or add any new ones.
Any help would be greatly appreciated! If my post is lacking any crucial information please let me know!
I tried and indeed after running the command my config is reported as valid. However, as soon as I try to edit any automations I can’t hit save (nothing happens) and after a page refresh I keep getting the error message I got before “Error loading automation (500)”.
If I try to validate my config I get the same error as before.
And it seems that my automations.yaml is again saved as an ANSI file.
PuTTY is set to UTF-8. How do I check if nano is using UTF-8? I just run “nano automations.yaml” heh. As I am no expert, how would I go about checking the settings of nano?
I tried it but still no luck :(. My automations.yaml continues to be encoded in ANSI.
What gives me pause is that if I edit my configuration.yaml using nano it saves as UTF-8.
Just be aware that you should convert the file to UTF-8 using iconv first before trying to edit it with nano for the first time (in other words, nano may not fix the file for you once it’s “broken”).
I’m not sure if I understand it correctly: I used iconv as per your instructions. After the conversion I validated my config using HA and it passed. After that I tried to edit my automations.yaml using nano. Was that wrong?
I also suspected that my automations.yaml is simply corrupt or broken but I can’t seem to replace it using File Zilla as I lack permission, apparently.
Still with nano, but you need to tell it it has to save files in the correct encoding. From what I can see, this requires setting the correct locale (but I don’t use nano, so perhaps there’s a configuration option or command line flag that you can set).
Perhaps you need to log out and back in. It’s telling you the en_US (without .UTF-8) is invalid.
I see. tried logging out and back in again, still the same error.
I’m currently generating all locales, maybe this will help.
@bschatzow : yes, I know but unfortunately I am not able to upload my converted file back to my Rasperry Pi as I seem to be lacking the proper permissions :(.
Thank you all for your help, I really do appreciate it!
I am running Home Assistant OS which automagically exposes the configuration folder to Samba. I mount the folder in Windows then use Notepad++.
I am also using the File Editor add on in Home Assistant: (Advanced Configuration - Home Assistant). (er, you DO have advanced Configuration enabled, don’t you?) I can’t imagine the editor in Home Assistant not saving the files in a compatible encoding.
You can also use FTP (Filezilla) to view/edit the files, but that can be confusing. I only use Samba when I must.