How to set schedule on Honeywell TH6320ZW2003 thermostat

I have successfully paired my Honeywell TH6320ZW2003 thermostat with Home Assistant using the Aeotec Z-Stick Gen5. It works fine… I can turn the heat and AC on and off and can change the temperature but I don’t see any way to adjust the schedule that I have programmed directly on the thermostat. I am switching away from Total Connect 2.0 to Home Assistant. Total Connect 2.0 allowed me to change the schedule (although it wouldn’t let the “heat to” and “cool to” temperatures get within 3 degrees of each other even though the thermostat allows it) so I’m assuming there is a way to control the schedule via Home Assistant. Any suggestions are much appreciated.

1 Like

Once you connect the thermostat to Z-Wave, the schedule in the thermostat is no longer used. I used packages to make my yaml based schedule. Schedy is app-daemon based and another way to do it.

What I made is essentially a 4 period schedule, because that’s how I wanted it.

Morning: at 6:00a, change setpoint, change fan mode
Away: if unocc, change setpoint, change fan mode
Home: if occ or home 2 hours after Morning, change setpoint, change fan mode
Sleep: at 10:00p, change setpoint, change fan mode

The config has changed a little bit since there is only one entity for the thermostat, so it will only send the setpoint for the current mode. I have another yaml package that will switch modes if it gets warm or cool.

So any time you want to change the schedule you have to change it in the YAML file? I was hoping there was a way to change the schedule via the Home Assistant UI otherwise it’s just as easy to change it on the thermostat directly. Total Connect 2.0 allowed me to change it in the iOS app which must have overridden the schedule on the thermostat like you said but that would be fine with me as long as I can control it in the Home Assistant UI.

Negative. I use input booleans, input selects, and date time objects that are changed via UI.

Below is part of my schedule config, but only the UI portions. The groups are used for a popup in lovelace. It is part of a single package and I used node anchors throughout to cut down as much as I could.

group:
  hvac_morning:
    friendly_name: "Morning"
    icon: mdi:weather-sunset
    entities:
    - input_datetime.hvac_morning
    - input_number.hvac_morning_heat_sp
    - input_number.hvac_morning_cool_sp
    - input_select.hvac_morning_fan_mode
  hvac_away:
    friendly_name: "Leave"
    icon: mdi:home-outline
    entities:
    - input_number.hvac_away_heat_sp
    - input_number.hvac_away_cool_sp
    - input_select.hvac_away_fan_mode
  hvac_home:
    friendly_name: "Arrive"
    icon: mdi:home
    entities:
    - input_number.hvac_occ_after_morning
    - input_number.hvac_home_heat_sp
    - input_number.hvac_home_cool_sp
    - input_select.hvac_home_fan_mode
  hvac_sleep:
    friendly_name: "Sleep"
    icon: mdi:bed-empty
    entities:
    - input_datetime.hvac_sleep
    - input_number.hvac_sleep_heat_sp
    - input_number.hvac_sleep_cool_sp
    - input_select.hvac_sleep_fan_mode

input_number:
  hvac_morning_heat_sp: &sched-heat
    name: Heat
    min: 62
    max: 72
    step: 1
    icon: mdi:fire
    unit_of_measurement: °F
    mode: box
  hvac_morning_cool_sp: &sched-cool
    name: Cool
    min: 72
    max: 80
    step: 1
    icon: mdi:snowflake
    unit_of_measurement: °F
    mode: box
  hvac_away_heat_sp: *sched-heat
  hvac_away_cool_sp: *sched-cool
  hvac_home_heat_sp: *sched-heat
  hvac_home_cool_sp: *sched-cool
  hvac_sleep_heat_sp: *sched-heat
  hvac_sleep_cool_sp: *sched-cool
  
  hvac_occ_after_morning:
    name: Home After
    min: 1
    max: 6
    step: 0.5
    icon: mdi:timer-sand
    unit_of_measurement: hrs
    mode: box

