How to decrease the time required for resetting boot loop counter

Hi,

I have a few lights working fine with ESPHome. These lights are turned OFF by a switch (so they are not always on).

Because of this the OTA “Last Boot was an unhandled reset, will proceed to safe mode in 8 restarts” kicks in every now and then and the lights boot into safe mode.

The issue I have is that some of the lights when are tuned on are only turned on for a short period of time. Currently it takes about 4 minutes to get the “Boot seems successful, resetting boot loop counter.”.
Some of my lights only turned on for 2 or 3 minutes before they are turned off. Some lights are turned on for even shorter period of times (some only 30s seconds or so).

So I am trying to sort this issue out as sometimes visitors to the house press the button and no light turns on at all (because of the above - light boots into safe mode) but not sure what I need to adjust or how.

Ideally will be best to be able to lower the time required to “Boot seems successful, resetting boot loop counter.” - if someone knows how to do that please let me know. This way I can adjust individually with the correct amount of time required for a successful boot so the boot loop counter gets reset.

I rather not go down the route to increase the number of restarts required before entering safe mode as eventually I will end up with the same problem.

Thanks

Not sure how to decrease the time but possibly adjusting num_attempts may be a work around?

Or maybe you could just disable safe_mode (dunno if that is a good idea).

I think it might be safe_mode_enable_time_ which triggers resetting the boot counter, but I probably wouldn’t tinker with that unless you know what you’re doing.

https://esphome.io/api/classesphome_1_1ota_1_1_o_t_a_component#a1e22c510fcb06f62e857e3e8aeefba31

Hi,

Thanks for the information provided.

I wish there was an official way to allow users to change the value for the boot loop counter reset.