Thermostat 'Minus Button' Automation

I would like to add code to my automation that duplicates the ‘minus button’ on the thermostat card, but I cannot figure out how to do that. Does it have to be calculated from the preset temperature?
image

User service climate: set target temperature and set temperature to desired value.

Could you show me the yaml syntax?

sure

service: climate.set_temperature
data:
  temperature: 15
target:
  entity_id: climate.daria_bedroom_radiator_2

…and you could template the temperature to be current minus 0.5 (per the ‘minus’ button for example).

That’s actually what I would like to do. I already have the following, but I would like to replace the ‘18.5’ with (temperature - 0.5):

alias: Thermostat regulation 21.5
description: Adjust Temperature
trigger:
  - platform: numeric_state
    entity_id:
      - sensor.master_bedroom_temperature
    above: 21.5
condition:
  - condition: state
    entity_id: climate.master_bedroom
    state: heat
action:
  - service: climate.set_temperature
    metadata: {}
    data:
      temperature: 18.5
    target:
      area_id: living_room
mode: single

In my opinion this is pointless. Human body can’t sense temperature difference of 0.5 degrees. Probably can’t even sense a difference for a 1 degree.

My zoning isn’t working correctly at the moment, so this is hopefully a temporary patch. In any case, I am looking for yaml help.

I tried

temperature: {{ sensor.living_room_temperature - 1 }}```

but I end up with

temperature:
“[object Object]”: null

Why? Are you using temperature sensor on trv? If that is the case don’t use it like that.
Use better thermostat integration as you can on the fly calibrate trv temperature using in room temperature sensor.

OK. Now how do I do it in yaml?

Something like this:

action:
  - service: climate.set_temperature
    data:
      temperature: "{{ state_attr('climate.master_bedroom','target_temp')|float(18) -0.5  }}"
    target:
      area_id: living_room

note:

  • float(18) is the default value when the entity is available - change that number to what you would like the default to be.
  • I’m not sure if target_temp is the right one - you will need ti check this by going to
    Developer tools ➜ states, typing in climate.master_bedroom and looking under the listed attributes for that entity,
1 Like

Thank you! This is exactly what I was looking for. I modified the line:

temperature: "{{ state_attr('climate.living_room','temperature')|float(18) -0.5 }}"

Where can I learn this syntax?

Glad it worked,

Regarding templating, you can start here,