Create buttons to turn air con off in 30 mins/1 hour/2 hours

I want to create some buttons to turn the aircon off in 30mins, 1 hour, 2 hours. Something like below:

image

Ideally with the button remaining “pressed” when that timer is running.

I need to do this for 5 air con units so ideally I want to make it reusable rather than just creating 15 input booleans.

Any ideas on a clever way to do this?

would love to also know how to do this! did you get anywhere with this?

Hi,

Did you do it? and can you tell us how?

  1. create a script to start and then stop a device with a delay between the two actions
  2. edit a dashboard to which you add the previously created script entity and for the type of card choose button

To arrange several buttons vertically/horizontally, you have the option of adding a virtual stack or horizontal stack card to the dashboard

Whilst @vlad2005 answer is good I have multiple aircons and wanted multi options and I don’t like the increasing number of automations in my system. So I did this:

  1. Use the helpers to create an input_select helper. Added “Disabled” as the first entry and then “30”, “60”, *90", etc as the minutes.

Then I created this automation:

alias: Turn off Bedroom Aircon Timer
description: ""
trigger:
  - platform: state
    entity_id:
      - input_select.bedroom_aircon_off_time
condition: []
action:
  - choose:
      - conditions:
          - condition: state
            entity_id: input_select.bedroom_aircon_off_time
            state: Disabled
        sequence: []
    default:
      - delay: 00:{{ states('input_select.bedroom_aircon_off_time') | int }}:00
      - service: climate.turn_off
          entity_id: climate.bedroom_ac
      - service: input_select.select_option
        data:
          option: Disabled
        target:
          entity_id: input_select.bedroom_aircon_off_time
mode: restart
1 Like