input_datetime:
  hvac_morning: &sched-time
    name: Time
    has_date: false
    has_time: true
  hvac_sleep: *sched-time

input_select:
  hvac_morning_fan_mode: &sched-fan
    name: Fan Mode
    options:
      - On Low
      - Circulate
      - Auto Low
    initial: Circulate
  hvac_away_fan_mode:
    <<: *sched-fan
    initial: Auto Low
  hvac_home_fan_mode:
    <<: *sched-fan
  hvac_sleep_fan_mode:
    <<: *sched-fan
    initial: On Low
  hvac_recent_change:
    name: '[hvac] Recent Change'
    options:
      - morning
      - away
      - home
      - sleep

Which looks like:

1 2

3 Likes

Oh perfect. I will look into doing the same thing and may have more follow up questions. Thanks for steering me in the right direction.

How did you connect your TH6320ZW2003 thermostat to ha? It’s currently connect to my alarm.com panel and I file want Adt to see what my HVAC is doing.

I have an Aeotec Gen5 dongle using ZwaveJS2MQTT.

Yup sorry I didn’t put in there I have that installed. Here is my main post.

I know this more than a year old, but you can you share more details on how you did this ?

Sure! What would you like to know?

I would like to see the automation side. I have setup a basic automation but would like to make it better.
I am trying to simulate the 5-2-2 type schedule (weekdays-weekend-2 periods) and ultimately try to estimate when should heating be turned on to reach the target temperature at the set time

Mine is just a daily 4 period schedule. Using occupancy status to change between home and away.

The recent change portion is to make sure the thermostat has been changed to the correct setpoint. The setpoint commands seem to take without retry on the TH6320.

HVAC Schedule YAML Package
################################################################
## Packages / HVAC Schedule Config
################################################################

## EXTERNAL REFERENCES:
## group.occ_card
## sensor.time

## AUTOMATION GROUP TO BE ENABLED
## group.z_hvac_schedule

################################################
## Customize
################################################

homeassistant:
  customize:
    ################################################
    ## Node Anchors
    ################################################

    package.node_anchors:
      customize: &customize
        package: 'hvac_schedule'

      expose: &expose
        <<: *customize
        haaska_hidden: false
        homebridge_hidden: false
        
    group.hvac_morning:
      <<: *customize
      friendly_name: "Morning"
      icon: mdi:weather-sunset
    group.hvac_away:
      <<: *customize
      friendly_name: "Leave"
      icon: mdi:home-outline
    group.hvac_home:
      <<: *customize
      friendly_name: "Arrive"
      icon: mdi:home
    group.hvac_sleep:
      <<: *customize
      friendly_name: "Sleep"
      icon: mdi:bed-empty
        
################################################
## History
################################################

history:
  exclude:
    entities:
    - input_datetime.hvac_morning
    - input_number.hvac_morning_heat_sp
    - input_number.hvac_morning_cool_sp
    - input_select.hvac_morning_fan_mode
    - input_number.hvac_away_heat_sp
    - input_number.hvac_away_cool_sp
    - input_select.hvac_away_fan_mode
    - input_number.hvac_home_heat_sp
    - input_number.hvac_home_cool_sp
    - input_select.hvac_home_fan_mode
    - input_datetime.hvac_sleep
    - input_number.hvac_sleep_heat_sp
    - input_number.hvac_sleep_cool_sp
    - input_select.hvac_sleep_fan_mode

################################################
## Group
################################################

