JJsLegacy wrote:I would still be curious of the answer of why switches but I reworked the device handler and turned everything into open/close. Working perfectly in my quick testing. Now I can act on them like they are contact switches etc.
/* virtual contact */
/* Based off of https://github.com/jwsf/device-type.arduino-8-way-relay/blob/master/VirtualSwitch.groovy */
metadata {
definition (name: "JJVirtualSwitch", namespace: "JJalarmdecoder", author: "test@gmail.com") {
capability "Contact Sensor"
}
simulator {
//
}
tiles {
// Main Row
standardTile("contact", "device.contact", width: 2, height: 2, canChangeBackground: true, canChangeIcon: true) {
state "open", label: '${name}', icon: "st.contact.contact.open", backgroundColor: "#ffa81e"
state "closed", label: '${name}', icon: "st.contact.contact.closed", backgroundColor: "#79b821",defaultState: true
}
// This tile will be the tile that is displayed on the Hub page.
main "contact"
// These tiles will be displayed when clicked on the device, in the order listed here.
details(["contact"])
}
}
// handle commands
def on() {
log.debug "On"
sendEvent (name: "contact", value: "open")
}
def off() {
log.debug "Off"
sendEvent (name: "contact", value: "closed")
}
JJsLegacy wrote:Not sure I understand what you said. In smartthings you made the 8 "zones" on/off switches. Why not use an open/close model instead? This would allow for more logical rules to be created like turn off the HVAC if a window is open or alert me if a door is left open for X minutes. Not so easy to do with them being on/off. Makes sense?
JJsLegacy wrote:I am 99.9% sure I didn't change anything else but I will triple check later.
Have you configured your zone numbers to the 8 switches inside the alarm device settings?
When you open the door/window do you wait the 1 minute or force a refresh in the alarm panel device with all the red dots?
Do you see a "number" in the red circle that matches the zone? If you see the number that should trigger the open/close.
Users browsing this forum: No registered users and 5 guests