Whether the status of bool parameter can be save in the webpage of ESPhome

I want to save the status of the bool parameters in the webpage that ESPhome provided(otherwise it will be resumed to default after the device reset).
(the option of “with battery” and “auto switch mode” )

But I go through this Template Switch — ESPHome
and do not find a proper method to do this.
Is there any suggestions?


There are many more classes that do or can store their state to flash so thats probably why you didnt see it under template switch so you need to expand your search to core functions of esphome.

Please give me more hints, thanks.
Ex: how do you would save the bool status in the esphome to make sure its value is not affected by the reset process.

This is why I always twist people’s arm to go browse/learn/read the esphome documentation and familiarize yourself with how things are organized, what kind of possibilities does it include, etc.

One more hint…

Start at the top!

resolved by this method.