Smartthings-like quick per-device on/off timers

I have an idea that I didn’t find anywhere in the home assistant forums or hacs:

Summary
Samsung SmartThings has a feature where you can quickly add a timer or scheduled event to a device (or rather an entity). for example, tap on living room lights and turn off in… -> select a time, e.g. 5 minutes. this will schedule the device to turn off after the previously set amount of time. a similar option exists for setting a time (as in datetime) instead of a fixed delay -> turn off lights at exactly 3pm
This time selector could apply to scripts, switch entities, input booleans, and possibly some more.

Motivation
I know that home assistant has timers, but you have to manually configure them for each device you want to use this feature on. in other words, you can’t just quickly schedule a device to turn off later without a lot of hassle. I also realize that every example i can think of can be implemented with existing home assistant functionality and various integrations (e.g. a fixed, well-curated schedule) however, it’s (sometimes a lot) more effor to set up than just clikcing “turn off in x minutes”.
I would use this feature to quickly schedule things that an automation wouldn’t make a lot of sense for. for examle, setting the tv (attached to a smart plug) to turn off after the movie i’m watching without hardcoding a fixed timer duration (i’m kind of struggling to explain myself here: movie ends at 22:15, i check my phone at 21:30 and set a timer for turnoff at 22:20. this time varies everyday)

Personal bit
A couple of somewhat offtopic things:

  1. if anyone has an idea of how to do this in a simple way please share your ideas - every type of input is appreciated!
  2. i joined the forum today, so if there’s anything wrong with this post please let me know
  3. just to clarify, i love home assistant. i switched over from smartthings about 6 months ago and this is the only feature i somewhat miss.

thanks in advance :)

In my opinion there are better (smarter) ways to turn off the TV. What if you want to continue watching TV after the movie ends? Then you have to turn off the timer again. What if you make a 10 minute break? You need to reschedule the timer. Not really convenient/smart in my opinion.
I’d rather turn the TV off as part of a good night scene, or if the TV room is not occupied for x minutes.

Can you name some use cases for this? I currently don’t see where this could be useful.

Hi, sorry for not getting back to you earlier - I kind of forgot that i even posted here.

I’m thinking of irregular situations where you just want to quickly schedule something. Here are some more (really specific) use cases:

  • before i go to bed, i leave my pc on as a night light. i usually do something like shutdown /s /t 900 so it shuts down after i’m done brushing my teeth and got to bed. that time varies based on whether i’ll take a shower and if i make a cup of tea before going to bed
  • when i charge low-power devices (like a drone) that i can’t integrate their battery level into home assistant, i’d like to turn off the chargers via a smart outlet. if i plug it in at 90%, i’m setting an off timer for 15 minutes. if i plug it in at 10%, i’m setting an off timer for 3 hours
  • Set “alarms” in home assistant, e.g. a wake-up automation. instead of editing the automation everyday (and turning it off when I don’t want it), I could set a “play music at 9:00 tomorrow” action and just rely on it. this relies on getting up at a different time every day
  • the last one doesn’t apply to me, but i can see it being useful for other people: if you have smart appliances that don’t support timers by themselfes (or their timer functionality is limited), you could set your oven to turn on at 14:30 and off at 15:00 to start baking your cake before you get home - again, using an automation would be kind of cumbersome since you won’t use it very often and the time will vary from one occasion to another

Again, I know this is doable with automations and some input helpers - I’m even importing my alarm from my phone to trigger scripts based on that, but it took me a very long time to fully get working.
Minor side note: I was refering to “old” linear-style TV programs that you can’t just pause :b

Juding by the amount of replies to this, I can understand if nobody else really finds this useful. It was just a quick idea I had that I knew was implemented somewhere else :wink:

This is exactly what I’m looking for as well. Many of the IoT switch apps have this ability to very easily set an adhoc timer. I use it for similar purposes as well. For me I have a rather old Window AC that I don’t want to run all night (so old it doesn’t have a thermostat). So before I go to bed I set the timer to like 3hrs and it shuts off while I’m asleep. Some nights I only have to run it for 1hr.

An adhoc time for anything that I can turn off and on that is integrated into the device control (like a long press on mobile or something like that) would be very helpful. I’ll probably do something else, but this is a nice feature of these other apps out there.

OLIVER

It took a little work, but I ended up with a decent solution. I only needed this for one device for now, so I made an input helper using a select with common times I want for a timer and put it right below the on/off toggle for the device I’m interested in.

Then I made an automation with a large “choose” action (there’s probably a way to do it without that, but I can never remember the syntax to use for a variable) that will delay for a time set in input select and then shut off the device. It is triggered by the device being turned on. I also gave it a default action with a 4hr delay and shut off so that it will never just stay on (it’s an old wall AC so it sucks power). Now it’s pretty simply to turn it on for up to 4hrs when I get into bed.

OLIVER

i also try to find something “generic” : exemple : in a context menu : “OFF in x minutes”… available for every output, in the user interface.