2 * ecobeeSetFanMinOnTime
4 * Copyright 2015 Yves Racine
5 * LinkedIn profile: ca.linkedin.com/pub/yves-racine-m-sc-a/0/406/4b/
7 * Developer retains all right, title, copyright, and interest, including all copyright, patent rights, trade secret
8 * in the Background technology. May be subject to consulting fees under the Agreement between the Developer and the Customer.
9 * Developer grants a non exclusive perpetual license to use the Background technology in the Software developed for and delivered
10 * to Customer under this Agreement. However, the Customer shall make no commercial use of the Background technology without
11 * Developer's written consent.
13 * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed
14 * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 * Software Distribution is restricted and shall be done only with Developer's written approval.
18 * N.B. Requires MyEcobee device available at
19 * http://www.ecomatiqhomes.com/#!store/tc3yr
22 name: "ecobeeSetFanMinOnTime",
24 author: "Yves Racine",
25 description: "ecobeeSetFanMinOnTime, the smartapp that sets your ecobee's fan to circulate for a minimum time (in minutes) per hour",
27 iconUrl: "https://s3.amazonaws.com/smartapp-icons/Partner/ecobee.png",
28 iconX2Url: "https://s3.amazonaws.com/smartapp-icons/Partner/ecobee@2x.png"
33 page(name: "selectThermostats", title: "Thermostats", install: false , uninstall: true, nextPage: "selectProgram") {
35 paragraph "ecobeeSetFanMinOnTime, the smartapp that sets your ecobee's fan to circulate for a minimum time (in minutes) per hour."
36 paragraph "Version 1.2"
37 paragraph "If you like this smartapp, please support the developer via PayPal and click on the Paypal link below "
38 href url: "https://www.paypal.me/ecomatiqhomes"
39 title:"Paypal donation..."
40 paragraph "Copyright©2015 Yves Racine"
41 href url:"http://github.com/yracine/device-type.myecobee", style:"embedded", required:false, title:"More information..."
42 description: "http://github.com/yracine/device-type.myecobee/blob/master/README.md"
44 section("Change the following ecobee thermostat(s)...") {
45 input "thermostats", "device.myEcobeeDevice", title: "Which thermostat(s)", multiple: true
48 page(name: "selectProgram", title: "Ecobee Programs", content: "selectProgram")
49 page(name: "Notifications", title: "Notifications Options", install: true, uninstall: true) {
50 section("Notifications") {
51 input "sendPushMessage", "enum", title: "Send a push notification?", metadata: [values: ["Yes", "No"]], required:
53 input "phone", "phone", title: "Send a Text Message?", required: false
55 section([mobileOnly:true]) {
56 label title: "Assign a name for this SmartApp", required: false
63 def ecobeePrograms = thermostats[0].currentClimateList.toString().minus('[').minus(']').tokenize(',')
64 log.debug "programs: $ecobeePrograms"
66 return dynamicPage(name: "selectProgram", title: "Select Ecobee Program", install: false, uninstall: true, nextPage:
68 section("Select Program") {
69 input "givenClimate", "enum", title: "When change to this ecobee program?", options: ecobeePrograms, required: true
71 section("Set the minimum fan runtime per hour for this program [default: 10 min. per hour]") {
72 input "givenFanMinTime", "number", title: "Minimum fan runtime in minutes", required: false
81 subscribe(thermostats,"climateName",changeFanMinOnTime)
82 subscribe(app, changeFanMinOnTime)
87 subscribe(thermostats,"climateName",changeFanMinOnTime)
88 subscribe(app, changeFanMinOnTime)
92 def changeFanMinOnTime(evt) {
95 if ((evt.value != givenClimate) && (evt.value != 'touch')) {
96 log.debug ("changeFanMinOnTime>not right climate (${evt.value}), doing nothing...")
99 Integer min_fan_time = (givenFanMinTime != null) ? givenFanMinTime : 10 // 10 min. fan time per hour by default
101 def message = "ecobeeSetFanMinOnTime>changing fanMinOnTime to ${min_fan_time} at ${thermostats}.."
105 it?.setThermostatSettings("", ['fanMinOnTime': "${min_fan_time}"])
110 if (sendPushMessage != "No") {
111 log.debug("sending push message")
115 log.debug("sending text message")