Thermostat Scheduler App?

I was told a few weeks ago by ST support they were working on making these programmable either through the Dashboard or an App.

I love the CT100 but I hate the way you have to use the slider to adjust temperature. It takes me a while sometimes to slide it at exactly the temperature I want. I also relayed this to support.

Thats encouraging news @gores95
For now, give this code a shot. It solves the slider problem until something official comes down the pipe. I’m still working on getting it working 100% but others have had great success.
http://build.smartthings.com/forums/topic/better-different-thermostat-device/

I have built a project BTW for this
http://build.smartthings.com/projects/thermostatscheduler/

I’ve had good luck with the “cozy” apps: set them to change based on the mode, and then as your modes change the temperature does too.

What I would like to see are “mode groups” so I could have a set of modes for “winter/summer” and “on-peak/off-peak” for instance… Maybe I should start a thread on that.

The problem I have with the cozy apps is that they happen after a mode has changed. Which means I have arrive at home before the mode changes and the heater begins, or I have to create a “Leaving work” mode and remember to change to that mode every day when I leave the office.
I want the thermostat to adjust temperature based on time, not necessarily on mode.

Another cool thing would be if ST would allow thermostat control to IFTTT.
I have Automatic in my car so I could build an IFTTT statement to do “If Ignition turns on near ‘Work’ then set ‘Thermostat’ to ‘72’”

Agreed on modes!
Is there an easy to program my Smartthings friendly thermostat to not turn on based on external weather forecast from sat weather.com, ie when it’s 72’ outside, I don’t want thermostat to kick in, but do when it’s 53’.
Also how can I program for weekday vs weekend?
I do have it programmed for different times of day & triggered for when I leave & arrive.
Thanks
George

I really think thermostat control is an area that SmartThings could see some huge improvement at. Look at Nest and the amazing UI they have built for it. Having some of those same functions within ST for other z-wave stats would be fantastic.

Using parts of many different smartthings code writing by others, I have developed a 5-2 thermostat program. This code uses an outside temperature sensor (user selected temp) to determine if the thermostat should be cooling or heating. The code schedules for weekdays (Monday - Friday) and weekends (Saturday - Sunday), with four (4) temp/time changes per day, very similar to commercial programmable thermostats.
This code can easily be modified to remove the external temperature sensor.

In previous versions of the code, the program would send the command for fan mode “auto” alot, but this is believed to be corrected in this code.

The code can be found at;

Again, I did not write all of this code, mainly assembled pieces and parts from other codes, all believed to be open source. Feel free to use the code as you see fit.

Mike

1 Like

thanks for the effort!
with a new device of type “thermostat” applying your code, i get the following error

groovy.lang.MissingMethodException: No signature of method: script1398263568358440900019.section() is applicable for argument types: (java.lang.String, script1398263568358440900019$_run_closure1_closure9) values: [Monitor the temperature..., script1398263568358440900019$_run_closure1_closure9@3177df80]
Possible solutions: getLog(), setLog(java.lang.Object) @ line 8

It looks like this is actually a separate smart app, not a device type. Looks like a great start. I wonder how this would work if I already have a program set on my Filtrete thermostat through their website/app

Has anyone managed to get a 7 days multi times a day scheduler smart app that’s working for the CT-100?
@Ben I’m looping you in to bring this to your attention, there is no app for a 7 day/multi time scheduler functionality for a thermostat. Pretty basic I would say.

@RBoy
3 posts up by @mwoodengr

also

2 Likes

Okay so the code posted by @mwoodengr doesn’t work and has some bugs in it, so I took the liberty of trying to rewrite it.

It’s not really a 7 day thermostat but rather a 5-2 day. Anyways I’ve posted the updated code below (and will continue to update it based on inputs here).

@tslagle13 I look forward to your expertise also here and also @docwisdom and @minollo

UPDATE: Removed the code from here, the app is now available here:

[quote=“RBoy, post:15, topic:1480”]
1.When I schedule more than 4 items it gives an error in the log “Max number of jobs reached: 4”. Why is this and how do I work around this?[/quote]

A trick I often used to take workaround that limitation is to not schedule N events, but only schedule one “timer” event (every 5 minutes or so); the timer event takes care of verifying if the actual time when the event takes place is inside a specific time range in the day, and performs the proper actions based on that. It allows for plenty of plenty of flexibility.

location.timezone is what I typically used; you can use it in Java APIs or to do timeToday(userSetTime, location.timeZone) - to translate the user’s set time (say, 8am) to the correct time today in the correct time zone (11/8/2014 1pm UTC in my EST case).

I’m facing a wierd problem While trying to schedule an event but ST is moving the date back by a month.

Here’s the code

    	if (timeNow >= timeToday(time1).time && timeNow < timeToday(time2).time) { // Are we between 1st time and 2nd time
    		changeTemp1()
        	schedule(time2, initialize)
            log.debug("Scheduled next adjustment for ${time2}")
    	}

Here’s what I see the log:

11:03:44 AM: debug Scheduled next adjustment for 2014-10-06T11:02:00.000-0500
11:03:44 AM: trace Scheduling ‘initialize’ for InstalledSmartApp: d2f62a07-acfa-448a-a859-94b4af249cd6
11:03:43 AM: debug checking mode request = auto
11:03:43 AM: debug Current time is Sat, 8 Nov 2014 11:03:43

If the current date is Nov 8 2014, why is it scheduling it for Oct 6th 2014?

Okay I’ve finally managed to figure out how to handle the time issues and updated the code above. Apparently when one takes a time input from the user the platform assigns a date about 1 month prior to it so I needed to user timeToday() to work around that and reassign the time today.

There’s however one bug I can’t seem to figure out, when I say enter 12:00 at the time (I’m in EST) the system translates it to 18:00 UTC and not 17:00 UTC.

Can someone help me understand why that’s happening? I’m guessing it’s something to do with the timezone.

@bflorian could you comment on this please.

The date corresponds to the day when the input was originally set, so I am guessing that you first installed the app about a month ago. It’s mostly ignored for daily schedules though we do use it, in some cases, to guess the time zone if the location does not have geo-coordinates set. I can’t tell exactly what’s going on with your incorrect offset without looking at that specific installed smart app, but I’m guessing the problem might be related to the fact that it was daylight savings time when you first installed the app and now it’s not. That shouldn’t matter, but maybe there some scenario that we missed where it does. Can you try passing in the location time zone to timeToday() and see if you get a different result, e.g.

timeToday(time1, location.timeZone)

Yes @bflorian that seemed to do the trick and how it appears to be showing the correct time.
So 3 questions:

  1. Should the system be taking the date when the was installed or when the user input the time - I guess this question would be redundant in light of question 2 and also for the fact that even if it took the user input date (which should technically be correct), one cannot rely on that as future events would be based on time and date would need to be adjusted.
  2. What is the correct way to handle the inputs given this use case. Is timeToday the right approach or should be some way else?
  3. Why is taking the wrong timezone with timeToday, ie. why should one have to specify the timezone for the current location?

thanks.

If you tap the temp reading on the slider you will get a + or - to fine tune your temp

1 Like