Automation to increase & decrease a climate generic_thermostat's "set" value

I’ve got a generic_thermostat setup. It works fine within the HASS WebUI.

I also have wall push switches, (tasmota,esp8266 stuff, call it a “tasmota-push-button” ) that I can send mqtt to Hass, and see the switch go on an off in hass.

Now what I’d like to do in an Automation is …

hass automation triggers on the on the tasmota-push-button ( I can do this , I’ve already done this with simple toggle switching automations on lights .)

hass then increases the “set” value on the generic_thermostat . (there’d be a second button, and automation, to do a decrease “Set” value)
(set I guess could be called target value )

in the Actions part, it looks like I can “Call Service”, and select a generic_thermostat, but I can’t see a way of just increasing the generic_thermostat by say 1 degree Celcius.

All I can get to work is it to set a static value.

( I don’t want a control panel of say about 10 buttons to set from 15 to 24 degrees C , with I could do with just setting static values ! )

You can template it.

Template it

"{{state_attr('climate.genericthermostat', 'current_temperature') | int + 1}}"

Current temperature is the current room temp, temperature is the setpoint.

thanks for the reply.

I got the template working in the Dev Tools Template , and yes, I can get it to add 1 to the 'temperature"

using the WebUI , I tried puttting the template in the automation action yaml . But can’t get it to work

I’d picked “Call Service”
“Climate :Set Temperature”
Target , I chose an climate entity.

I can’t paste the yaml in the “Temperature” box, and Edit in Yaml didn’t work either …
where am I going wrong ?

many thanks in advance :slight_smile:

Thanks all. I did fix it. In the yaml edit mode , I needed to frickin double quote the template ! Doh !
( I should have realised that )

Hi Karl,

I need exactly the same, but how do you ‘call’ this template from an automation?

try these scripts:

increment_climate_temperature:
  alias: Increase climate temperature
  description: used by climate card in minimalist view
  sequence:
  - action: climate.set_temperature
    data_template:
      entity_id: '{{ entity_id }}'
      temperature: '{{ (state_attr(entity_id, ''temperature'') | float) + ( 0.5 |
        float) | float }}'
  mode: single
decrease_climate_temperature:
  alias: Decrease climate temperature
  sequence:
  - action: climate.set_temperature
    data_template:
      entity_id: '{{ entity_id }}'
      temperature: '{{ (state_attr(entity_id, ''temperature'') | float) - (0.5 | float)
        | float }}'
  mode: single

Thank you!

It didn’t work as it is, needed some syntax changes, but this one is OK:

action: climate.set_temperature
data:
temperature: “{{state_attr(‘climate.thermostat’, ‘temperature’) | float + 0.1}}”
target:
entity_id: climate.thermostat