giaever-online-iot / home-assistant-snap

Snap recipe for the Open source home automation software that puts local control and privacy first.
Apache License 2.0
21 stars 3 forks source link

YAML files are generated with a variety of encodings, causing functionnal errors. #36

Closed fosterrath closed 1 month ago

fosterrath commented 1 month ago

I found I could no longer update automatons through the WEB interface.

Logs contain these types of errors :

Unable to read file /var/snap/home-assistant-snap/629/automations.yaml: 'utf-8' codec can't decode byte 0xe9 in position 32: invalid continuation byte

When looking at my configuration files I see :

/var/snap/home-assistant-snap/current/automations.yaml: ISO-8859 text /var/snap/home-assistant-snap/current/configuration.yaml: ASCII text /var/snap/home-assistant-snap/current/groups.yaml: empty /var/snap/home-assistant-snap/current/scenes.yaml: Unicode text, UTF-8 text /var/snap/home-assistant-snap/current/scripts.yaml: empty /var/snap/home-assistant-snap/current/secrets.yaml: ASCII text /var/snap/home-assistant-snap/current/sensors.yaml: ASCII text

Manually setting all my configuration files to UTF-8 (or more specifically the automations.yaml file) and restarting the snap service fixes the issue. But every snap update breaks the manual fix.


Would it be possible to automate the proper conversion of all files to UTF-8 ?

fosterrath commented 1 month ago

Update : It seems simply rebooting HASS reconverts the files to the wrong encoding, so the issue might not be related to the snap implementation.