group:
  hvac_morning:
    entities:
    - input_datetime.hvac_morning
    - input_number.hvac_morning_heat_sp
    - input_number.hvac_morning_cool_sp
    - input_select.hvac_morning_fan_mode
  hvac_away:
    entities:
    - input_number.hvac_away_heat_sp
    - input_number.hvac_away_cool_sp
    - input_select.hvac_away_fan_mode
  hvac_home:
    entities:
    - input_datetime.hvac_home
    - input_number.hvac_home_heat_sp
    - input_number.hvac_home_cool_sp
    - input_select.hvac_home_fan_mode
  hvac_sleep:
    entities:
    - input_datetime.hvac_sleep
    - input_number.hvac_sleep_heat_sp
    - input_number.hvac_sleep_cool_sp
    - input_select.hvac_sleep_fan_mode
  z_hvac_schedule:
    entities:
    #- automation.hvac_start_timer_occ
    #- automation.hvac_start_timer_unocc
    - automation.hvac_time_schedule_event
    - automation.hvac_occ_after_morning_event
    - automation.hvac_occ_for_5_min
    - automation.hvac_unocc_for_5_min
    - automation.hvac_schedule_sleep_event
    - automation.hvac_recent_change_loop

################################################
## Input Boolean
################################################

input_boolean:
  hvac_recent_change:
    initial: false

################################################
## Input Number
################################################

input_number:
  hvac_morning_heat_sp: &sched-heat
    name: Heat
    min: 62
    max: 72
    step: 1
    icon: mdi:fire
    unit_of_measurement: °F
    mode: box
  hvac_morning_cool_sp: &sched-cool
    name: Cool
    min: 72
    max: 80
    step: 1
    icon: mdi:snowflake
    unit_of_measurement: °F
    mode: box
  hvac_away_heat_sp: *sched-heat
  hvac_away_cool_sp: *sched-cool
  hvac_home_heat_sp: *sched-heat
  hvac_home_cool_sp: *sched-cool
  hvac_sleep_heat_sp: *sched-heat
  hvac_sleep_cool_sp: *sched-cool

################################################
## Input Datetime
################################################

input_datetime:
  hvac_morning: &sched-time
    name: Time
    has_date: false
    has_time: true
  hvac_home: *sched-time
  hvac_sleep: *sched-time

################################################
## Input Select
################################################
    
input_select:
  hvac_morning_fan_mode: &sched-fan
    name: Fan Mode
    options:
      - Low
      - Circulation
      - Auto low
    #initial: Circulation
  hvac_away_fan_mode:
    <<: *sched-fan
    #initial: Auto low
  hvac_home_fan_mode:
    <<: *sched-fan
  hvac_sleep_fan_mode:
    <<: *sched-fan
    #initial: Low
  hvac_recent_change:
    name: '[hvac] Recent Change'
    options:
      - morning
      - away
      - home
      - sleep

timer:
  occ:
    name: Arrive Timer
    duration: '00:05:00'
    icon: mdi:home
  unocc:
    name: Leaving Timer
    duration: '00:05:00'
    icon: mdi:home-outline

################################################
## Automations
################################################

automation:

- alias: '[hvac] occ timer control'
  mode: restart
  trigger:
    - platform: state
      entity_id: group.occ_card
  action:
    - choose:
        - conditions: "{{ trigger.to_state.state == 'home' }}"
          sequence:
            - service: timer.cancel
              entity_id: timer.unocc
            - service: timer.start
              entity_id: timer.occ
        - conditions: "{{ trigger.to_state.state == 'not_home' }}"
          sequence:
            - service: timer.cancel
              entity_id: timer.occ
            - service: timer.start
              entity_id: timer.unocc

- alias: '[hvac] time schedule event'
  trigger:
    platform: time
    at: input_datetime.hvac_morning
  condition: &condition-home
    condition: state
    entity_id: group.occ_card
    state: 'home'
  action:
    - service: script.hvac_schedule_morning

- alias: '[hvac] occ after morning event'
  trigger:
    platform: time
    at: input_datetime.hvac_home
  condition: *condition-home
  action:
    - service: script.hvac_schedule_home

- alias: '[hvac] occ for 5 min'
  trigger:
    - platform: event
      event_type: timer.finished
      event_data:
        entity_id: timer.occ
  action:
    - choose:
        - conditions:
            - condition: time
              after: input_datetime.hvac_sleep
              before: input_datetime.hvac_morning
          sequence:
            - service: script.hvac_schedule_sleep
      default:
        - service: script.hvac_schedule_home

