I’m new to HA and am trying to emulate a Nest thermostat in HA with a temperature sensor and switch. I have added cards for the Generic Thermostat and Scheduler in HAOS running on a VM. The cards appear to work ok, i can turn the thermostat up and down and the relay responds accordingly and i can set up the on/off times in the scheduler. What’s missing is connecting the two so that the scheduler sets the the target temperatures according to a time/temperature profile. Could someone point me to a how-to to accomplish this?
You create an automation, e.g.
- id: '1728745464430'
alias: Atelier thermostat
description: ''
trigger:
- platform: state
entity_id:
- schedule.morning
to: 'on'
id: matin
- platform: state
entity_id:
- schedule.afternoon
id: aprem
to: 'on'
- platform: state
entity_id:
- schedule.evening
id: soir
to: 'on'
- platform: state
entity_id:
- schedule.night
id: nuit
to: 'on'
condition: []
action:
- choose:
- conditions:
- condition: state
entity_id: binary_sensor.office_day_sensor
state: "on"
sequence:
- action: climate.set_preset_mode
metadata: {}
data:
preset_mode: away
target:
entity_id: climate.atelier
# - conditions:
# - condition: trigger
# id:
# - matin
# sequence:
# - action: climate.set_preset_mode
# metadata: {}
# data:
# preset_mode: eco
# target:
# entity_id: climate.atelier
# - conditions:
# - condition: trigger
# id:
# - aprem
# sequence:
# - action: climate.set_preset_mode
# metadata: {}
# data:
# preset_mode: eco
# target:
# entity_id: climate.atelier
- conditions:
- condition: trigger
id:
- soir
- nuit
sequence:
- action: climate.set_preset_mode
metadata: {}
data:
preset_mode: away
target:
entity_id: climate.atelier
default:
- action: climate.set_preset_mode
metadata: {}
data:
preset_mode: away
target:
entity_id: climate.atelier
mode: single
The easy way is setup presets in generic thermostat, then use an automation triggered by time to change the preset and switch to the required mode.
All explained here.
Thanks for your reply. Being new to HA, does this code go in the automations.yaml file? Can this be done in the UI or only in the File Editor?
Also Nest thermostats have a time/temperature profile. I don’t see that here, it seems to switch on/off at set times.
Don’t copy it verbatim, it’s just a specific example.
If you are new to HA, definitely use the Automation UI.
No, it sets presets depending on schedule:
- action: climate.set_preset_mode
metadata: {}
data:
preset_mode: away
target:
entity_id: climate.atelier
This seems limited to the predefined presets in the Generic Thermostat. I’d prefer to define my own set such as wake, morning, afternoon etc. and have a nice UI card to adjust the setpoints.