Idea: backup to device

I’m wondering, would it be technically feasible to backup the yaml code to the device?
And of course afterwards retrieve it.

I understand it has some security implications, but personally I don’t care.
Backup is more important to me.

just set up a samb share and copy it

That is what a full system backup does.
It backs up your stuff.
Just remember to not save it local on the HA device. Make sure it saves the backup on a NAS or cloud

1 Like

The system backups are just tar archives of the HASS files.

This means you can unpack a backup and extract a single file.

If I understand the OP, it’s about making a copy of the source code (YAML) available on the ESP device to which the compiled code was installed. This would be different from backing up HA or even the device (e.g.; laptop) the source code was created on.

If that’s the suggestion, I think it’s a good one. I often thought this should be standard practice for anyone who sells devices pre-loaded with ESPHome. Sort of a “right to repair” issue.

I’d like it even more if all smart device manufacturers did this. I have a washing machine with some of the stupidest programming I’ve ever seen. Sometimes it seems like the author of the firmware had a mean streak, and wanted to torment users. I’d love to be able to reprogram it, but I’d need the original source code as a starting point. Plus I’m sure it’s not written in ESPHome anyway, but you get the idea.

There is no yaml on the device.
All the yaml is compiled to a c++ code.

Reversing that is impossible or very hard

Which is why it would make sense to put the source YAML right on the device. Can’t get lost that way, and no need to de-compile anything.

It’s not a USB memory.
I have never seen any code for Arduino where you could store data on the memory.
On EEPROM yes but that is not large enough I believe

@CaptTom is correct on my idea to also keep the code on the device; in order to know what exactly is compiled on the device.
My idea would also be that this copy is done by esphome provisioning.

@Hellis81 I understand what you say; but an esp is not an arduino; an esp32 has 4MB flash memory (if I understand correctly). My compiled code is generally about 0,5MB.
So I would think technically it could work.

As I said before, I really doubt you can save things to the flash memory.
As far as I’m aware that is just for code.

The EEPROM however can be used to save things, all 512 bytes on a ESP32