[Release] Schedule Manager App

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 :slight_smile:

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
  • [Optional] Option to pause all schedules

Example

Edit
Inspiration: App: Switch Scheduler and More. (Schedule: Lights, Outlets, Switches, Relays, Sprinklers, Valves, and more..)

Release 1.1.0 - 2024-12-31

  • BREAKING CHANGE - App name will be reset
  • Show "(paused)" in app name when app is paused
  • Additional error handling for default schedules and when new devices are added to a schedule

Release 2.0.0 - 2025-04-01

  • BREAKING CHANGE - Sunrise/set times will not update unless app is re-saved. It will still run, just using the sunrise/set values at the time the app was updated.
  • Additional error handling for default schedules and when new devices are added to a schedule
  • Support for Hub Variables (datetime) used as start time
    • This allows users to select a Hub Variable to be used as the start time for schedules
    • Can use datetime, time or date (at midnight)
    • Supports variable renaming
    • Registers the use of a Hub Variable with the Hub
    • Update schedules when the Hub Variable changes
    • May use offset with hub variable
  • Fix null pointer that happened occasionally when a new device was added

More info about how date/time Hub Variables are handled:

  • Datetime - Will run at this exact date and time.
  • Date - Will run at midnight of the specified date. You may specify an offset to change the time.
  • Time - Will run at the specified time for all dates (respecting the day of week check boxes)

Release 2.0.1 - 2025-04-03

  • Fix app version not showing properly

Release 2.0.2 - 2025-04-21

  • Fix error when offset is applied to "time" or "date" only Hub Variables
10 Likes

Looks very similar to this app, but not exactly the same: App: Switch Scheduler and More. (Schedule: Lights, Outlets, Switches, Relays, Sprinklers, Valves, and more..)

Not totally sure but it looks maybe your app can better handle multiple schedules for the same device?

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.

3 Likes

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.

Looks like there may be a typo here. Should it be logDebug ? or should it be logInfo? but there is no logInfo function.

A fine app except that I've had the same experience as jon1: sunrise/sunset offsets are ignored.

@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.

I took a look at the code and the fix for the offsets issue is as follows:

delete line 399

then after the new line 399: state.devices["$dev.id"].schedules.each { scheduleId, schedule ->

add this line

offsetRiseAndSet = getSunriseAndSunset(sunriseOffset: schedule.offset, sunsetOffset: schedule.offset)

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) {

HTH

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.

This would be nice if it had the ability to send a message, TTS based on a schedule.

i suppose i could trigger a virtual switch that would in turn speak something.

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.

Im having a problem that when I click Done in the app, it seems to be not passing validation and requiring some field to be fixed or populated underlined in red, but there aren't any missing fields, underlined or with asterisk. Any thoughts? maybe a platform update recently broke something in the app?

Thinking of using this app to bring all my scheduling in a single app. Can I use hub variables? Also, my switch to nighttime starts at hub variable time if our presence is home or a Travel virtual switch is set. If the Travel virtual switch is not set and our presence is not home, it waits until our presence is home. It's my Motel 6 rule to keep the lights on for us.

Hmm, the only required inputs are name, devices and, if "Only run schedules when a specific switch is set" is selected, the switch and the status of that switch. I'm not sure why it'd be giving you that error, but I can probably find time to update my hub and test things out tomorrow evening.

Unfortunately, at this time, it does not support hub variables. That is a feature I'd like to add, though, as I too use them to trigger some schedules. I don't have any plans to bring geofencing into this app. You could probably use something like RM to enable/disable the app as necessary - enabled when home/travel, disabled when away.

I use a virtual switch to show if we are both home, not using Geofencing directly in the logic.
Sounds like I could use Schedule Manager once you add Hub Variables.
Perhaps I wouldn't need Hub Variables if all scheduling was done in a single app. Will have to check it out.
EDIT: Tried out my lighting schedule and figured out a way to handle the Not at Home for Lights Out case. Really do need to use Hub Variables and did find that I need one enhancement, an offset for the Hub Variables, just like Sunrise and Sunset.

Just installed this App via HPM. It crashes as soon as I type in a name for a schedule and then click anything (like the "Select Devices [to] schedule" or "enter" icon). Log results:

HOWEVER, if I first select a device, THEN I can name the schedule, and no crash.

Glad that worked for you! I'm working on hub variables and am already planning on adding offset. I'll let you know when I release it.

Thanks for the feedback @John_Land. I have a fix for this in my next release.