- alias: '[hvac] unocc for 5 min'
  trigger:
    - platform: event
      event_type: timer.finished
      event_data:
        entity_id: timer.unocc
  action:
    - service: script.hvac_schedule_away

- alias: '[hvac] schedule sleep event'
  trigger:
    platform: time
    at: input_datetime.hvac_sleep
  condition: *condition-home
  action:
    - service: script.hvac_schedule_sleep

- alias: '[hvac] recent change loop'
  trigger:
    - platform: state
      entity_id: input_boolean.hvac_recent_change
      to: 'on'
      for:
        minutes: 2
  action:
    - service: input_boolean.turn_off
      entity_id: input_boolean.hvac_recent_change
    - condition: template
      value_template: >
        {% set t = state_attr('climate.hvac_thermostat_mode','temperature') %}
        {% set m = states('climate.hvac_thermostat_mode') %}
        {% set r = states('input_select.hvac_recent_change') %}
        {% set rc = states('input_number.hvac_' ~ r ~ '_' ~ m ~ '_sp') | int %}
        {{ true if t != rc else false }}
    - service_template: >
        script.hvac_schedule_{{ states('input_select.hvac_recent_change') | lower }}

################################################
## Scripts
################################################

script:
  hvac_schedule_morning:
    alias: '[hvac] schedule morning'
    sequence:
    - service: climate.set_temperature
      entity_id: climate.hvac_thermostat_mode
      data_template:
        temperature: >
          {% set m = states('climate.hvac_thermostat_mode') %}
          {{ states('input_number.hvac_morning_' ~ m ~ '_sp') | float }}
    - service: climate.set_fan_mode
      entity_id: climate.hvac_thermostat_mode
      data_template:
        fan_mode: "{{ states('input_select.hvac_morning_fan_mode') }}"
    - service: script.hvac_recent_change
      data:
        recent_change: morning
  hvac_schedule_away:
    alias: '[hvac] schedule away'
    sequence:
    - service: climate.set_temperature
      entity_id: climate.hvac_thermostat_mode
      data_template:
        temperature: >
          {% set m = states('climate.hvac_thermostat_mode') %}
          {{ states('input_number.hvac_away_' ~ m ~ '_sp') | float }}
    - service: climate.set_fan_mode
      entity_id: climate.hvac_thermostat_mode
      data_template:
        fan_mode: "{{ states('input_select.hvac_away_fan_mode') }}"
    - service: script.hvac_recent_change
      data:
        recent_change: away
  hvac_schedule_home:
    alias: '[hvac] schedule home'
    sequence:
    - service: climate.set_temperature
      entity_id: climate.hvac_thermostat_mode
      data_template:
        temperature: >
          {% set m = states('climate.hvac_thermostat_mode') %}
          {{ states('input_number.hvac_home_' ~ m ~ '_sp') | float }}
    - service: climate.set_fan_mode
      entity_id: climate.hvac_thermostat_mode
      data_template:
        fan_mode: "{{ states('input_select.hvac_home_fan_mode') }}"
    - service: script.hvac_recent_change
      data:
        recent_change: home
  hvac_schedule_sleep:
    alias: '[hvac] schedule sleep'
    sequence:
    - service: climate.set_temperature
      entity_id: climate.hvac_thermostat_mode
      data_template:
        temperature: >
          {% set m = states('climate.hvac_thermostat_mode') %}
          {{ states('input_number.hvac_sleep_' ~ m ~ '_sp') | float }}
    - service: climate.set_fan_mode
      entity_id: climate.hvac_thermostat_mode
      data_template:
        fan_mode: "{{ states('input_select.hvac_sleep_fan_mode') }}"
    - service: script.hvac_recent_change
      data:
        recent_change: sleep
  hvac_recent_change:
    alias: '[hvac] recent change'
    sequence:
    - service: input_boolean.turn_on
      entity_id: input_boolean.hvac_recent_change
    - service: input_select.select_option
      entity_id: input_select.hvac_recent_change
      data:
        option: "{{ recent_change }}"

