3 * Copyright 2015 Yves Racine
4 * LinkedIn profile: http://www.linkedin.com/in/yracine
6 * Developer retains all right, title, copyright, and interest, including all copyright, patent rights, trade secret
7 * in the Background technology. May be subject to consulting fees under the Agreement between the Developer and the Customer.
8 * Developer grants a non exclusive perpetual license to use the Background technology in the Software developed for and delivered
9 * to Customer under this Agreement. However, the Customer shall make no commercial use of the Background technology without
10 * Developer's written consent.
12 * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed
13 * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 * Software Distribution is restricted and shall be done only with Developer's written approval.
16 * N.B. Requires My Ecobee device ( v5.0 and higher) available at:
17 * http://www.ecomatiqhomes.com/store
20 name: "ecobeeGetTips",
22 author: "Yves Racine",
23 description: "Get Energy Saving Tips from My Ecobee device",
25 iconUrl: "https://s3.amazonaws.com/smartapp-icons/Partner/ecobee.png",
26 iconX2Url: "https://s3.amazonaws.com/smartapp-icons/Partner/ecobee@2x.png"
32 page (name: "generalSetupPage", title: "General Setup", uninstall:true, nextPage: "displayTipsPage") {
34 paragraph "ecobeeGetTips, the smartapp that Get Comfort & Energy Saving Tips from My Ecobee device"
35 paragraph "Version 1.1"
36 paragraph "If you like this smartapp, please support the developer via PayPal and click on the Paypal link below "
37 href url: "https://www.paypal.me/ecomatiqhomes",
38 title:"Paypal donation..."
39 paragraph "Copyright©2016 Yves Racine"
40 href url:"http://github.com/yracine/device-type.myecobee", style:"embedded", required:false, title:"More information..."
41 description: "http://github.com/yracine/device-type.myecobee/blob/master/README.md"
43 section("Get tips for this ecobee thermostat") {
44 input "ecobee", "device.myEcobeeDevice", title: "Ecobee Thermostat"
46 section("Level Of Tip") {
47 input (name:"level", title: "Which level ([1..4], 4 is the highest, but not always applicable, ex. for multi-stage heating/cooling systems)?", type:"number",
48 required:false, description:"optional")
50 section("Tip processing reset") {
51 input (name:"resetTipFlag", title: "Do you want to re-start over and reset tips?", type:"bool")
54 page (name: "displayTipsPage", content: "displayTipsPage", install: false, uninstall:true)
55 page(name: "OtherOptions", title: "Other Options", install: true, uninstall: true) {
56 section([mobileOnly:true]) {
57 label title: "Assign a name for this SmartApp", required: false
62 def displayTipsPage() {
64 log.debug("displayPageTips>about to call resetTips()")
67 log.debug("displayPageTips>about to call getTips()")
69 def tip1 = ecobee.currentTip1Text
70 def tip2 = ecobee.currentTip2Text
71 def tip3 = ecobee.currentTip3Text
72 def tip4 = ecobee.currentTip4Text
73 def tip5 = ecobee.currentTip5Text
74 def tip1Level = ecobee.currentTip1Level
75 def tip2Level = ecobee.currentTip2Level
76 def tip3Level = ecobee.currentTip3Level
77 def tip4Level = ecobee.currentTip4Level
78 def tip5Level = ecobee.currentTip5Level
80 return dynamicPage (name: "displayTipsPage", title: "Display Current Tips", nextPage: "OtherOptions") {
85 paragraph image: "${getCustomImagePath()}/tip.jpg","** Tip1 - Level $tip1Level **\n\n ${tip1}\n"
88 paragraph image: "${getCustomImagePath()}/tip.jpg", "Based on the input data available, no tips may apply at this time for this level. " +
89 "You can try with a different level of tips or later when the indoor/outdoor conditions have changed!"
93 paragraph image: "${getCustomImagePath()}tip.jpg", "** Tip2 - Level$tip2Level **\n\n ${tip2}\n"
96 paragraph image: "${getCustomImagePath()}tip.jpg", "** Tip3 - Level $tip3Level **\n\n ${tip3}\n"
99 paragraph image: "${getCustomImagePath()}tip.jpg", "** Tip4 - Level $tip4Level **\n\n ${tip4}\n"
102 paragraph image: "${getCustomImagePath()}tip.jpg", "** Tip5 - Level $tip5Level **\n\n ${tip5}\n"
114 log.debug "Updated with settings: ${settings}"
121 // TODO: subscribe to attributes, devices, locations, etc.
125 def getCustomImagePath() {
126 return "http://raw.githubusercontent.com/yracine/device-type.myecobee/master/icons/"