diff --git a/devicetypes/smartthings/orvibo-gas-detector.src/Orvibo-Gas-detector.groovy b/devicetypes/smartthings/orvibo-gas-detector.src/Orvibo-Gas-detector.groovy index c7f6a00e5e9..7162c87ead6 100644 --- a/devicetypes/smartthings/orvibo-gas-detector.src/Orvibo-Gas-detector.groovy +++ b/devicetypes/smartthings/orvibo-gas-detector.src/Orvibo-Gas-detector.groovy @@ -26,6 +26,7 @@ metadata { capability "Sensor" capability "Refresh" fingerprint profileId: "0104", deviceId: "0402", inClusters: "0000, 0003, 0500, 0009", outClusters: "0019", manufacturer: "Heiman", model:"d0e857bfd54f4a12816295db3945a421" + fingerprint profileId: "0104", deviceId: "0402", inClusters: "0000, 0003, 0500, 0009", outClusters: "0019", manufacturer: "HEIMAN", model:"358e4e3e03c644709905034dae81433e" } simulator { @@ -55,7 +56,7 @@ def parse(String description) { if (description?.startsWith('zone status')) { map = parseIasMessage(description) } else { - map = zigbee.parseDescriptionAsMap(description) + map = parseAttrMessage(description) } } log.debug "Parse returned $map" @@ -65,8 +66,20 @@ def parse(String description) { log.debug "enroll response: ${cmds}" result = cmds?.collect { new physicalgraph.device.HubAction(it)} } + return result } + +def parseAttrMessage(String description){ + def descMap = zigbee.parseDescriptionAsMap(description) + def map = [:] + if (descMap?.clusterInt == zigbee.IAS_ZONE_CLUSTER && descMap.attrInt == zigbee.ATTRIBUTE_IAS_ZONE_STATUS) { + def zs = new ZoneStatus(zigbee.convertToInt(descMap.value, 16)) + map = getDetectedResult(zs.isAlarm1Set() || zs.isAlarm2Set()) + } + return map; +} + def parseIasMessage(String description) { ZoneStatus zs = zigbee.parseZoneStatus(description) return getDetectedResult(zs.isAlarm1Set() || zs.isAlarm2Set()) @@ -95,4 +108,5 @@ def ping() { def configure() { log.debug "configure" sendEvent(name: "checkInterval", value: 30 * 60 + 2 * 60, displayed: false, data: [protocol: "zigbee", hubHardwareId: device.hub.hardwareID, offlinePingable: "1"]) + return refresh() + zigbee.enrollResponse() } diff --git a/devicetypes/smartthings/ozom-smart-siren.src/ozom-smart-siren.groovy b/devicetypes/smartthings/ozom-smart-siren.src/ozom-smart-siren.groovy new file mode 100644 index 00000000000..a2a1d010b4a --- /dev/null +++ b/devicetypes/smartthings/ozom-smart-siren.src/ozom-smart-siren.groovy @@ -0,0 +1,148 @@ +/** + * Ozom Smart Siren + * + * Copyright 2018 Samsung SRBR + * + * 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. + * + */ + +import physicalgraph.zigbee.clusters.iaszone.ZoneStatus +import physicalgraph.zigbee.zcl.DataType + +metadata { + definition(name: "Ozom Smart Siren", namespace: "smartthings", author: "SmartThings", mnmn: "SmartThings", vid: "generic-siren-2", ocfDeviceType: "x.com.st.d.siren") { + capability "Actuator" + capability "Alarm" + capability "Switch" + capability "Configuration" + capability "Health Check" + + fingerprint profileId: "0104", inClusters: "0000,0003,0500,0502", outClusters: "0000", manufacturer: "ClimaxTechnology", model: "SRAC_00.00.00.16TC", deviceJoinName: "Ozom Smart Siren" // Ozom Siren - SRAC-23ZBS + } + + tiles { + standardTile("alarm", "device.alarm", width: 2, height: 2) { + state "off", label:'off', action:'alarm.siren', icon:"st.secondary.siren", backgroundColor:"#ffffff" + state "siren", label:'siren!', action:'alarm.off', icon:"st.secondary.siren", backgroundColor:"#e86d13" + } + + main "alarm" + details(["alarm"]) + } +} + +private getDEFAULT_MAX_DURATION() { 0x00B4 } +private getDEFAULT_DURATION() { 0xFFFE } + +private getIAS_WD_CLUSTER() { 0x0502 } + +private getATTRIBUTE_IAS_WD_MAXDURATION() { 0x0000 } +private getATTRIBUTE_IAS_ZONE_STATUS() { 0x0002 } + +private getCOMMAND_IAS_WD_START_WARNING() { 0x00 } +private getCOMMAND_DEFAULT_RESPONSE() { 0x0B } + +def turnOffAlarmTile(){ + sendEvent(name: "alarm", value: "off") + sendEvent(name: "switch", value: "off") +} + +def turnOnAlarmTile(){ + sendEvent(name: "alarm", value: "siren") + sendEvent(name: "switch", value: "on") +} + +def installed() { + sendCheckIntervalEvent() + state.maxDuration = DEFAULT_MAX_DURATION + turnOffAlarmTile() +} + +def parse(String description) { + log.debug "Parsing '${description}'" + + Map map = zigbee.getEvent(description) + if (!map) { + if (description?.startsWith('enroll request')) { + List cmds = zigbee.enrollResponse() + log.debug "enroll response: ${cmds}" + return cmds + } else { + Map descMap = zigbee.parseDescriptionAsMap(description) + if (descMap?.clusterInt == IAS_WD_CLUSTER) { + def data = descMap.data + + Integer parsedAttribute = descMap.attrInt + Integer command = Integer.parseInt(descMap.command, 16) + if (parsedAttribute == ATTRIBUTE_IAS_WD_MAXDURATION && descMap?.value) { + state.maxDuration = Integer.parseInt(descMap.value, 16) + } else if (command == COMMAND_DEFAULT_RESPONSE) { + Boolean isSuccess = Integer.parseInt(data[-1], 16) == 0 + Integer receivedCommand = Integer.parseInt(data[-2], 16) + if (receivedCommand == COMMAND_IAS_WD_START_WARNING && isSuccess){ + if(state.alarmOn){ + turnOnAlarmTile() + runIn(state.lastDuration, turnOffAlarmTile) + } else { + turnOffAlarmTile() + } + } + } + } + } + } + log.debug "Parse returned $map" + def results = map ? createEvent(map) : null + log.debug "parse results: " + results + return results +} + +private sendCheckIntervalEvent() { + sendEvent(name: "checkInterval", value: 30 * 60, displayed: false, data: [protocol: "zigbee", hubHardwareId: device.hub.hardwareID]) +} + +def ping() { + return zigbee.readAttribute(zigbee.IAS_ZONE_CLUSTER, zigbee.ATTRIBUTE_IAS_ZONE_STATUS) +} + +def configure() { + sendCheckIntervalEvent() + + def cmds = zigbee.enrollResponse() + + zigbee.writeAttribute(IAS_WD_CLUSTER, ATTRIBUTE_IAS_WD_MAXDURATION, DataType.UINT16, DEFAULT_DURATION) + + zigbee.configureReporting(zigbee.IAS_ZONE_CLUSTER, zigbee.ATTRIBUTE_IAS_ZONE_STATUS, DataType.BITMAP16, 0, 180, null) + log.debug "configure: " + cmds + + return cmds +} + +def siren() { + log.debug "siren()" + on() +} + +def on() { + log.debug "on()" + + state.alarmOn = true + def warningDuration = state.maxDuration ? state.maxDuration : DEFAULT_MAX_DURATION + state.lastDuration = warningDuration + + // start warning, burglar mode, no strobe, siren very high + zigbee.command(IAS_WD_CLUSTER, COMMAND_IAS_WD_START_WARNING, "13", DataType.pack(warningDuration, DataType.UINT16), "00", "00") +} + +def off() { + log.debug "off()" + + state.alarmOn = false + zigbee.command(IAS_WD_CLUSTER, COMMAND_IAS_WD_START_WARNING, "00", "0000", "00", "00") +} diff --git a/devicetypes/smartthings/zigbee-dimmer.src/zigbee-dimmer.groovy b/devicetypes/smartthings/zigbee-dimmer.src/zigbee-dimmer.groovy index 4b645c17f5b..e3a0e1039b7 100644 --- a/devicetypes/smartthings/zigbee-dimmer.src/zigbee-dimmer.groovy +++ b/devicetypes/smartthings/zigbee-dimmer.src/zigbee-dimmer.groovy @@ -49,6 +49,7 @@ metadata { fingerprint profileId: "0104", inClusters: "0000, 0004, 0003, 0006, 0008, 0005, FFFF, 1000", outClusters: "0019", manufacturer: "LDS", model: "ZBT-DIMLight-GLS0000", deviceJoinName: "A60 Dim Bulb" fingerprint profileId: "0104", inClusters: "0000, 0003, 0004, 0005, 0006, 0008", outClusters: "0019", manufacturer: "LDS", model: "ZHA-DIMLight-GLS0000", deviceJoinName: "A60 Dim Bulb" fingerprint profileId: "0104", inClusters: "0000, 0003, 0004, 0005, 0006, 0008, 1000", outClusters: "0019", manufacturer: "LDS", model: "ZBT-DIMLight-GLS", deviceJoinName: "A60 Dim Bulb" + fingerprint profileId: "0104", inClusters: "0000, 0003, 0004, 0005, 0006, 0008, 1000", outClusters: "0019", manufacturer: "LDS", model: "ZBT-DIMLight-GLS0044", deviceJoinName: "智能球泡灯(可调光版)" fingerprint profileId: "0104", inClusters: "0000, 0003, 0004, 0005, 0006, 0008, 0009", outClusters: "0019", manufacturer: "Aurora", model: "FWMPROZXBulb50AU", deviceJoinName: "Aurora MPro" fingerprint profileId: "0104", inClusters: "0000, 0004, 0003, 0006, 0008, 0005, FFFF, 1000", outClusters: "0019", manufacturer: "Aurora", model: "FWBulb51AU", deviceJoinName: "Aurora Smart Dimmable" fingerprint profileId: "0104", inClusters: "0000, 0003, 0004, 0005, 0006, 0008, 0B05, 1000, FEDC", outClusters: "000A, 0019", manufacturer: "Aurora", model: "FWGU10Bulb50AU", deviceJoinName: "Aurora Smart Dimmable GU10" diff --git a/devicetypes/smartthings/zigbee-smoke-sensor.src/zigbee-smoke-sensor.groovy b/devicetypes/smartthings/zigbee-smoke-sensor.src/zigbee-smoke-sensor.groovy index 831f5501d62..70805b05f81 100644 --- a/devicetypes/smartthings/zigbee-smoke-sensor.src/zigbee-smoke-sensor.groovy +++ b/devicetypes/smartthings/zigbee-smoke-sensor.src/zigbee-smoke-sensor.groovy @@ -29,6 +29,7 @@ metadata { capability "Health Check" fingerprint profileId: "0104", deviceId: "0402", inClusters: "0000,0001,0003,0500,0502,0009", outClusters: "0019", manufacturer: "Heiman", model: "b5db59bfd81e4f1f95dc57fdbba17931", deviceJoinName: "Orvibo Smoke Sensor" + fingerprint profileId: "0104", deviceId: "0402", inClusters: "0000,0001,0003,0500,0502,0009", outClusters: "0019", manufacturer: "HEIMAN", model: "98293058552c49f38ad0748541ee96ba", deviceJoinName: "Orvibo Smoke Sensor" } tiles { @@ -136,6 +137,6 @@ def configure() { log.debug "configure" sendEvent(name: "checkInterval", value:6 * 60 * 60 + 2 * 60, displayed: false, data: [protocol: "zigbee", hubHardwareId: device.hub.hardwareID, offlinePingable: "1"]) - return zigbee.configureReporting(zigbee.POWER_CONFIGURATION_CLUSTER, 0x0021, DataType.UINT8, 30, 21600, 0x10) + refresh() + return refresh() + zigbee.enrollResponse() + zigbee.configureReporting(zigbee.POWER_CONFIGURATION_CLUSTER, 0x0021, DataType.UINT8, 30, 21600, 0x10) } diff --git a/devicetypes/smartthings/zigbee-white-color-temperature-bulb.src/zigbee-white-color-temperature-bulb.groovy b/devicetypes/smartthings/zigbee-white-color-temperature-bulb.src/zigbee-white-color-temperature-bulb.groovy index a42099397b0..e1dd65ed16e 100644 --- a/devicetypes/smartthings/zigbee-white-color-temperature-bulb.src/zigbee-white-color-temperature-bulb.groovy +++ b/devicetypes/smartthings/zigbee-white-color-temperature-bulb.src/zigbee-white-color-temperature-bulb.groovy @@ -51,6 +51,7 @@ metadata { fingerprint profileId: "0104", inClusters: "0000, 0003, 0004, 0005, 0006, 0008, 0300, 0B05, FC01", outClusters: "0019", manufacturer: "LEDVANCE", model: "BR30 TW", deviceJoinName: "SYLVANIA Smart+ Adustable White BR30" fingerprint profileId: "0104", inClusters: "0000, 0003, 0004, 0005, 0006, 0008, 0300, 0B05, FC01", outClusters: "0019", manufacturer: "LEDVANCE", model: "RT TW", deviceJoinName: "SYLVANIA Smart+ Adustable White RT5/6" fingerprint profileId: "0104", inClusters: "0000, 0004, 0003, 0006, 0008, 0005, 0300, FFFF, FFFF, 1000", outClusters: "0019", manufacturer: "Aurora", model: "TWBulb51AU", deviceJoinName: "Aurora Smart Tunable White" + fingerprint profileId: "0104", inClusters: "0000, 0003, 0004, 0005, 0006, 0008, 0300", outClusters: "0019", manufacturer: "Aurora", model: "TWMPROZXBulb50AU", deviceJoinName: "Aurora MPro Smart Tuneable LED" fingerprint profileId: "0104", inClusters: "0000, 0003, 0004, 0005, 0006, 0008, 0300, 1000, FFFF", outClusters: "0019", manufacturer: "Aurora", model: "TWBulb51AU", deviceJoinName: "AOne Smart Tuneable GLS Lamp" fingerprint profileId: "0104", inClusters: "0000, 0003, 0004, 0005, 0006, 0008, 0300, 1000, FFFF", outClusters: "0019", manufacturer: "Aurora", model: "TWCLBulb50AU", deviceJoinName: "AOne Smart Tuneable Candle Lamp" fingerprint profileId: "0104", inClusters: "0000, 0003, 0004, 0005, 0006, 0008, 0300, 0B05, 1000, FEDC", outClusters: "000A, 0019", manufacturer: "Smarthome", model: "S111-202A", deviceJoinName: "Leedarson Tunable White Bulb A19" diff --git a/devicetypes/smartthings/zwave-siren.src/zwave-siren.groovy b/devicetypes/smartthings/zwave-siren.src/zwave-siren.groovy index 71e98bf60fc..fb4528d1f56 100644 --- a/devicetypes/smartthings/zwave-siren.src/zwave-siren.groovy +++ b/devicetypes/smartthings/zwave-siren.src/zwave-siren.groovy @@ -93,8 +93,7 @@ def installed() { def updated() { log.debug "updated()" // Device-Watch simply pings if no device events received for 122min(checkInterval) - //sendEvent(name: "checkInterval", value: 2 * 60 * 60 + 2 * 60, isStateChanged: true, data: [protocol: "zwave", hubHardwareId: device.hub.hardwareID, offlinePingable: "1"]) - sendEvent(name: "checkInterval", value: 2 * 60, isStateChanged: true, data: [protocol: "zwave", hubHardwareId: device.hub.hardwareID, offlinePingable: "1"]) + sendEvent(name: "checkInterval", value: 2 * 60 * 60 + 2 * 60, isStateChanged: true, data: [protocol: "zwave", hubHardwareId: device.hub.hardwareID, offlinePingable: "1"]) runIn(12, "initialize", [overwrite: true, forceForLocallyExecuting: true]) }