What type of card was this? I was trying to follow along and create the same UI portion but I seem to be lost.

Horizontal stack for the group entities. Then using popup card function of browser mod for the entity card in the popup.

- type: horizontal-stack
  cards:
    - type: glance
      show_state: false
      entities:
        - group.hvac_morning
        - group.hvac_away
        - group.hvac_home
        - group.hvac_sleep
popup_cards:
  group.hvac_morning:
    title: Morning Settings
    card:
      type: entities
      entities:
        - input_datetime.hvac_morning
        - input_number.hvac_morning_heat_sp
        - input_number.hvac_morning_cool_sp
        - input_select.hvac_morning_fan_mode

Hey walrus_parka thanks for the thermostat package. This is exactly what I was looking for. I’m having a problem though where the input datetimes are not editable on in the popup cards. Do you know why that might be?

I’ve got a stupid question. but when you have stuff like *sched- and trigger.to_state.state == home / or away are we supposed to create our own triggers there? based on what we want to trigger home/away?

Example in the occ after morning event you have condition: *id001 where is id001 defined? or what exactly is that?

Thanks!

The ampersand and asterisk characters are yaml anchors and aliases are what follow. It was to cut down on repetition in the same yaml file where I was allowed.

&condition-home is the declaration
*condition-home is the recall
<< is another anchor that will have an override to a declared variable

trigger.to_state.state is the state of the entity that triggered the automation.

Hi, i’ve got a few questions about about how this setup works. Admittedly, I’m new to HA and I’ve only ever coded in python so I’m a bit confused about how to use the above yaml package

I’m running a Honeywell TH6320ZW2003, Z-wave JS, an Aeotec gen-5 stick, on a docker install of Homeassistant, and I’d like to control the daily thermostat schedule directly from HA. I’m in a similar situation as OP where my thermostat is connected, but there’s no obvious way to set a schedule from within the HA UI. What YAML file does this code get pasted into in order to establish the interface with the thermostat? (Is there perhaps a simpler way to configure a basic daily heating schedule from within the HA automations UI?)

It’s a yaml package. Detailed in the following link. Just another method to organize items. A package can contain all of the automations, scripts, and helpers in a single file.

There is probably an easier way, but would probably require an addon.

Home Assistant has had a lot of updates since I first made that package, but it still works so I haven’t had a need to overhaul it. I’ve made small changes along the way to reduce the length a bit.

Updated Yaml
################################################################
## Packages / HVAC Schedule Config
################################################################

## EXTERNAL REFERENCES:
## group.occ_card
## sensor.time

## AUTOMATION GROUP TO BE ENABLED
## group.z_hvac_schedule

################################################
## Customize
################################################

homeassistant:
  customize:
    ################################################
    ## Node Anchors
    ################################################

    package.node_anchors:
      customize: &customize
        package: 'hvac_schedule'

      expose: &expose
        <<: *customize
        haaska_hidden: false
        homebridge_hidden: false
        
    group.hvac_morning:
      <<: *customize
      friendly_name: "Morning"
      icon: mdi:weather-sunset-up
    group.hvac_away:
      <<: *customize
      friendly_name: "Leave"
      icon: mdi:home-outline
    group.hvac_home:
      <<: *customize
      friendly_name: "Arrive"
      icon: mdi:home
    group.hvac_evening:
      <<: *customize
      friendly_name: "Evening"
      icon: mdi:weather-sunset-down
    group.hvac_sleep:
      <<: *customize
      friendly_name: "Sleep"
      icon: mdi:bed-empty
        
################################################
## History
################################################

