patrickcollins12 / esphome-fan-controller

ESPHome Fan Controller
431 stars 49 forks source link

Reduce flash writes? #12

Closed TheDK closed 1 year ago

TheDK commented 1 year ago

As far as I can tell the config you have writes a couple of parameters to flash every minute, amounting to ~0.5m writes per year. From what I've read the flash memory in ESP32 is expected to last 100k-1m write operations. I don't know if there's wear leveling in an ESP (guess not), so it might make sense to reduce writing the parameters to the ESP every 15min or so?

DunklesKaltesNichts commented 1 year ago

my ESP has been running for almost 2 years without any problems.

the variable DHTTemp is not used anyway... you could switch off "restore_value" for all variables and after you have found suitable PID parameters, you could write them once into the code and flash them.

or just set "flash_write_interval" to 15min

patrickcollins12 commented 1 year ago

OK this is a good point, thanks DK. I'll the documentation to mention this.

TheDK commented 1 year ago

I've added it to the yaml together with a comment, so it is in by design and if someone wants to take it out it can just be deleted.

patrickcollins12 commented 1 year ago

great thanks, i merged this. appreciate it.