Is it posible to have 'Boost' in generic_thermostat?

Is it possible to have a ‘Boost’ preset in generic_thermostat, whereby it will set the heating to +0.5°C above the set temperature for 1 hour? If not possible as a preset in configuration, maybe it could be done in automations?

My current configurations is below and has a target temperature, however I would prefer that the boost is +0.5°C of the current set temperature, rather than the target temperature:

climate:
  - platform: generic_thermostat
    name: "Thermostat"
    heater: switch.lounge_heater
    target_sensor: sensor.average_temp
    min_temp: 10
    max_temp: 24
    ac_mode: false
    target_temp: 19.0
    cold_tolerance: 0.2
    hot_tolerance: 0.1
    precision: 0.1
    keep_alive:
      minutes: 3    
    away_temp: 11

Two automations and an input boolean should do it.

Create a ‘Boost’ input boolean.

First Automation:
Trigger on the Boost input boolean turning on.
Store the current climate scene
Set the temp +0.5°C

Second Automation:
Trigger on the boost input boolean being on for xx minutes.
Restore the previous climate scene
Turn off the Boost input boolean.

See here for creating and restoring scenes:

You could even use an input number for the xx minutes in the second automation if you want it to be variable. for: in the trigger is templatable.

e.g.

  trigger:
  - platform: state
    entity_id: input_boolean.boost
    to: 'on'
    for:
      minutes: "{{ states('input_number.boost_time')|int }}"

I’m currently already using climate scenes for my heating:

- id: '1576697224'
  alias: Thermostat - We're Not Home - Retain Settings
  description: ''
  trigger:
  - entity_id: group.parents
    platform: state
    to: not_home
  condition: []
  action:
  - service: scene.create
    data:
      scene_id: before_leaving
      snapshot_entities:
      - climate.thermostat
  - data:
      entity_id: climate.thermostat
      preset_mode: away
    service: climate.set_preset_mode
- id: '1576697243'
  alias: Thermostat - We're Home - Recall Settings
  description: ''
  trigger:
  - entity_id: group.parents
    platform: state
    to: home
  condition: []
  action:
  - service: scene.turn_on
    data:
      entity_id: scene.before_leaving

Neat. Just create a boost scene and automate it as above then.

How would I trigger it though?

If calling it manually:
First Automation:
Trigger on the Boost input boolean turning on.

Second Automation:
Trigger on the boost input boolean being on for xx minutes.

If you want it to happen automatically, you could trigger on a template that looks at the set temp and the current temp. e.g. if there is a large difference even though the heat has been on for xx minutes.

Thanks, I’ll need to do some reading up on input_boolean, as I currently dont use it.

It’s pretty simple. Looks like a switch in your front end.

input_boolean:
  boost:
    name: Boost
    icon: mdi:thermometer

Any chance anyone could show me what this would look like in automation.yaml? I know how to store the scene, but not sure how to add the boost value.

Use the set temperature service. Like this I think (I don’t use the climate integration):

    - service: climate.set_temperature
      data_template:
        entity_id: climate.thermostat
        temperature: "{{ state_attr('climate.thermostat', 'temperature')|float + 0.5 }}"

I’ve not tried validating it yet, but does this look right?

  alias: Turn on boost 
  trigger:
  - platform: state
    entity_id: input_boolean.boost
    to: 'on'
    for:
      minutes: "{{ states('input_number.boost_time')|int }}"
  action:
  - service: scene.create
    data:
      scene_id: before_boost
      snapshot_entities:
      - climate.thermostat
  - data:
      entity_id: climate.thermostat
  - service: climate.set_temperature
    data_template:
      entity_id: climate.thermostat
      temperature: "{{ state_attr('climate.thermostat', 'temperature')|float + 0.5 }}"

  alias: Turn off boost
  trigger:
  - platform: state
    entity_id: input_boolean.boost
    to: 'off'
    action:
  - service: scene.turn_off
    data:
      entity_id: scene.before_boost

Only if you want the boost to turn on after a delay of xx minutes. If you were aiming to have the boost “be on for xx minutes” you need to move the for: template to the other automation.

Also you need to turn the scene before_boost on in the second automation, not off.

Also, also there was a stray data with no service, only an entity id. I deleted it.

Also I fixed the triggers required for the second automation. One to revert the scene if the input boolean is turned off manually, one for the xx minute time out.

And finally I added the service to turn the input boolean off in the case of a time out. You could put a condition in there to only turn it off if it is on but turning it off if it is off already (i.e. manual boost cancel) does not hurt.

  alias: Turn on boost 
  trigger:
  - platform: state
    entity_id: input_boolean.boost
    to: 'on'
  action:
  - service: scene.create
    data:
      scene_id: before_boost
      snapshot_entities:
      - climate.thermostat
  - service: climate.set_temperature
    data_template:
      entity_id: climate.thermostat
      temperature: "{{ state_attr('climate.thermostat', 'temperature')|float + 0.5 }}"

  alias: Turn off boost
  trigger:
  - platform: state # manual cancel
    entity_id: input_boolean.boost
    to: 'off'
  - platform: state # time out
    entity_id: input_boolean.boost
    to: 'on'
    for:
      minutes: "{{ states('input_number.boost_time')|int }}"
    action:
  - service: scene.turn_on
    data:
      entity_id: scene.before_boost
  - service: input_boolean.turn_off # for the time out trigger case.
     entity_id: input_boolean.boost
2 Likes

tom_l, I made a bit of a mess of it then :laughing:

Thanks for all your help on this, much appreciated.

1 Like

I have it primarily working thanks to tom_l’s code above, but have a couple of questions. When I add it to the frontend as an entity, I get two buttons (or switches), but I have to press them and then press trigger to get it to action. Is there a way to just have the trigger in the frontend?

Also, how/where do I set the duration of the boost?

Screenshot from 2019-12-24 19-20-26
Screenshot from 2019-12-24 19-20-43

You have added the automations to the front end. Remove them ( make sure they are on first) and just add the boost input boolean. This is your trigger.

There is nothing of this name to add.

Did you not add this?

input_boolean:
  boost:
    name: Boost
    icon: mdi:thermometer

No, where do I add that to? Sorry, but I’ve never used input boolean in HA

In configuration.yaml.

Thanks. I now have this in configuration.yaml, which gives me a switch and a slider for setting on time in the frontend:

input_boolean:
  boost:
    name: Boost
    icon: mdi:thermometer
    
input_number:
  boost_time:
    name: Boost Time (mins)
    initial: 30
    min: 10
    max: 60
    step: 1