Off timer dynamically ? is it possible? (change to a different length of time just before operation each time)

hello everyone,
I have a unique need. I recently made DIY smart water controller (if you guys are interested i can post a video on how i did it)
Now i need to set a timer for the switch to turn off after x amount of time. i dont mean static like power allowance. every time i turn the water on i need it to turn off after a random time.
let me explain.
So i have a DI water filter for my hydroponics system and the smart water valve is for this. when ever i use the water, say 10 gallons this time i know it takes 10 min to filter 1 gallon so i want to turn off the valve in this case after 100 min and tomorrow i might only need to filter 5 gallons and would need to shut the water off after only 50 min. I want to know if there is a way to somehow put a timer to turn off a specific switch after x (dynamic) minutes.
any help will be greatly appreciated.
oh and in case anyone wants to know this smart valve project cost me about 60 dollars :slight_smile:

Hopefully somebody will have a method which is truly dynamic, using either the official features or webcore.

But as long as there aren’t too many different options, it’s easy to use a virtual switch as a timer and set up one virtual timer for each of the options you want. So you have one for 5 gallons, one for 10 gallons, if necessary one for 6 gallons, 7 gallons, etc.

You use power allowance on the virtual switch, not the real switch.

And you set up an additional automation for each timer so the real switch will mirror the virtual switch.

Then it’s easy. You just start the 5 gallon timer, when it turns off, the real switch turns off. Or you start the 10 gallon timer, and again, when it turns off the real switch turns off.

The advantage of using the power allowance on a virtual switch instead of the real switch is that way you can also control the real switch with other methods. Or, as in this example, with other timers. :sunglasses:

So you could do the whole thing just with the official smart lighting feature. One virtual switch for each timer option. To Smart Light automations for each virtual switch: One automation to use power allowance for each timer to have that timer turn off after the appropriate amount of time. Plus one automation for each timer to have the physical switch near the timer.

How practical all of that is depends on how many different options you need to have, but it will work well for a lot of these cases.

There’s a how to article in the community – created wiki for creating a virtual timer for a light which shows how to do this in the classic app. But it should work in the new V3 app as well.

https://thingsthataresmart.wiki/index.php?title=How_to_create_a_virtual_timer_for_a_light

So I’m not saying that’s the best way to do it. I’m just saying it’s a fast and easy way to get it set up while you are figuring out a better way to do it with more complicated code. :wink:

Hi and thanks for the input.
I had thought of that but honestly it varies way too much for me to go off of static virtual switches. but what im asking for , if anyone can think of a way of pulling this off would be amazing for a bunch of applications not just turning water off, say you got a fan at xyz location and you want it to went something out for xyz time and so on. I really hope someone could chime in from the developer section and lets see if its possible to write some code to allow selecting of any switch and entering a dynamic timer.

1 Like

Are you using Alexa?

if yes, then you need EchoSistant.

The feature you are requesting is already built into the app. It is completely dynamic for setting timers and delays.

As an example, you could say this…

  • Alexa, turn on the water valve for 100 minutes in the greenhouse.
    This will turn it on right then and turn it off in 100 minutes.
1 Like

oh man i have like 7 google home devices and not a single alexa.
any other alternatives :slight_smile:

1 idea comes to mind from your alexa suggestion?
would it work with the alexa app on my android phone or do i need the physical device to use the echosistant?

Actually, yes it works great on the android Alexa app… But I’m not positive that you won’t need at least one device in the account.

I shall test that out and see.
Also I have never used Alexa, do I need to Install some add-on/skill for that to work?
Thanks for your help

There’s A bit to the install, but it’s worth it. Follow this thread…

Thank you I will give it a try.
Wish smartthings had something like this in the app

2 Likes