history:
  exclude:
    entities:
    - input_datetime.hvac_morning
    - input_number.hvac_morning_heat_sp
    - input_number.hvac_morning_cool_sp
    - input_select.hvac_morning_fan_mode
    - input_number.hvac_away_heat_sp
    - input_number.hvac_away_cool_sp
    - input_select.hvac_away_fan_mode
    - input_number.hvac_home_heat_sp
    - input_number.hvac_home_cool_sp
    - input_select.hvac_home_fan_mode
    - input_datetime.hvac_evening
    - input_number.hvac_evening_heat_sp
    - input_number.hvac_evening_cool_sp
    - input_select.hvac_evening_fan_mode
    - input_datetime.hvac_sleep
    - input_number.hvac_sleep_heat_sp
    - input_number.hvac_sleep_cool_sp
    - input_select.hvac_sleep_fan_mode

################################################
## Group
################################################

group:
  hvac_morning:
    entities:
    - input_datetime.hvac_morning
    - input_number.hvac_morning_heat_sp
    - input_number.hvac_morning_cool_sp
    - input_select.hvac_morning_fan_mode
  hvac_away:
    entities:
    - input_number.hvac_away_heat_sp
    - input_number.hvac_away_cool_sp
    - input_select.hvac_away_fan_mode
  hvac_home:
    entities:
    - input_datetime.hvac_home
    - input_number.hvac_home_heat_sp
    - input_number.hvac_home_cool_sp
    - input_select.hvac_home_fan_mode
  hvac_evening:
    entities:
    - input_datetime.hvac_evening
    - input_number.hvac_evening_heat_sp
    - input_number.hvac_evening_cool_sp
    - input_select.hvac_evening_fan_mode
  hvac_sleep:
    entities:
    - input_datetime.hvac_sleep
    - input_number.hvac_sleep_heat_sp
    - input_number.hvac_sleep_cool_sp
    - input_select.hvac_sleep_fan_mode
  z_hvac_schedule:
    entities:
    - automation.hvac_time_schedule_event
    - automation.hvac_occ_for_5_min
    - automation.hvac_unocc_for_5_min
    - automation.hvac_recent_change_loop

################################################
## Input Boolean
################################################

input_boolean:
  hvac_recent_change:
    initial: false

################################################
## Input Number
################################################

input_number:
  hvac_morning_heat_sp: &sched-heat
    name: Heat
    min: 62
    max: 72
    step: 1
    icon: mdi:fire
    unit_of_measurement: °F
    mode: box
  hvac_morning_cool_sp: &sched-cool
    name: Cool
    min: 72
    max: 80
    step: 1
    icon: mdi:snowflake
    unit_of_measurement: °F
    mode: box

  hvac_away_heat_sp: *sched-heat
  hvac_away_cool_sp: *sched-cool

  hvac_home_heat_sp: *sched-heat
  hvac_home_cool_sp: *sched-cool

  hvac_home_fan_circ: 
    <<: *sched-heat
    name: Circ Fan
    min: 32
    max: 65
    icon: mdi:fan

  hvac_evening_heat_sp: *sched-heat
  hvac_evening_cool_sp: *sched-cool

  hvac_sleep_heat_sp: *sched-heat
  hvac_sleep_cool_sp: *sched-cool

################################################
## Input Datetime
################################################

input_datetime:
  hvac_morning: &sched-time
    name: Time
    has_date: false
    has_time: true
  hvac_home: *sched-time
  hvac_evening: *sched-time
  hvac_sleep: *sched-time

################################################
## Input Select
################################################
    
input_select:
  hvac_morning_fan_mode: &sched-fan
    name: Fan Mode
    options:
      - Low
      - Circulation
      - Auto low
    #initial: Circulation
  hvac_away_fan_mode:
    <<: *sched-fan
    #initial: Auto low
  hvac_home_fan_mode:
    <<: *sched-fan
  hvac_evening_fan_mode:
    <<: *sched-fan
  hvac_sleep_fan_mode:
    <<: *sched-fan
    #initial: Low
  hvac_recent_change:
    name: '[hvac] Recent Change'
    options:
      - morning
      - away
      - home
      - evening
      - sleep

timer:
  occ:
    name: Arrive Timer
    duration: '00:05:00'
    icon: mdi:home
  unocc:
    name: Leaving Timer
    duration: '00:05:00'
    icon: mdi:home-outline

