Just for completeness: the right way to do this is to add the json under ~/.platformio/boards and the other files as described in https://community.platformio.org/t/how-use-a-same-chip-but-with-different-environment/18082/4
IT WORKS
I got a first working version, using an ATmega1284P running on MightyCore 2.2.2 (as soon as I began developement, they switched from Optiboot to Urboot in version 3.0.0, whicht does not include the copy_flash_pages function anymore, but I'm working on a work around there).
Only thing I could not solve is to do a CRC check of the image after download...
You can try it out here: https://github.com/eiten/MySensors/tree/FOTAInternalFlashTest
It's not beautiful yet with much Serial.prints in it, but maybe it helps you if you find errors.
@eiten said in Saving last known good state, but not in EEPROM:
utility meter in home assistant
This is exactly what I am seeking! Thank you!
PS I truly enjoy reverse translating! It teaches me how to better understand my first language and it gives me alternate words to use in searches. So a second thank you!
"Regelmässiges Zurücksetzen" would be best translated to English in this context as "Periodic Reset". In the English version of Home Assistant it is called "Meter reset cycle" (I remember seeing "keep dry" translated as "do not take in shower with you"