Thermostat - How to Remember Settings?

I have an 8266 running a gas furnace in my garage. The primary purpose is to make sure my garage is kept above freezing. I implemented an ‘away’ mode using an input_boolean so when I toggle this, the heater goes on to a present temperature. Right now I have my away temperature at 2C and ‘home’ set to 10C (hard coded into the yaml file). When home, I will change the temperature to something comfortable (i.e. 13.5C). Now I want to have the thermostat remember this setting the next time I put it into ‘home’ mode. How can I do this?

Use globals with:

restore_value: true

Also check the details about esp8266_restore_from_flash.

2 Likes

In my yaml file I have this and also have this variable defined as a helper in HA:


globals:
-id: GarageTempHome
type: float
initial_value: 11.0


So how do I bind this to my desired temperature in the thermostat? I currently have this:
default_target_temperature_low: 11.0 °C

But this gives an error:
default_target_temperature_low: GarageTempHome

Also does the thermostat throw an event when the temperature setting is changed by a user?

Globals in ESPHome cannot be directly exposed or mirrored into HA entities. They can only be accessed from within Lambdas in ESPHome. The way to expose them to HA is usually through template sensors. But I have a feeling that what you really want to achieve is to persist your settings in HA and not in ESPHome. This is possible through Home Assistant Sensors. You will have to do some reading of the basic ESPHome concepts to get aquatinted with its ways. Start on the https://esphome.io/ website and read the Getting Started sections and its sub pages.

1 Like