Generic Thermostat operation modes

Generic Thermostat operation modes are either “Heat & Off” or “Cool” & “Off” how can I set 3 operation modes “Heat” “Cool” “Off” ?

Now I set 2 Thermostats: one for heat and one for cool, it’s working but it should be in one Thermostat.

2

3

My setup is:
switch template > boolean > automation > script

configuration.yaml:

input_boolean:
accoolswitch:
initial: off
acheatswitch:
initial: off

switch:

  • platform: template
    switches:
    accool:
    value_template: “{{ is_state(‘input_boolean.accoolswitch’, ‘on’) }}”
    turn_on:
    service: input_boolean.turn_on
    data:
    entity_id: input_boolean.accoolswitch
    turn_off:
    service: input_boolean.turn_off
    data:
    entity_id: input_boolean.accoolswitch
    acheat:
    value_template: “{{ is_state(‘input_boolean.acheatswitch’, ‘on’) }}”
    turn_on:
    service: input_boolean.turn_on
    data:
    entity_id: input_boolean.acheatswitch
    turn_off:
    service: input_boolean.turn_off
    data:
    entity_id: input_boolean.acheatswitch

automations.yaml

  • alias: coolon
    trigger:
    • platform: state
      entity_id: input_boolean.accoolswitch
      to: ‘on’
      action:
    • service: script.ac_cool
  • alias: cooloff
    trigger:
    • platform: state
      entity_id: input_boolean.accoolswitch
      to: ‘off’
      action:
    • service: script.ac_off
  • alias: heaton
    trigger:
    • platform: state
      entity_id: input_boolean.acheatswitch
      to: ‘on’
      action:
    • service: script.ac_heat
  • alias: heatoff
    trigger:
    • platform: state
      entity_id: input_boolean.acheatswitch
      to: ‘off’
      action:
    • service: script.ac_off

scripts.yaml

‘ac_heat’:
alias: Heat
sequence:

  • data:
    command: Z6XHAPsBAABTAgAAmQYAADkRAACWFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAzIBAgIBAQIBAQIBAQICAQIBAgECAgICAgIBAgEBAQEBAgEBAgICAQEBAgIBAQECAgQDMgECAgEBAgEBAgEBAgIBAgECAQICAgICAgECAQEBAQECAQECAgIBAQECAgEBAQICAA
    entity_id: remote.xiaomi_miio_10_0_0_12
    service: remote.send_command
    ‘ac_cool’:
    alias: Cool
    sequence:
  • data:
    command: Z6XHACMCAAB4BgAAIhEAAE8RAAB6FAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAjEAAQEAAAEAAAEAAAEBAAEAAQABAQEBAQEAAQAAAAAAAAABAAAAAAABAQABAQEBAQQCMQABAQAAAQAAAQAAAQEAAQABAAEBAQEBAQABAAAAAAAAAAEAAAAAAAEBAAEBAQEBAA
    entity_id: remote.xiaomi_miio_10_0_0_12
    service: remote.send_command
    ‘ac_off’:
    alias: ‘Off’
    sequence:
  • data:
    command: Z6XHACMCAAB3BgAAHhEAAE8RAAB4FAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAjEAAQEAAAEAAAEAAAEBAAEAAQEBAQABAQEAAAAAAQAAAQEBAAAAAAAAAAABAQEBAQQCMQABAQAAAQAAAQAAAQEAAQABAQEBAAEBAQAAAAABAAABAQEAAAAAAAAAAAEBAQEBAA
    entity_id: remote.xiaomi_miio_10_0_0_12
    service: remote.send_command

You could use an input select with Heat, Off and Cool as options.

Hide the heat and cool switches and use an automation to change them based on the input select.

Thanks but I’d like to keep the manual switches and make the Generic Thermostat choose the desired mode.

Generic Thermostat receives only one switch, so probably needed to make 3rd boolean which chooses mode (if temp>27=cool elseif temp<23=heat)

Am I missing something?
Shouldn’t “Thermostat” be doing it by itself?
I thought it’s the purpose of thermostat to adjust temperature both ways, not only “on”/“off”.

The generic thermostat is defined as a heat or cool controller. Not both. So you will need two.

You can then control which one gets activated (or is even visible) based on temperature.