Run App on Specific Days


(Wamble J) #1

Is there a way to configure an app to only run on specific days? For example Rise and Shine I would like to only run on the days that I work. I see an area to configure hours, but did not see days. Thanks for any help with this.


(Chrisb) #2

You could do it be modifying an app to include that. Probably have to use a cron command to setup which days. The other thing is that you’d need to modify your install for vacation days or when you’re schedule changes.

If you’re not using modes for other things right now, you could also use those. Create a mode that called “day off” or whatever. Then install the rise and shine app to work for every mode EXCEPT “day off.” Then, at night before bed, simply set the mode to “day off” if you don’t need to get up early the next morning.

I’d probably also have an app that runs at 10am or so that changes the mode from “day off” or whatever your normal mode is. Install this app to run ONLY in “day off” mode. This way SmartThings automatically resets itself so the Rise and Shine app runs the next morning.


(Wamble J) #3

Thank you for your suggestions. I was hoping for a more integrated solution. I am surprised that more people do not use a weekday solution and a weekend solution. The Wemo app has a very basic version of this. I guess I could also run it through IFTTT which has a days of the week selection as well.

I will be using the modes for alarm/security configuration. Is there a max number of modes that you can have?


(Chrisb) #4

As far as I know there is no limit. But of course, the most modes you use, the most complex things become as you can only have one mode set at a time.

So, for instance, if you want a mode for “Security Alarms Set” that you run at night with various security programs running, but then also a mode for Weekday Alarm (get up early) and Weekend Alarm (get up later), now you need potentially 4 modes:

Security off, Wake up Early
Security off, Wake up Later
Security on, Wake up Early
Security on, Wake up Later

And of course, it starts to get complex to configure each app to run in which particular mode. Furthermore, if you trying to automate your modes things get even more complex. If the Security On comes on automatically at a certain time of night, which one should come on? The wake up early or the wake up late?

(There was a big discussion a few months back about modes, enabling multiple modes, mode groups, etc. Not sure if anything is going to come of that, but it was an interesting discussion none-the-less.)

Really an ability to change based on day makes more sense if you’re using modes for something else. If I have some time in the next couple of weeks I may try my hand at writing an app that does this. In theory I know how it should work… but practically speaking I’m not sure yet if I know all the correct commands I need. Could be a good learning experience for me.


(Wamble J) #5

Thank you very much for your suggestions. I will play around with it and see what works for me. SmartThings has the ability to configure days built in, it just needs to be added to the SmartApps.
Under the dashboard configuration for monitoring doors and locks it allows you to choose Days of Week or Time of Day. It may be easy for them to add this to SmartApps (hopefully).


(Curtmcgirt) #6

+1 on this. I haven’t written my first smartapp yet, but I don’t see a “day of week” input type on https://support.smartthings.com/entries/21603345-SmartApp-Input-Types. can anybody give me a good starting point to figure out how to put day of the week into a smartapp? at its very basic, I’d like to automatically change mode to “weekend” on Friday night, and make my other smartapps either NOT run while that mode is enabled, ONLY run while that mode is enabled, or run either way.

support told me to create modes when I asked them about this topic earlier today. to me, modes just don’t seem like a great answer for some tasks. that works fine if I’m going on vacation and I manually change to ‘vacation mode’ before I leave, and all my smartapps don’t run in vacation mode. but I don’t want to have to manually change to/from ‘weekend mode’ every weekend.

but they also told me that there is a big android app update coming which will allow some more granular control over scheduling days and times. (implying that there is already some of this control in some other version [IOS] of the app?)


(Wamble J) #7

There are days of the week options under certain things. When scheduling for a light to automatically turn on and off I saw the option. I do not see the option under settings for the modes. Hopefully this gets added since the functionality is already there.


(Brock) #8

I created an app to change the mode by time on certain days of the week.

I tried to schedule using cron jobs, but for some reason it would not take the dates correctly.

I achieved this by making a dropdown for what day of the week it is:

    	input "dayOfWeek", "enum", 
			title: "Which day of the week?",
			multiple: false,
			metadata: [ 
            	values: [
                    'All Week',
                    'Monday to Friday',
                    'Saturday & Sunday',
                    'Monday',
                    'Tuesday',
                    'Wednesday',
                    'Thursday',
                    'Friday',
                    'Saturday',
                    'Sunday'
                ]
			]

And then in my logic:

if((dayOfWeek == 'Monday' || dayOfWeek == 'Monday to Friday') && Calendar.instance.DAY_OF_WEEK == Calendar.instance.MONDAY)

I checked if the current day of the week is the same as the day that was selected.

I hope this sheds some light on your request. I am not sure about the iOS app. I’m on Android.