I have a smart connected water heater that is compatible with IFTTT but not ST. I have modified a garage door DTH that functions basically to change modes utilizing a couple webCore pistons, but I am having an issue with the toggle function in the DTH. It switches once but them hangs up until toggled twice.
This idea was borrowed from one of the ST gurus in here but I can’t remember who so I apologize and will give proper credit if the person claims it.
Here’s what I have so far:
metadata {
definition (name: "Water Heater Mode Selector", namespace: "smartthings", author: "Reid Keith") {
capability "Actuator"
capability "Door Control"
capability "Garage Door Control"
capability "Refresh"
capability "Sensor"
command "eco"
command "highdemand"
command "vacation"
command "hybrid"
}
simulator {
}
tiles {
standardTile("toggle", "device.door", inactiveLabel: true, width: 3, height: 3) {
state("closed", label:"ECO", action:"eco", icon:"st.Outdoor.outdoor2", backgroundColor:"#33FF57", nextState:"open")
state("open", label:"High Demand", action:"highdemand", icon:"st.thermostat.heat", backgroundColor:"#FF0000", nextState:"closed")
state("opening", label:"Vacation", action:"vacation", icon:"st.Weather.weather3", backgroundColor:"#00A8FF")
state("closing", label:"Hybrid", action:"hybrid", icon:"st.tesla.tesla-hvac", backgroundColor:"#EDFF00")
}
standardTile("vacation", "device.door", inactiveLabel: false, decoration: "flat") {
state "default", label:"Vacation", action:"vacation", icon:"st.Weather.weather3"
}
standardTile("hybrid", "device.door", inactiveLabel: false, decoration: "flat") {
state "default", label:"Hybrid", action:"hybrid", icon:"st.tesla.tesla-hvac"
}
standardTile("highdemand", "device.door", inactiveLabel: false, decoration: "flat") {
state "default", label:"High Demand", action:"highdemand", icon:"st.thermostat.heat"
}
standardTile("eco", "device.door", inactiveLabel: false, decoration: "flat") {
state "default", label:"ECO", action:"eco", icon:"st.Outdoor.outdoor2"
}
main "toggle"
details(["toggle", "eco", "highdemand", "hybrid", "vacation"])
}
}
def parse(String description) {
log.trace "parse($description)"
}
def eco() {
sendEvent(name: "door", value: "closed")
}
def highdemand() {
sendEvent(name: "door", value: "open")
}
def vacation() {
sendEvent(name: "door", value: "opening")
}
def hybrid() {
sendEvent(name: "door", value: "closing")
}
I want to be able to toggle from Eco to High Demand and back with the other 2 modes only selectable by directly pressing their buttons. Any help is greatly appreciated.