Hi
I would like to set up a rule that would be triggered by a virtual switch. The rule would turn on some lights and then would turn then off at a given time marker.
It would work like this. If I turn the lights at 2.04pm I would like to them turn off at 2.30pm. Then when I turn them on again at 4.12pm they would turn off at 4.30pm.
I would also set up a similar rule to turn off at the top of the next hour. Finally I would have another rule that would turn off the lights up to 90 minutes later (e.g. lights on at 2.02pm, turn off at 3.30pm).
I'm sure there are people smarter than me who could conjure up ways to achieve what you have described... but I am at least curious as to what you are describing is trying to cater for....
Sure. I am thinking of setting up a hubitat to control indoor tennis court lights. Players come to reception to check in, the staff press a button on a web dashboard that turn the lights on. They will then turn off at the end of the booking which is either at half past, on the hour of half past the next hour i.e. 30, 60 or 90 minutes.
The lights turning off seems like a good indicator to get off the court...
Is the timing of the booking something controlled by the staff... presumably yes...? Wondering if something like a Google Calendar could be used....? Other options may be available....
You just need a virtual switch with an auto-off timer. I know that the Virtual Switch uDTH Lite driver has an auto off on it.
Or just try telling Deep Seek to "Write a virtual switch driver for Hubitat, that has an auto-off preference to turn the switch off by selecting 1 to 60 minutes. "
I'm surprised how good Deep Seek is at writing Hubitat apps and drivers if you give it enough details.
it was a bit intimidating to see how well Deep Seek can do this, given that I've spent plenty of time in the past writing drivers and apps from scratch when apparently Deep Seek (and other AI bots) can do some of the work for you.
I haven't actually used it yet for anything, I was just surprised how well it does. For anything more complex it probably isn't practical. I just wrote a little app to put person icons on my 3D room dashboard that move around based on the distance setting from the presence sensor. Fun to watch people move around on the dashboard when I'm not in the room, but I didn't bother using AI for any of it.
You could easily do this task using Webcore. I'm doing something similar, in that I use a Wait command to wait until the next 5 minute mark, then it executes the rest of the piston. I also have another piston that dings my speaker at every 15 min mark using the same technique.
I used to have over 200 webcore pistons, but I wrote it all into custom apps. Yes, I never had any issue doing anything I wanted to in Webcore, but using custom apps is much more organized and compact.
Use a periodic trigger in the rm running every half hour and turn off lights regardless if they are on or off. You may need a simple counter variable for 60 and 90 cases.