I have two Home Assistant installations which I’d like to configure in bulk; both of them are Raspberry Pi HassOS. So far, I’ve experimented with the File Editor add-on API to read and write files from a script, efectively emulating the front-end.
I managed to do so in a trial Docker on Windows installation:
curl http://192.168.0.47:3218/api/file?filename=/config/automations.yaml for reading.
curl -d "filename=/config/automations.yaml&text=$(cat automations.yaml)" http://192.168.0.47:3218/api/save for writing.
However, when I tried to do the same in my Raspberry Pi installations, I ran into some differences:
- The request URL now looks like
I assume the string after
hassio_ingressis some kind of add-on identificator, as it doesn’t vary between sessions or users.
- There’s a cookie named
I’d like to know what to do to get those values, or if there is an alternative way of making this work. I searched for Ingress documentation and only found this. I also checked out the File Editor/Configurator add-on page, but couldn’t find anything there regarding these.
I’m running Home Assistant 0.115.4, HassOS 4.13 and File Editor 5.1.0.
Thanks in advance!