Hello, I've browsed other scheduling apps, but none were what I was looking for. Previously I was using RM and defining a set of triggers and then in the rule body checking to see what time it was before performing an action. Having specified times in multiple places got annoying to create/update rules so I decide to create an app for it. I hope someone can find it useful
You can find the app here along with instructions on how to use it.
It's also on Hubitat Package Manager as "Schedule Manager" for easy installation.
Description
This app allows users to configure a time table, per device, and schedule the desired state for each configured time. Users can select any number of switches/dimmers, schedule them based on a set time or sunrise/set (with offset), and configure the desired state for that time. Additionally, users can pause the schedule for individual times. Advanced options include only running for desired modes or when a specific switch is set in addition to the ability to manually pause all schedules.
Features
Schedule any number of switches/dimmers
Schedules based on selected time or sunrise/set with offset
Individual schedules may be paused
Set desired state for switch/dimmer to be in at specified time
[Optional] Configure which modes to run schedules for
[Optional] Configure "override switch" that will prevent schedules from running
Yes, that app was my inspiration (I liked the table view), but I couldn't add multiple schedules for a device. Additionally, I didn't want to always set a duration the device should be on, but rather just specify the state in which I wanted the device to be.
Trying your app, it's very nice, however it doesnt appear to be honoring sunrise/sunset offsets. I have some sunrise - 10min and sunset +20min, and it sets the crontab to the exact sunrise or sunset time, no offset applied.
@jon1@shl Thanks for checking it out! I'll get a fix out for the sunrise/set offset and the typo (should be logDebug), but it might be a little bit as I'm dealing with some storm aftermath currently.
So it should end up looking like this starting at line 396
//**** Update sunrise/set times and order schedules ****//
// Set updated sunrise/set times if option is set for schedule
state.devices["$dev.id"].schedules.each { scheduleId, schedule ->
offsetRiseAndSet = getSunriseAndSunset(sunriseOffset: schedule.offset, sunsetOffset: schedule.offset)
if (schedule.sunTime) {
if (schedule.sunset) {
With those changes the offsets do work fine. My line numbers are not quite the same as yours but your instructions made the code easy to replace, even for me (the last language I wrote code in was called "BASIC" -- and so was my code). Thanks.
@jon1@shl Thanks for taking a look at this. I have power and internet now so I've gone ahead and pushed an update. I recommend updating as it also contains a bug fix for updating the sunrise/set schedule daily.
A nice feature although I don't see myself getting to it any time soon. Happy to accept a pull request if you feel so inclined, though! I think using the virtual switch like you suggested is probably your best bet.