Configuration.yaml file

Hi all,

In fact when I manually change the settings on my card:

image

I would like to dynamically change some values in my configuration.yaml file:

  • target_temp: 20
  • initial_hvac_mode: “heat”

Like this after any Home Assistant restart, i’ll not start the heating system in summer as an example :sweat_smile:
Or whatever else situation.

Does anyone know how I could do that ?

You can’t.

Ok without any workaround ?

There is no workaround for changing configuration.yaml, but there is almost certainly one for what you are actually trying to do, i.e. the big picture, if you care to describe it.

Well I’ll try to rephrase it :sweat_smile:

I have a configuration.yaml file that is allow me to have a thermostat card.

When I change the value of the thermostat manually on the card itself, it’s taken into account.
However if I restart Home Assistant, the card settings taken into account are the one into the configuration.yaml file and not my previous manual settings.

So when I restart Home Assistant, I would like to get back my previous settings and not the configuration.yaml settings.

I don’t know if this description of the problem is better than the previous one

That’s unlikely. You don’t configure cards through configuration.yaml.
Care to show your actual configuration.yaml? What is your climate entity?

climate:
# Living room remote control
  - platform: generic_thermostat
    name: Salon
    heater: switch.switch_fake_salon
    target_sensor: sensor.temperature_salon
    min_temp: 15
    max_temp: 25
    ac_mode: false
    target_temp: 20
    cold_tolerance: 0
    hot_tolerance: 15
    min_cycle_duration:
      seconds: 5
    keep_alive:
      minutes: 3
    initial_hvac_mode: "heat"
    away_temp: 16
    precision: 0.5

According to the doc, the target_temp is retained across restarts, so you don’t actually have to do anything

I don’t know about initial_hvac_mode, though

Ok so I’m afraid I should raise a bug :frowning:

I thought it could be possible with using any workaround such as node red like on value change to store this value in a dedicated file “persistent_data” then my configuration.yaml should be able to open this file to read the persistent data and so update the values:

  • target_temp: peristant_target_temp
  • initial_hvac_mode: persistant_initial_hvac_mode

Actually, just do no set those attributes.
The card will be funky the first time, but the values of the generic thermostat will then be correctly restored.

Might be considered a bug, I guess

Ok thanks for your help !

It’s very strange that Home Assistant doesn’t have any persistent data as basic functionality.
(as you noticed i’m not a dev at all !! :sweat_smile: )

For any home assistant restart, how people are handling with their settings ? like the alarm system (on / off by default ?)

I also though there’s some workaround to deal with this but as my small research I didn’t find anything on it.

I’ve been telling you it does have it :wink:
Just remove target_temp and initial_hvac_mode from configuration.yaml

1 Like

I missunderstoood you and I’m sorry.
I just did it and it works perfectly !
Thanks !

Hi, just tagging onto this post. Im looking for a way to lookup the values of the cold_tolerance or hot_tolerance in node red. This works for the temperature value, but the tolerances dont seem to be obtainable

$entity().attributes.temperature