@TexAMR,
I have figured out where I lead you astray… Since the Child Door Control DH already has open() and close() functions, which are needed to trigger the garage door relay, you cannot use them from another another SmartApp (like CoRE) to only trigger the update of the doorControl and contact tiles.
So, I added two custom commands, called virtualopen() and virtualclose(), which I then use to update just the values of both tiles in the device handler, without sending any commands to the Arduino/ESP8266 board. I was then able to use CoRE to create two pistons, one for open and another for close. These pistons monitor a another “Contact Sensor” device (like your Iris devices) and then call the custom commands for virtualopen() and virtualclose() respectively.
At this point, I was feeling pretty proud of myself, until I remembered the fact ST_Anything, running on the Arduino / ESP8266 will refresh all of its data by sending an update to SmartThings every 5 minutes. Thus, the doorControl updates from this feature will overwrite the status provide to the Child Door Control DH from your Iris sensor.
So, if you really want to do this, you will need to trap any “doorControl” updates in the Parent DH to NOT call the childSendEvent function of the Child Door Control DH. Hope that makes sense!
Here is the modified Child Door Control DH if you want to give it a try.
Note to everyone else: Probably best to avoid this custom Child Door Control device handler unless you really know what you’re doing! I am not planning on releasing this version as the use case is pretty unique to @TexAMR.
/**
* Child DoorControl
*
* Copyright 2017 Daniel Ogorchock
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
* in compliance with the License. You may obtain a copy of the License at:
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License
* for the specific language governing permissions and limitations under the License.
*
* Change History:
*
* Date Who What
* ---- --- ----
* 2015-04-14 Dan Ogorchock Original Creation
*
*
*/
metadata {
definition (name: "Child Door Control", namespace: "ogiewon", author: "Daniel Ogorchock") {
capability "Door Control"
capability "Garage Door Control"
capability "Contact Sensor"
capability "Actuator"
capability "Sensor"
capability "Momentary"
command "virtualopen"
command "virtualclose"
}
tiles(scale: 2) {
multiAttributeTile(name:"doorControl", type: "generic"){
tileAttribute ("device.doorControl", key: "PRIMARY_CONTROL") {
attributeState "open", label: 'Open', action: "doorControl.close", icon: "st.doors.garage.garage-open", backgroundColor: "#e86d13", nextState: "open"
attributeState "closed", label: 'Closed', action: "doorControl.open", icon: "st.doors.garage.garage-closed", backgroundColor: "#00a0dc", nextState: "closed"
attributeState "opening", label: 'Opening', action: "doorControl.close", icon: "st.doors.garage.garage-opening", backgroundColor: "#e86d13", nextState: "closing"
attributeState "closing", label: 'Closing', action: "doorControl.open", icon: "st.doors.garage.garage-closing", backgroundColor: "#00a0dc", nextState: "opening"
}
}
standardTile("contact", "device.contact", width: 2, height: 2) {
state("open", label:'${name}', icon:"st.contact.contact.open", backgroundColor:"#e86d13")
state("closed", label:'${name}', icon:"st.contact.contact.closed", backgroundColor:"#00a0dc")
}
main (["doorControl", "contact"])
details (["doorControl", "contact"])
}
}
// handle commands
def open() {
parent.childDoorOpen(device.deviceNetworkId)
}
def close() {
parent.childDoorClose(device.deviceNetworkId)
}
def push() {
open()
}
// handle commands
def virtualopen() {
sendEvent(name: "contact", value: "open", isStateChange: true)
sendEvent(name: "doorControl", value: "open", isStateChange: true)
}
def virtualclose() {
sendEvent(name: "contact", value: "closed", isStateChange: true)
sendEvent(name: "doorControl", value: "closed", isStateChange: true)
}