################################################
## Automations
################################################

automation:

- alias: '[hvac] occ timer control'
  mode: restart
  trigger:
    - platform: state
      entity_id: group.occ_card
  action:
    - choose:
        - conditions: "{{ trigger.to_state.state == 'home' }}"
          sequence:
            - service: timer.cancel
              entity_id: timer.unocc
            - service: timer.start
              entity_id: timer.occ
        - conditions: "{{ trigger.to_state.state == 'not_home' }}"
          sequence:
            - service: timer.cancel
              entity_id: timer.occ
            - service: timer.start
              entity_id: timer.unocc

- alias: '[hvac] time schedule event'
  mode: single
  trigger:
    - id: morning
      platform: time
      at: input_datetime.hvac_morning
    - id: home
      platform: time
      at: input_datetime.hvac_home
    - id: evening
      platform: time
      at: input_datetime.hvac_evening
    - id: sleep
      platform: time
      at: input_datetime.hvac_sleep
  condition: &condition-home
    - condition: state
      entity_id: group.occ_card
      state: 'home'
  action:
    - choose:
      - conditions:
          - condition: trigger
            id: 'morning'
        sequence:
          - service: script.hvac_schedule_morning
      - conditions:
          - condition: trigger
            id: 'home'
        sequence:
          - service: script.hvac_schedule_home
      - conditions:
          - condition: trigger
            id: 'evening'
        sequence:
          - service: script.hvac_schedule_evening
      - conditions:
          - condition: trigger
            id: 'sleep'
        sequence:
          - service: script.hvac_schedule_sleep

- alias: '[hvac] occ for 5 min'
  trigger:
    - platform: event
      event_type: timer.finished
      event_data:
        entity_id: timer.occ
  action:
    - choose:
        - conditions:
            - condition: time
              after: input_datetime.hvac_sleep
              before: input_datetime.hvac_morning
          sequence:
            - service: script.hvac_schedule_sleep
        - conditions:
            - condition: time
              after: input_datetime.hvac_evening
              before: input_datetime.hvac_sleep
          sequence:
            - service: script.hvac_schedule_evening
      default:
        - service: script.hvac_schedule_home

- alias: '[hvac] unocc for 5 min'
  trigger:
    - platform: event
      event_type: timer.finished
      event_data:
        entity_id: timer.unocc
  action:
    - service: script.hvac_schedule_away

- alias: '[hvac] recent change loop'
  trigger:
    - platform: state
      entity_id: input_boolean.hvac_recent_change
      to: 'on'
      for:
        minutes: 2
  action:
    - service: input_boolean.turn_off
      entity_id: input_boolean.hvac_recent_change
    - condition: template
      value_template: >
        {% set t = state_attr('climate.hvac_thermostat_mode','temperature') %}
        {% set m = states('climate.hvac_thermostat_mode') %}
        {% set r = states('input_select.hvac_recent_change') %}
        {% set rc = states('input_number.hvac_' ~ r ~ '_' ~ m ~ '_sp') | int %}
        {{ true if t != rc else false }}
    - service_template: >
        script.hvac_schedule_{{ states('input_select.hvac_recent_change') | lower }}

################################################
## Scripts
################################################

