This project uses standard HA elements (Helpers, Automations, Lovelace Cards) to set up a simple HVAC delayed stop timer for either of two fixed time durations, with the stop timer easily able to be cancelled. [Purpose was to keep it simple & avoid using addons or custom integrations to minimise being exposed to breaking changes].
Setup [Working with HA Core 2025.1.2]
- A Timer Helper used in a Tile card to count down time remaining e.g. “Daikin Sleep Timer”. [Timer Duration is setup as 0 as the timer duration is input using two selectable input boolean toggle helpers, select ‘restore state’ so that timer survives HA restarts. Note that Timer Helpers only count time down i.e. time remaining].
- Two separate Toggle helpers (i.e. Input Boolean Helpers) used in separate Tile cards to select the desired fixed time to HVAC turning off e.g. “Daikin Sleep - 2 Hrs” and “Daikin Sleep - 4 Hrs”. [these helpers are used input the associated fixed duration to the timer, the preset fixed durations are able to be edited in the automation to your preference]
Automation:
This activates the sleep timer based on which of the two toggle helpers/ input booleans are selected On (2 Hrs or 4Hrs) and turns the HVAC Off once the timer has run down to zero. The automation cancels the timer if the active helper is toggled Off, if the alternate helper is toggled On, or if the HVAC itself is turned off some other way.
alias: Automation Daikin - Sleep timer
description: >-
Turn off AC when the chosen sleep timer finishes, cancel the active sleep
timer if the A/C is turned off some other way
triggers:
- entity_id:
- binary_sensor.daikinap63347_hvac_status
to: "off"
trigger: state
id: AirCon Off
- entity_id:
- binary_sensor.daikinap63347_hvac_status
to: "on"
trigger: state
id: AirCon On
- trigger: state
entity_id:
- input_boolean.daikin_sleep_2_hrs
to: "on"
id: Timer 2hrs
- trigger: state
entity_id:
- input_boolean.daikin_sleep_2_hrs
to: "off"
id: Timer 2off
- trigger: state
entity_id:
- input_boolean.daikin_sleep_4_hrs
to: "on"
id: Timer 4hrs
- trigger: state
entity_id:
- input_boolean.daikin_sleep_4_hrs
to: "off"
id: Timer 4off
- trigger: state
entity_id:
- timer.daikin_sleep_timer
id: Timer End
for:
hours: 0
minutes: 0
seconds: 0
to: idle
conditions: []
actions:
- choose:
- conditions:
- condition: trigger
id:
- AirCon On
sequence:
- action: input_boolean.turn_off
metadata: {}
data: {}
target:
entity_id: input_boolean.daikin_sleep_2_hrs
- action: input_boolean.turn_off
metadata: {}
data: {}
target:
entity_id: input_boolean.daikin_sleep_4_hrs
- conditions:
- condition: trigger
id:
- AirCon Off
- condition: state
state: active
entity_id: timer.daikin_sleep_timer
sequence:
- action: timer.finish
metadata: {}
data: {}
target:
entity_id: timer.daikin_sleep_timer
- conditions:
- condition: trigger
id:
- Timer End
sequence:
- data: {}
action: climate.turn_off
target:
entity_id: climate.daikinap63347
- action: input_boolean.turn_off
metadata: {}
data: {}
target:
entity_id: input_boolean.daikin_sleep_2_hrs
- action: input_boolean.turn_off
metadata: {}
data: {}
target:
entity_id: input_boolean.daikin_sleep_4_hrs
- conditions:
- condition: trigger
id:
- Timer 2hrs
sequence:
- action: input_boolean.turn_off
metadata: {}
data: {}
target:
entity_id: input_boolean.daikin_sleep_4_hrs
- action: timer.start
metadata: {}
data:
duration: "02:00:00"
target:
entity_id: timer.daikin_sleep_timer
- conditions:
- condition: trigger
id:
- Timer 4hrs
sequence:
- action: input_boolean.turn_off
metadata: {}
data: {}
target:
entity_id: input_boolean.daikin_sleep_2_hrs
- action: timer.start
metadata: {}
data:
duration: "04:00:00"
target:
entity_id: timer.daikin_sleep_timer
- conditions:
- condition: trigger
id:
- Timer 2off
sequence:
- action: timer.cancel
metadata: {}
data: {}
target:
entity_id: timer.daikin_sleep_timer
- action: input_boolean.turn_off
metadata: {}
data: {}
target:
entity_id: input_boolean.daikin_sleep_2_hrs
- conditions:
- condition: trigger
id:
- Timer 4off
sequence:
- action: timer.cancel
metadata: {}
data: {}
target:
entity_id: timer.daikin_sleep_timer
- action: input_boolean.turn_off
metadata: {}
data: {}
target:
entity_id: input_boolean.daikin_sleep_4_hrs
mode: single
Dashboard Cards:
yaml code for Dashboard cards, the Timer tile card is set to touch action None.
[Note - Display of Timer real-time Duration countdown only works in Entities & Tile type cards, other cards will only refresh/ display the current Timer Duration when Timer is paused].
type: vertical-stack
cards:
- type: heading
heading_style: subtitle
heading: AirCon Off delay
- type: horizontal-stack
cards:
- type: horizontal-stack
cards:
- type: tile
vertical: true
icon: mdi:clock-end
color: green
name: Sleep-2Hrs
tap_action:
action: toggle
icon_tap_action:
action: toggle
hold_action:
action: none
entity: input_boolean.daikin_sleep_2_hrs
- type: tile
vertical: true
icon: mdi:clock-end
color: green
name: Sleep-4Hrs
tap_action:
action: toggle
icon_tap_action:
action: toggle
hold_action:
action: none
entity: input_boolean.daikin_sleep_4_hrs
- type: tile
icon: mdi:timelapse
color: amber
vertical: true
state_content: remaining_time
icon_tap_action:
action: none
hold_action:
action: none
name: Time 2 Sleep
tap_action:
action: none
entity: timer.daikin_sleep_timer