Set a time of day (from a drop down or slider), and fire an action at that time?

Hi,

I have a robot vacuum setup with Home Assistant. My idea is to have a drop down menu or a slider which let me set any time of day, and when this is active it will switch on the vacuum, and the slider/drop down will reset.

Is there any simple way to do this?
I want this because I usually close some door and move stuff around before leaving for work. And then I have to remember to start the vacuum manually.

I don’t want a recurring timer.

Search the forum for ‘alarm clock’ and you’ll find what you need.

Hi. Take a look at: Input_datetime initial value with time only (and the discussion around the issue)
This thread is what I finally used to get my “start coffee machine at a customisable time” automation going.

  • create an input_datetime for the time of day (text fields, not drop-down)
  • create a sensor with platform: time_date
  • create an automation that checks if the current time is the same as the input_datetime

E.g. my automation trigger looks like:

platform: template
    value_template: '{{ states.sensor.time.state == (states.input_datetime.coffee_start_time.attributes.timestamp | int | timestamp_custom("%H:%M", False)) }}'

I feel this should be easier, but that’s what it is for now.

As for resetting, you can just reset the value of the input_datetime when the automation/script runs.
I hope that helps :slight_smile:

Hello @joq3,

I have a simple package that I use as a timer to turn on, off or toggle any entity I want

Then with automations I can for example tell HA to turn (on,off,toggle) my TV in X hours X minutes X seconds.

And for my kettle connected to a relay I have a dropdown menu (input_select) with MAX, MED and MIN that will turn the relay of after different minutes each.

2 Likes