script:
  hvac_schedule_morning:
    alias: '[hvac] schedule morning'
    sequence:
    - service: climate.set_temperature
      entity_id: climate.hvac_thermostat_mode
      data_template:
        temperature: >
          {% set m = states('climate.hvac_thermostat_mode') %}
          {{ states('input_number.hvac_morning_' ~ m ~ '_sp') | float(default=0) }}
    - service: climate.set_fan_mode
      entity_id: climate.hvac_thermostat_mode
      data_template:
        fan_mode: "{{ states('input_select.hvac_morning_fan_mode') }}"
    - service: script.hvac_recent_change
      data:
        recent_change: morning
  hvac_schedule_away:
    alias: '[hvac] schedule away'
    sequence:
    - service: climate.set_temperature
      entity_id: climate.hvac_thermostat_mode
      data_template:
        temperature: >
          {% set m = states('climate.hvac_thermostat_mode') %}
          {{ states('input_number.hvac_away_' ~ m ~ '_sp') | float(default=0) }}
    - service: climate.set_fan_mode
      entity_id: climate.hvac_thermostat_mode
      data_template:
        fan_mode: "{{ states('input_select.hvac_away_fan_mode') }}"
    - service: script.hvac_recent_change
      data:
        recent_change: away
  hvac_schedule_home:
    alias: '[hvac] schedule home'
    sequence:
    - service: climate.set_temperature
      entity_id: climate.hvac_thermostat_mode
      data_template:
        temperature: >
          {% set m = states('climate.hvac_thermostat_mode') %}
          {{ states('input_number.hvac_home_' ~ m ~ '_sp') | float(default=0) }}
    - service: climate.set_fan_mode
      entity_id: climate.hvac_thermostat_mode
      data_template:
        fan_mode: "{{ states('input_select.hvac_home_fan_mode') }}"
    - service: script.hvac_recent_change
      data:
        recent_change: home
  hvac_schedule_evening:
    alias: '[hvac] schedule evening'
    sequence:
    - service: climate.set_temperature
      entity_id: climate.hvac_thermostat_mode
      data_template:
        temperature: >
          {% set m = states('climate.hvac_thermostat_mode') %}
          {{ states('input_number.hvac_evening_' ~ m ~ '_sp') | float(default=0) }}
    - service: climate.set_fan_mode
      entity_id: climate.hvac_thermostat_mode
      data_template:
        fan_mode: "{{ states('input_select.hvac_evening_fan_mode') }}"
    - service: script.hvac_recent_change
      data:
        recent_change: evening
  hvac_schedule_sleep:
    alias: '[hvac] schedule sleep'
    sequence:
    - service: climate.set_temperature
      entity_id: climate.hvac_thermostat_mode
      data_template:
        temperature: >
          {% set m = states('climate.hvac_thermostat_mode') %}
          {{ states('input_number.hvac_sleep_' ~ m ~ '_sp') | float(default=0) }}
    - service: climate.set_fan_mode
      entity_id: climate.hvac_thermostat_mode
      data_template:
        fan_mode: "{{ states('input_select.hvac_sleep_fan_mode') }}"
    - service: script.hvac_recent_change
      data:
        recent_change: sleep
  hvac_goodnight:
    alias: '[hvac] good night'
    sequence:
    - condition: state
      entity_id: group.occ_card
      state: home
    - condition: template
      value_template: "{{ now().hour >= 20 or now().hour <= 5 }}"
    - service: script.hvac_schedule_sleep
  hvac_recent_change:
    alias: '[hvac] recent change'
    sequence:
    - service: input_boolean.turn_on
      entity_id: input_boolean.hvac_recent_change
    - service: input_select.select_option
      entity_id: input_select.hvac_recent_change
      data:
        option: "{{ recent_change }}"

If you’re more familiar with python, you might want to have a go with AppDaemon.

https://appdaemon.readthedocs.io/en/latest/

Continuing the discussion from How to set schedule on Honeywell TH6320ZW2003 thermostat:

Thanks again Walrus, for sharing that package, I’ve been busy for the past couple weeks but got a chance to tinker with HA again today.

I incorporated that into my configuration.yaml file, and all the control tiles show up in the overview control panel, as they should. However, editing the schedule from these tiles doesn’t seem to actually do anything to my thermostat. Whenever the time on the schedule occurs, the setpoint doesn’t change. Could this mean that the entity names used in your package aren’t the right ones to control my particular thermostat? Also in my dashboard, I also get a tile that says:

image

and in the device page for my thermostat, every single entity gets a warning triangle, and is “unavailable” Does this suggest that there’s something wrong with the z-wave conncection from the thermostat to HA?