diff --git a/devicetypes/smartthings/fortrezz-water-valve.src/fortrezz-water-valve.groovy b/devicetypes/smartthings/fortrezz-water-valve.src/fortrezz-water-valve.groovy index 998787a..418b9f6 100644 --- a/devicetypes/smartthings/fortrezz-water-valve.src/fortrezz-water-valve.groovy +++ b/devicetypes/smartthings/fortrezz-water-valve.src/fortrezz-water-valve.groovy @@ -35,8 +35,8 @@ metadata { // tile definitions tiles(scale: 2) { - multiAttributeTile(name:"valve", type: "generic", width: 6, height: 4, canChangeIcon: true){ - tileAttribute ("device.valve", key: "PRIMARY_CONTROL") { + multiAttributeTile(name:"contact", type: "generic", width: 6, height: 4, canChangeIcon: true){ + tileAttribute ("device.contact", key: "PRIMARY_CONTROL") { attributeState "open", label: '${name}', action: "valve.close", icon: "st.valves.water.open", backgroundColor: "#00A0DC", nextState:"closing" attributeState "closed", label: '${name}', action: "valve.open", icon: "st.valves.water.closed", backgroundColor: "#ffffff", nextState:"opening" attributeState "opening", label: '${name}', action: "valve.close", icon: "st.valves.water.open", backgroundColor: "#00A0DC" @@ -48,14 +48,16 @@ metadata { state "default", label:'', action:"refresh.refresh", icon:"st.secondary.refresh" } - main "valve" - details(["valve","refresh"]) + main "contact" + details(["contact","refresh"]) } } def installed(){ // Device-Watch simply pings if no device events received for 32min(checkInterval) sendEvent(name: "checkInterval", value: 2 * 15 * 60 + 2 * 60, displayed: false, data: [protocol: "zwave", hubHardwareId: device.hub.hardwareID]) + + response(refresh()) } def updated(){ @@ -85,11 +87,17 @@ def zwaveEvent(physicalgraph.zwave.Command cmd) { } def open() { - zwave.switchBinaryV1.switchBinarySet(switchValue: 0x00).format() + delayBetween([ + zwave.switchBinaryV1.switchBinarySet(switchValue: 0x00).format(), + zwave.switchBinaryV1.switchBinaryGet().format() + ], 500) } def close() { - zwave.switchBinaryV1.switchBinarySet(switchValue: 0xFF).format() + delayBetween([ + zwave.switchBinaryV1.switchBinarySet(switchValue: 0xFF).format(), + zwave.switchBinaryV1.switchBinaryGet().format() + ], 500) } /** @@ -105,6 +113,6 @@ def refresh() { def createEventWithDebug(eventMap) { def event = createEvent(eventMap) - log.debug "Event created with ${event?.descriptionText}" + log.debug "Event created with ${event?.name}:${event?.value} - ${event?.descriptionText}" return event } diff --git a/devicetypes/smartthings/testing/simulated-presence-sensor.src/simulated-presence-sensor.groovy b/devicetypes/smartthings/testing/simulated-presence-sensor.src/simulated-presence-sensor.groovy index b7ef6ca..b63414b 100644 --- a/devicetypes/smartthings/testing/simulated-presence-sensor.src/simulated-presence-sensor.groovy +++ b/devicetypes/smartthings/testing/simulated-presence-sensor.src/simulated-presence-sensor.groovy @@ -49,6 +49,6 @@ def arrived() { def departed() { - log.trace "Executing 'arrived'" + log.trace "Executing 'departed'" sendEvent(name: "presence", value: "not present") } diff --git a/devicetypes/smartthings/zigbee-valve.src/zigbee-valve.groovy b/devicetypes/smartthings/zigbee-valve.src/zigbee-valve.groovy index 2dab99f..ff9c7eb 100644 --- a/devicetypes/smartthings/zigbee-valve.src/zigbee-valve.groovy +++ b/devicetypes/smartthings/zigbee-valve.src/zigbee-valve.groovy @@ -38,8 +38,8 @@ metadata { } tiles(scale: 2) { - multiAttributeTile(name:"valve", type: "generic", width: 6, height: 4, canChangeIcon: true){ - tileAttribute ("device.valve", key: "PRIMARY_CONTROL") { + multiAttributeTile(name:"contact", type: "generic", width: 6, height: 4, canChangeIcon: true){ + tileAttribute ("device.contact", key: "PRIMARY_CONTROL") { attributeState "open", label: '${name}', action: "valve.close", icon: "st.valves.water.open", backgroundColor: "#00A0DC", nextState:"closing" attributeState "closed", label: '${name}', action: "valve.open", icon: "st.valves.water.closed", backgroundColor: "#ffffff", nextState:"opening" attributeState "opening", label: '${name}', action: "valve.close", icon: "st.valves.water.open", backgroundColor: "#00A0DC", nextState:"closing" @@ -58,8 +58,8 @@ metadata { state "default", label:"", action:"refresh.refresh", icon:"st.secondary.refresh" } - main(["valve"]) - details(["valve", "battery", "refresh"]) + main(["contact"]) + details(["contact", "battery", "refresh"]) } } diff --git a/smartapps/opent2t/opent2t-smartapp-test.src/opent2t-smartapp-test.groovy b/smartapps/opent2t/opent2t-smartapp-test.src/opent2t-smartapp-test.groovy index c1e6bff..f7f9ad6 100644 --- a/smartapps/opent2t/opent2t-smartapp-test.src/opent2t-smartapp-test.groovy +++ b/smartapps/opent2t/opent2t-smartapp-test.src/opent2t-smartapp-test.groovy @@ -195,7 +195,10 @@ def registerDeviceChange() { state.deviceSubscriptionMap.put(deviceId, [subscriptionEndpt]) log.info "Added subscription URL: ${subscriptionEndpt} for ${myDevice.displayName}" } else if (!state.deviceSubscriptionMap[deviceId].contains(subscriptionEndpt)) { - state.deviceSubscriptionMap[deviceId] << subscriptionEndpt + // state.deviceSubscriptionMap[deviceId] << subscriptionEndpt + // For now, we will only have one subscription endpoint per device + state.deviceSubscriptionMap.remove(deviceId) + state.deviceSubscriptionMap.put(deviceId, [subscriptionEndpt]) log.info "Added subscription URL: ${subscriptionEndpt} for ${myDevice.displayName}" }