Sort of. I do use Yves device type and I believe I have used some of his apps as the beginning of and inspiration for some other thing I have done. The window app is quite simple and is below. It runs through Yves device type.
preferences {
page(name: "selectThermostats", title: "Thermostats", install: false, uninstall: true, nextPage: "Notifications") {
section("Set the ecobee thermostat(s)") {
input "ecobee", "device.myEcobeeDevice", title: "Which ecobee thermostat(s)?", multiple: true
}
section("Select the button that is the master overide to window check activities..."){
input "ecobeeWindowCheckOveride", "capability.switch", title: "Which?", multiple: false, required: true
}
section("Choose the window sensor(s) to monitor") {
input "windowSensors", "capability.contactSensor", title: "Which one(s)?", required: true, multiple: true
}
}
page(name: "Notifications", title: "Notifications Options", install: true, uninstall: true) {
section("Notifications") {
input "sendPushMessage", "enum", title: "Send a push notification?", metadata: [values: ["Yes", "No"]], required: false
input "phone", "phone", title: "Send a Text Message?", required: false
}
section([mobileOnly:true]) {
label title: "Assign a name for this SmartApp", required: false
mode title: "Set for specific mode(s)", required: false
}
}
}
def installed() {
subscribe(windowSensors, "contact", windowStatusHandler)
ecobeeWindowStatusCheckScheduler()
}
def updated() {
unsubscribe()
unschedule(ecobeeWindowStatusCheckScheduler)
subscribe(windowSensors, "contact", windowStatusHandler)
ecobeeWindowStatusCheckScheduler()
}
def ecobeeWindowStatusCheckScheduler() {
if (ecobeeWindowCheckOveride.findAll { it?.latestValue("switch") == "off" }) {
log.debug "ecobeeWindowCheckScheduler activated"
//schedule("* * * * * ?", windowCheck) //every minute, for testing purposes only
schedule("0 0 23 * * ?", windowCheck) //at 11:00 PM
}
else {
log.debug "Do not schedule ecobeeWindowStatusCheck as master overide is set to on"
}
}
def windowCheck() {
if ((ecobeeWindowCheckOveride.findAll { it?.latestValue("switch") == "off" }) && (windowSensors.findAll { it?.latestValue("contact") == "open" })) {
ecobeeModeOff()
}
else if ((ecobeeWindowCheckOveride.findAll { it?.latestValue("switch") == "off" }) && (windowSensors.findAll { it?.latestValue("contact") == "closed" })) {
ecobeeModeHeat()
}
else {
log.debug "Do nothing as the ecobeeWindowStatusCheck master overide is set to on"
}
}
def windowStatusHandler(evt) {
log.debug evt.value
if ((ecobeeWindowCheckOveride.findAll { it?.latestValue("switch") == "off" }) && (windowSensors.findAll { it?.latestValue("contact") == "open" })) {
ecobeeModeOff()
}
else if ((ecobeeWindowCheckOveride.findAll { it?.latestValue("switch") == "off" }) && (windowSensors.findAll { it?.latestValue("contact") == "closed" })) {
ecobeeModeHeat()
}
else {
log.debug "Do nothing as the ecobeeWindowStatusCheck master overide is set to on"
}
}
def ecobeeModeOff() {
ecobee.setThermostatMode('off')
log.info "Set ecobee thermostat(s) mode to OFF as at least one window is open"
sendMsgOff()
}
def ecobeeModeHeat() {
ecobee.setThermostatMode('heat')
log.info "Set ecobee thermostat(s) mode to HEAT as all the windows have closed"
sendMsgHeat()
}
private sendMsgOff() {
log.debug "Running OFF mode messsaging..."
def theMessageOff = "Ecobee Window Status Mode Change -> Setting the thermostat(s) mode to OFF as at least one window is open"
if (sendPushMessage != "No") {
log.debug("sending push message")
sendPush(theMessageOff)
}
if (phone) {
log.debug("sending text message")
sendSms(phone, theMessageOff)
}
}
private sendMsgHeat() {
log.debug "Running HEAT mode messaging..."
def theMessageHeat = "Ecobee Window Status Mode Change -> Setting the thermostat(s) mode to HEAT as all the windows have closed"
if (sendPushMessage != "No") {
log.debug("sending push message")
sendPush(theMessageHeat)
}
if (phone) {
log.debug("sending text message")
sendSms(phone, theMessageHeat)
}
}
def event(evt) {
log.debug "value: $evt.value, event: $evt, settings: $settings, handlerName: ${evt.handlerName}"
}
I too have found presence on the remote sensors as being quite weird at times.