Generic Thermostat Trying to modify the Set temperature

hi
i trying to change

 target_temp: 20

to

target_temp:sensor.house_furnace_temp_set

but i get error

Invalid config for 'climate' from integration 'generic_thermostat' at yamls/generic_thermostat.yaml, line 12: expected float for dictionary value 'target_temp', got 'sensor.house_furnace_temp_set', please check the docs at https://www.home-assistant.io/integrations/generic_thermostat

i have a file that has a temperature say 5 i through at it and i want to also add a Set button you can you set button saves it to a file so when you reboot HA it reads the temperature i set to the text file not the default 20 degrees… but i getting that error

how do i modify it to work… i get the sensor to read 5 but i want the thermostat to import it and i wanna do a Set button that saves the new value to the text file

Not possible like you describe. target_temp takes a number (float) and nothing else.

Use an automation and the climate.set_temperature action.

image

ah ok i not at home so i cant play with settings now

does the action climate.set temperatuere adjust the generic climate target temp or do i need to use a different card?

and do you happen to know how to write to a file in an automation… ill have to look at this when i get home this evening

@koying
so i tried to make an automation using the action climate.set_temperature from the sensor… but i still get a dictionary error… i havent tried being able to write to a file yet… but trying to read file from boot. maybe i cant do it unless you do it in nodered?

alias: Furnace - Set Furnace Target Temperature
description: ""
triggers:
  - trigger: homeassistant
    event: start
conditions: []
actions:
  - action: climate.set_temperature
    metadata: {}
    data: temperature:'{{states('sensor.house_furnace_temp_set') }}'
    target:
      entity_id: climate.moms_furnace
mode: single

the error i got was

Error while executing automation automation.furnace_set_furnace_target_temperature: Error rendering data template: Result is not a Dictionary

I checked if this is the error, but the usage of 2 times the same quotation marking in a line will cause issues.
It will be read as
'{{states(' is a text,
sensor.house_furnace_temp_set is some variable, and
') }}' is again text.

Try to use a double quotes for the other ones, like "{{states('sensor.house_furnace_temp_set') }}"

Also note the spacing and indentation for the data below:

actions:
  - action: climate.set_temperature
    metadata: {}
    data: 
      temperature: "{{states('sensor.house_furnace_temp_set') }}"
    target:
      entity_id: climate.moms_furnace

ok great that parts working so when it boots up it will over ride the default setting and read the text file say 22

now the problem i having is writting to the text file… i did some googling and people use the notify… and when i do it i either get apends.

so like
23
25
22
10

or when i did a shell command it works to delete… but i cant seems to remove the home assistant nofication

this is what i get

Home Assistant notifications (Log started: 2024-11-16T01:12:42.004562+00:00)
--------------------------------------------------------------------------------
22.0

so 4 lines
but all i want is 1 line

22

or

22.0

as its a sensor value and it wont be able to read right

i set in intergrations
2 Files
1 is the sensor file
1 is notify file
and both are the house_furnace.txt file

the code i have in a script is

configuration.yaml

shell_command:
  remove_house_furnace_temperature: "rm /config/packages/house_furnace.txt"

script file

alias: Furnace - Set Furnace Target Temperature
sequence:
  - action: shell_command.remove_house_furnace_temperature
    metadata: {}
    data: {}
  - action: notify.send_message
    metadata: {}
    data:
      message: "{{state_attr('climate.moms_furnace', 'temperature')}}"
    target:
      entity_id: notify.file
    enabled: true
description: ""
icon: mdi:radiator

I still do not understand why you want to write to a file.

1 Like

so you can change the set value of the temperature
so say if its set to 10 degrees when you reboot home assistant it reads the file and sets to 10 degrees… but now if i want it to be set to 5 degrees i want change the file to 5 so when home assistant reboots it will set the temperature to 5 and not 10

its like any House thermostate… when you set the temperature it saves it… i trying to do it the same you set the value and press the script button and it saves the value to the txt file so its saved so when HA reboots it reads that file and not the value that i set in the generic_thermostat.yaml thats not changeable as i learned the way i was hoping

so what i want is
if you set the temp to
10
and press Set Button (script)
it saves to house_furnace.txt

10

if i change the temp to 8 and hit SET
then i want it to save

8

to the house_furnace.txt file

Leave target_temp out of the configuration…


so in the picture ud hit the save temperature button and it would save that 10 degrees to to the house_furance.txt so when HA boots up it will read that value in the home automation you guys helped me with

@Didgeridrew not sure how to do that or where
or you mean in the generic_thermostat.yaml

Wherever you set up the Generic Thermostat. If that means generic_thermostat.yaml for you… Then, yes, there.

I guess you can find a helper that will retain its state over a restart.
It should be much easier to implement then.

2 Likes

I don’t think that is even necessary… without a defined target_temp it normally falls back on the previous value of the temperature attribute.

There can be setups where the target room temperature can not be calculated backwards from the heating devices, because there are too many factors playing in.
In such cases storing the setpoint temperature will be necessary and the generic thermostat feature is made for exactly for such cases, where a standard thermostat setpoint will not suit the situation.