diff --git a/devicetypes/fibargroup/fibaro-door-window-sensor-zw5-with-temperature.src/fibaro-door-window-sensor-zw5-with-temperature.groovy b/devicetypes/fibargroup/fibaro-door-window-sensor-zw5-with-temperature.src/fibaro-door-window-sensor-zw5-with-temperature.groovy index 47c3f4a..9b98808 100644 --- a/devicetypes/fibargroup/fibaro-door-window-sensor-zw5-with-temperature.src/fibaro-door-window-sensor-zw5-with-temperature.groovy +++ b/devicetypes/fibargroup/fibaro-door-window-sensor-zw5-with-temperature.src/fibaro-door-window-sensor-zw5-with-temperature.groovy @@ -14,13 +14,13 @@ * */ metadata { - definition (name: "Fibaro Door/Window Sensor ZW5 with Temperature", namespace: "fibargroup", author: "Fibar Group S.A.") { + definition (name: "Fibaro Door/Window Sensor ZW5 with Temperature", namespace: "fibargroup", author: "Fibar Group S.A.", ocfDeviceType: "x.com.st.d.sensor.contact") { capability "Battery" capability "Contact Sensor" capability "Sensor" capability "Configuration" capability "Tamper Alert" - + capability "Temperature Measurement" fingerprint deviceId: "0x0701", inClusters: "0x5E, 0x85, 0x59, 0x22, 0x20, 0x80, 0x70, 0x56, 0x5A, 0x7A, 0x72, 0x8E, 0x71, 0x73, 0x98, 0x2B, 0x9C, 0x30, 0x31, 0x86", outClusters: "" @@ -28,26 +28,26 @@ metadata { } simulator { - + } - + tiles(scale: 2) { multiAttributeTile(name:"FGK", type:"lighting", width:6, height:4) {//with generic type secondary control text is not displayed in Android app tileAttribute("device.contact", key:"PRIMARY_CONTROL") { attributeState("open", icon:"st.contact.contact.open", backgroundColor:"#e86d13") attributeState("closed", icon:"st.contact.contact.closed", backgroundColor:"#00a0dc") } - + tileAttribute("device.tamper", key:"SECONDARY_CONTROL") { attributeState("active", label:'tamper active', backgroundColor:"#53a7c0") attributeState("inactive", label:'tamper inactive', backgroundColor:"#ffffff") - } + } } - + valueTile("battery", "device.battery", inactiveLabel: false, width: 2, height: 2, decoration: "flat") { state "battery", label:'${currentValue}% battery', unit:"" } - + valueTile("temperature", "device.temperature", inactiveLabel: false, width: 2, height: 2) { state "temperature", label:'${currentValue}°', backgroundColors:[ @@ -60,7 +60,7 @@ metadata { [value: 96, color: "#bc2323"] ] } - + main "FGK" details(["FGK","battery", "temperature"]) } @@ -68,9 +68,9 @@ metadata { // parse events into attributes def parse(String description) { - log.debug "Parsing '${description}'" + log.debug "Parsing '${description}'" def result = [] - + if (description.startsWith("Err 106")) { if (state.sec) { result = createEvent(descriptionText:description, displayed:false) @@ -87,7 +87,7 @@ def parse(String description) { return null } else { def cmd = zwave.parse(description, [0x31: 5, 0x56: 1, 0x71: 3, 0x72: 2, 0x80: 1, 0x84: 2, 0x85: 2, 0x86: 1, 0x98: 1]) - + if (cmd) { log.debug "Parsed '${cmd}'" zwaveEvent(cmd) @@ -125,13 +125,13 @@ def zwaveEvent(physicalgraph.zwave.commands.notificationv3.NotificationReport cm //(parameter 20 was not changed before device's re-inclusion) def map = [:] if (cmd.notificationType == 6) { - switch (cmd.event) { + switch (cmd.event) { case 22: map.name = "contact" map.value = "open" map.descriptionText = "${device.displayName}: is open" break - + case 23: map.name = "contact" map.value = "closed" @@ -145,7 +145,7 @@ def zwaveEvent(physicalgraph.zwave.commands.notificationv3.NotificationReport cm map.value = "inactive" map.descriptionText = "${device.displayName}: tamper alarm has been deactivated" break - + case 3: map.name = "tamper" map.value = "active" @@ -153,7 +153,7 @@ def zwaveEvent(physicalgraph.zwave.commands.notificationv3.NotificationReport cm break } } - + createEvent(map) } @@ -166,7 +166,7 @@ def zwaveEvent(physicalgraph.zwave.commands.batteryv1.BatteryReport cmd) { createEvent(map) } -def zwaveEvent(physicalgraph.zwave.commands.wakeupv2.WakeUpNotification cmd) { +def zwaveEvent(physicalgraph.zwave.commands.wakeupv2.WakeUpNotification cmd) { def event = createEvent(descriptionText: "${device.displayName} woke up", displayed: false) def cmds = [] cmds << encap(zwave.batteryV1.batteryGet()) @@ -177,32 +177,32 @@ def zwaveEvent(physicalgraph.zwave.commands.wakeupv2.WakeUpNotification cmd) { [event, response(cmds)] } -def zwaveEvent(physicalgraph.zwave.commands.manufacturerspecificv2.ManufacturerSpecificReport cmd) { +def zwaveEvent(physicalgraph.zwave.commands.manufacturerspecificv2.ManufacturerSpecificReport cmd) { log.debug "manufacturerId: ${cmd.manufacturerId}" log.debug "manufacturerName: ${cmd.manufacturerName}" log.debug "productId: ${cmd.productId}" log.debug "productTypeId: ${cmd.productTypeId}" } -def zwaveEvent(physicalgraph.zwave.commands.manufacturerspecificv2.DeviceSpecificReport cmd) { +def zwaveEvent(physicalgraph.zwave.commands.manufacturerspecificv2.DeviceSpecificReport cmd) { log.debug "deviceIdData: ${cmd.deviceIdData}" log.debug "deviceIdDataFormat: ${cmd.deviceIdDataFormat}" log.debug "deviceIdDataLengthIndicator: ${cmd.deviceIdDataLengthIndicator}" log.debug "deviceIdType: ${cmd.deviceIdType}" - + if (cmd.deviceIdType == 1 && cmd.deviceIdDataFormat == 1) {//serial number in binary format String serialNumber = "h'" - + cmd.deviceIdData.each{ data -> serialNumber += "${String.format("%02X", data)}" } - + updateDataValue("serialNumber", serialNumber) log.debug "${device.displayName} - serial number: ${serialNumber}" } } -def zwaveEvent(physicalgraph.zwave.commands.versionv1.VersionReport cmd) { +def zwaveEvent(physicalgraph.zwave.commands.versionv1.VersionReport cmd) { updateDataValue("version", "${cmd.applicationVersion}.${cmd.applicationSubVersion}") log.debug "applicationVersion: ${cmd.applicationVersion}" log.debug "applicationSubVersion: ${cmd.applicationSubVersion}" @@ -221,7 +221,7 @@ def zwaveEvent(physicalgraph.zwave.commands.sensormultilevelv5.SensorMultilevelR map.name = "temperature" map.displayed = true } - + createEvent(map) } @@ -231,9 +231,9 @@ def zwaveEvent(physicalgraph.zwave.commands.deviceresetlocallyv1.DeviceResetLoca def configure() { log.debug "Executing 'configure'" - + def cmds = [] - + cmds += zwave.wakeUpV2.wakeUpIntervalSet(seconds:21600, nodeid: zwaveHubNodeId)//FGK's default wake up interval cmds += zwave.manufacturerSpecificV2.manufacturerSpecificGet() cmds += zwave.manufacturerSpecificV2.deviceSpecificGet() @@ -242,7 +242,7 @@ def configure() { cmds += zwave.sensorMultilevelV5.sensorMultilevelGet(sensorType: 1, scale: 0) cmds += zwave.associationV2.associationSet(groupingIdentifier:1, nodeId: [zwaveHubNodeId]) cmds += zwave.wakeUpV2.wakeUpNoMoreInformation() - + encapSequence(cmds, 500) } @@ -261,7 +261,7 @@ private encapSequence(commands, delay=200) { private encap(physicalgraph.zwave.Command cmd) { def secureClasses = [0x20, 0x2B, 0x30, 0x5A, 0x70, 0x71, 0x84, 0x85, 0x8E, 0x9C] - + //todo: check if secure inclusion was successful //if not do not send security-encapsulated command if (secureClasses.find{ it == cmd.commandClassId }) { @@ -269,4 +269,4 @@ private encap(physicalgraph.zwave.Command cmd) { } else { crc16(cmd) } -} \ No newline at end of file +} diff --git a/devicetypes/fibargroup/fibaro-door-window-sensor-zw5.src/fibaro-door-window-sensor-zw5.groovy b/devicetypes/fibargroup/fibaro-door-window-sensor-zw5.src/fibaro-door-window-sensor-zw5.groovy index 95adeb5..10cefd1 100644 --- a/devicetypes/fibargroup/fibaro-door-window-sensor-zw5.src/fibaro-door-window-sensor-zw5.groovy +++ b/devicetypes/fibargroup/fibaro-door-window-sensor-zw5.src/fibaro-door-window-sensor-zw5.groovy @@ -14,7 +14,7 @@ * */ metadata { - definition (name: "Fibaro Door/Window Sensor ZW5", namespace: "fibargroup", author: "Fibar Group S.A.") { + definition (name: "Fibaro Door/Window Sensor ZW5", namespace: "fibargroup", author: "Fibar Group S.A.", ocfDeviceType: "x.com.st.d.sensor.contact") { capability "Battery" capability "Contact Sensor" capability "Sensor" @@ -26,26 +26,26 @@ metadata { } simulator { - + } - + tiles(scale: 2) { multiAttributeTile(name:"FGK", type:"lighting", width:6, height:4) {//with generic type secondary control text is not displayed in Android app tileAttribute("device.contact", key:"PRIMARY_CONTROL") { attributeState("open", icon:"st.contact.contact.open", backgroundColor:"#e86d13") attributeState("closed", icon:"st.contact.contact.closed", backgroundColor:"#00a0dc") } - + tileAttribute("device.tamper", key:"SECONDARY_CONTROL") { attributeState("active", label:'tamper active', backgroundColor:"#53a7c0") attributeState("inactive", label:'tamper inactive', backgroundColor:"#ffffff") - } + } } - + valueTile("battery", "device.battery", inactiveLabel: false, width: 2, height: 2, decoration: "flat") { state "battery", label:'${currentValue}% battery', unit:"" } - + main "FGK" details(["FGK","battery"]) } @@ -53,9 +53,9 @@ metadata { // parse events into attributes def parse(String description) { - log.debug "Parsing '${description}'" + log.debug "Parsing '${description}'" def result = [] - + if (description.startsWith("Err 106")) { if (state.sec) { result = createEvent(descriptionText:description, displayed:false) @@ -72,7 +72,7 @@ def parse(String description) { return null } else { def cmd = zwave.parse(description, [0x56: 1, 0x71: 3, 0x72: 2, 0x80: 1, 0x84: 2, 0x85: 2, 0x86: 1, 0x98: 1]) - + if (cmd) { log.debug "Parsed '${cmd}'" zwaveEvent(cmd) @@ -110,13 +110,13 @@ def zwaveEvent(physicalgraph.zwave.commands.notificationv3.NotificationReport cm //(parameter 20 was not changed before device's re-inclusion) def map = [:] if (cmd.notificationType == 6) { - switch (cmd.event) { + switch (cmd.event) { case 22: map.name = "contact" map.value = "open" map.descriptionText = "${device.displayName}: is open" break - + case 23: map.name = "contact" map.value = "closed" @@ -130,7 +130,7 @@ def zwaveEvent(physicalgraph.zwave.commands.notificationv3.NotificationReport cm map.value = "inactive" map.descriptionText = "${device.displayName}: tamper alarm has been deactivated" break - + case 3: map.name = "tamper" map.value = "active" @@ -138,7 +138,7 @@ def zwaveEvent(physicalgraph.zwave.commands.notificationv3.NotificationReport cm break } } - + createEvent(map) } @@ -151,7 +151,7 @@ def zwaveEvent(physicalgraph.zwave.commands.batteryv1.BatteryReport cmd) { createEvent(map) } -def zwaveEvent(physicalgraph.zwave.commands.wakeupv2.WakeUpNotification cmd) { +def zwaveEvent(physicalgraph.zwave.commands.wakeupv2.WakeUpNotification cmd) { def event = createEvent(descriptionText: "${device.displayName} woke up", displayed: false) def cmds = [] cmds << encap(zwave.batteryV1.batteryGet()) @@ -160,32 +160,32 @@ def zwaveEvent(physicalgraph.zwave.commands.wakeupv2.WakeUpNotification cmd) { [event, response(cmds)] } -def zwaveEvent(physicalgraph.zwave.commands.manufacturerspecificv2.ManufacturerSpecificReport cmd) { +def zwaveEvent(physicalgraph.zwave.commands.manufacturerspecificv2.ManufacturerSpecificReport cmd) { log.debug "manufacturerId: ${cmd.manufacturerId}" log.debug "manufacturerName: ${cmd.manufacturerName}" log.debug "productId: ${cmd.productId}" log.debug "productTypeId: ${cmd.productTypeId}" } -def zwaveEvent(physicalgraph.zwave.commands.manufacturerspecificv2.DeviceSpecificReport cmd) { +def zwaveEvent(physicalgraph.zwave.commands.manufacturerspecificv2.DeviceSpecificReport cmd) { log.debug "deviceIdData: ${cmd.deviceIdData}" log.debug "deviceIdDataFormat: ${cmd.deviceIdDataFormat}" log.debug "deviceIdDataLengthIndicator: ${cmd.deviceIdDataLengthIndicator}" log.debug "deviceIdType: ${cmd.deviceIdType}" - + if (cmd.deviceIdType == 1 && cmd.deviceIdDataFormat == 1) {//serial number in binary format String serialNumber = "h'" - + cmd.deviceIdData.each{ data -> serialNumber += "${String.format("%02X", data)}" } - + updateDataValue("serialNumber", serialNumber) log.debug "${device.displayName} - serial number: ${serialNumber}" } } -def zwaveEvent(physicalgraph.zwave.commands.versionv1.VersionReport cmd) { +def zwaveEvent(physicalgraph.zwave.commands.versionv1.VersionReport cmd) { updateDataValue("version", "${cmd.applicationVersion}.${cmd.applicationSubVersion}") log.debug "applicationVersion: ${cmd.applicationVersion}" log.debug "applicationSubVersion: ${cmd.applicationSubVersion}" @@ -204,7 +204,7 @@ def configure() { sendEvent(name: "checkInterval", value: 8 * 60 * 60 + 2 * 60, displayed: false, data: [protocol: "zwave", hubHardwareId: device.hub.hardwareID]) def cmds = [] - + cmds += zwave.wakeUpV2.wakeUpIntervalSet(seconds:21600, nodeid: zwaveHubNodeId)//FGK's default wake up interval cmds += zwave.manufacturerSpecificV2.manufacturerSpecificGet() cmds += zwave.manufacturerSpecificV2.deviceSpecificGet() @@ -212,7 +212,7 @@ def configure() { cmds += zwave.batteryV1.batteryGet() cmds += zwave.associationV2.associationSet(groupingIdentifier:1, nodeId: [zwaveHubNodeId]) cmds += zwave.wakeUpV2.wakeUpNoMoreInformation() - + encapSequence(cmds, 500) } @@ -231,7 +231,7 @@ private encapSequence(commands, delay=200) { private encap(physicalgraph.zwave.Command cmd) { def secureClasses = [0x20, 0x2B, 0x30, 0x5A, 0x70, 0x71, 0x84, 0x85, 0x8E, 0x9C] - + //todo: check if secure inclusion was successful //if not do not send security-encapsulated command if (secureClasses.find{ it == cmd.commandClassId }) { @@ -239,4 +239,4 @@ private encap(physicalgraph.zwave.Command cmd) { } else { crc16(cmd) } -} \ No newline at end of file +} diff --git a/devicetypes/fibargroup/fibaro-flood-sensor-zw5.src/fibaro-flood-sensor-zw5.groovy b/devicetypes/fibargroup/fibaro-flood-sensor-zw5.src/fibaro-flood-sensor-zw5.groovy index 5e66488..703af8e 100644 --- a/devicetypes/fibargroup/fibaro-flood-sensor-zw5.src/fibaro-flood-sensor-zw5.groovy +++ b/devicetypes/fibargroup/fibaro-flood-sensor-zw5.src/fibaro-flood-sensor-zw5.groovy @@ -14,7 +14,7 @@ * */ metadata { - definition (name: "Fibaro Flood Sensor ZW5", namespace: "fibargroup", author: "Fibar Group S.A.") { + definition (name: "Fibaro Flood Sensor ZW5", namespace: "fibargroup", author: "Fibar Group S.A.", ocfDeviceType: "x.com.st.d.sensor.moisture") { capability "Battery" capability "Configuration" capability "Sensor" @@ -37,13 +37,13 @@ metadata { attributeState("dry", icon:"st.alarm.water.dry", backgroundColor:"#ffffff") attributeState("wet", icon:"st.alarm.water.wet", backgroundColor:"#00a0dc") } - + tileAttribute("device.tamper", key:"SECONDARY_CONTROL") { attributeState("active", label:'tamper active', backgroundColor:"#cccccc") attributeState("inactive", label:'tamper inactive', backgroundColor:"#00A0DC") } } - + valueTile("temperature", "device.temperature", inactiveLabel: false, width: 2, height: 2) { state "temperature", label:'${currentValue}°', backgroundColors:[ @@ -130,14 +130,14 @@ def zwaveEvent(physicalgraph.zwave.commands.wakeupv2.WakeUpNotification cmd) [event, response(cmds)] } -def zwaveEvent(physicalgraph.zwave.commands.manufacturerspecificv2.ManufacturerSpecificReport cmd) { +def zwaveEvent(physicalgraph.zwave.commands.manufacturerspecificv2.ManufacturerSpecificReport cmd) { log.debug "manufacturerId: ${cmd.manufacturerId}" log.debug "manufacturerName: ${cmd.manufacturerName}" log.debug "productId: ${cmd.productId}" log.debug "productTypeId: ${cmd.productTypeId}" } -def zwaveEvent(physicalgraph.zwave.commands.manufacturerspecificv2.DeviceSpecificReport cmd) { +def zwaveEvent(physicalgraph.zwave.commands.manufacturerspecificv2.DeviceSpecificReport cmd) { log.debug "deviceIdData: ${cmd.deviceIdData}" log.debug "deviceIdDataFormat: ${cmd.deviceIdDataFormat}" log.debug "deviceIdDataLengthIndicator: ${cmd.deviceIdDataLengthIndicator}" diff --git a/devicetypes/fibargroup/fibaro-motion-sensor-zw5.src/fibaro-motion-sensor-zw5.groovy b/devicetypes/fibargroup/fibaro-motion-sensor-zw5.src/fibaro-motion-sensor-zw5.groovy index ca47295..3d709d1 100644 --- a/devicetypes/fibargroup/fibaro-motion-sensor-zw5.src/fibaro-motion-sensor-zw5.groovy +++ b/devicetypes/fibargroup/fibaro-motion-sensor-zw5.src/fibaro-motion-sensor-zw5.groovy @@ -14,7 +14,7 @@ * */ metadata { - definition (name: "Fibaro Motion Sensor ZW5", namespace: "fibargroup", author: "Fibar Group S.A.") { + definition (name: "Fibaro Motion Sensor ZW5", namespace: "fibargroup", author: "Fibar Group S.A.", ocfDeviceType: "x.com.st.d.sensor.motion") { capability "Battery" capability "Configuration" capability "Illuminance Measurement" @@ -23,27 +23,27 @@ metadata { capability "Tamper Alert" capability "Temperature Measurement" capability "Health Check" - + fingerprint deviceId: "0x0701", inClusters: "0x5E, 0x20, 0x86, 0x72, 0x5A, 0x59, 0x85, 0x73, 0x84, 0x80, 0x71, 0x56, 0x70, 0x31, 0x8E, 0x22, 0x30, 0x9C, 0x98, 0x7A", outClusters: "" } - + simulator { - + } - + tiles(scale: 2) { multiAttributeTile(name:"FGMS", type:"lighting", width:6, height:4) {//with generic type secondary control text is not displayed in Android app tileAttribute("device.motion", key:"PRIMARY_CONTROL") { attributeState("inactive", label:"no motion", icon:"st.motion.motion.inactive", backgroundColor:"#79b821") - attributeState("active", label:"motion", icon:"st.motion.motion.active", backgroundColor:"#ffa81e") + attributeState("active", label:"motion", icon:"st.motion.motion.active", backgroundColor:"#ffa81e") } - + tileAttribute("device.tamper", key:"SECONDARY_CONTROL") { attributeState("active", label:'tamper active', backgroundColor:"#00a0dc") attributeState("inactive", label:'tamper inactive', backgroundColor:"#cccccc") - } + } } - + valueTile("temperature", "device.temperature", inactiveLabel: false, width: 2, height: 2) { state "temperature", label:'${currentValue}°', backgroundColors:[ @@ -56,15 +56,15 @@ metadata { [value: 96, color: "#bc2323"] ] } - + valueTile("illuminance", "device.illuminance", inactiveLabel: false, width: 2, height: 2) { state "luminosity", label:'${currentValue} ${unit}', unit:"lux" } - + valueTile("battery", "device.battery", inactiveLabel: false, width: 2, height: 2, decoration: "flat") { state "battery", label:'${currentValue}% battery', unit:"" } - + main "FGMS" details(["FGMS","battery","temperature","illuminance"]) } @@ -72,9 +72,9 @@ metadata { // parse events into attributes def parse(String description) { - log.debug "Parsing '${description}'" + log.debug "Parsing '${description}'" def result = [] - + if (description.startsWith("Err 106")) { if (state.sec) { result = createEvent(descriptionText:description, displayed:false) @@ -91,7 +91,7 @@ def parse(String description) { return null } else { def cmd = zwave.parse(description, [0x31: 5, 0x56: 1, 0x71: 3, 0x72: 2, 0x80: 1, 0x84: 2, 0x85: 2, 0x86: 1, 0x98: 1]) - + if (cmd) { log.debug "Parsed '${cmd}'" zwaveEvent(cmd) @@ -159,13 +159,13 @@ def zwaveEvent(physicalgraph.zwave.commands.notificationv3.NotificationReport cm map.descriptionText = "${device.displayName}: motion has stopped" } break - + case 3: map.name = "tamper" map.value = "active" map.descriptionText = "${device.displayName}: tamper alarm activated" break - + case 8: map.name = "motion" map.value = "active" @@ -173,7 +173,7 @@ def zwaveEvent(physicalgraph.zwave.commands.notificationv3.NotificationReport cm break } } - + createEvent(map) } @@ -194,39 +194,39 @@ def zwaveEvent(physicalgraph.zwave.commands.wakeupv2.WakeUpNotification cmd) cmds << "delay 500" cmds << encap(zwave.sensorMultilevelV5.sensorMultilevelGet(sensorType: 1, scale: 0)) cmds << "delay 500" - cmds << encap(zwave.sensorMultilevelV5.sensorMultilevelGet(sensorType: 3, scale: 1)) + cmds << encap(zwave.sensorMultilevelV5.sensorMultilevelGet(sensorType: 3, scale: 1)) cmds << "delay 1200" cmds << encap(zwave.wakeUpV1.wakeUpNoMoreInformation()) [event, response(cmds)] - + } -def zwaveEvent(physicalgraph.zwave.commands.manufacturerspecificv2.ManufacturerSpecificReport cmd) { +def zwaveEvent(physicalgraph.zwave.commands.manufacturerspecificv2.ManufacturerSpecificReport cmd) { log.debug "manufacturerId: ${cmd.manufacturerId}" log.debug "manufacturerName: ${cmd.manufacturerName}" log.debug "productId: ${cmd.productId}" log.debug "productTypeId: ${cmd.productTypeId}" } -def zwaveEvent(physicalgraph.zwave.commands.manufacturerspecificv2.DeviceSpecificReport cmd) { +def zwaveEvent(physicalgraph.zwave.commands.manufacturerspecificv2.DeviceSpecificReport cmd) { log.debug "deviceIdData: ${cmd.deviceIdData}" log.debug "deviceIdDataFormat: ${cmd.deviceIdDataFormat}" log.debug "deviceIdDataLengthIndicator: ${cmd.deviceIdDataLengthIndicator}" log.debug "deviceIdType: ${cmd.deviceIdType}" - + if (cmd.deviceIdType == 1 && cmd.deviceIdDataFormat == 1) {//serial number in binary format String serialNumber = "h'" - + cmd.deviceIdData.each{ data -> serialNumber += "${String.format("%02X", data)}" } - + updateDataValue("serialNumber", serialNumber) log.debug "${device.displayName} - serial number: ${serialNumber}" } } -def zwaveEvent(physicalgraph.zwave.commands.versionv1.VersionReport cmd) { +def zwaveEvent(physicalgraph.zwave.commands.versionv1.VersionReport cmd) { updateDataValue("version", "${cmd.applicationVersion}.${cmd.applicationSubVersion}") log.debug "applicationVersion: ${cmd.applicationVersion}" log.debug "applicationSubVersion: ${cmd.applicationSubVersion}" @@ -245,7 +245,7 @@ def configure() { sendEvent(name: "checkInterval", value: 8 * 60 * 60 + 2 * 60, displayed: false, data: [protocol: "zwave", hubHardwareId: device.hub.hardwareID]) def cmds = [] - + cmds += zwave.wakeUpV2.wakeUpIntervalSet(seconds: 7200, nodeid: zwaveHubNodeId)//FGMS' default wake up interval cmds += zwave.manufacturerSpecificV2.manufacturerSpecificGet() cmds += zwave.manufacturerSpecificV2.deviceSpecificGet() @@ -255,7 +255,7 @@ def configure() { cmds += zwave.sensorMultilevelV5.sensorMultilevelGet(sensorType: 1, scale: 0) cmds += zwave.sensorMultilevelV5.sensorMultilevelGet(sensorType: 3, scale: 1) cmds += zwave.wakeUpV2.wakeUpNoMoreInformation() - + encapSequence(cmds, 500) } diff --git a/devicetypes/smartthings/everspring-flood-sensor.src/everspring-flood-sensor.groovy b/devicetypes/smartthings/everspring-flood-sensor.src/everspring-flood-sensor.groovy index 29e1bf5..e5ee3ca 100644 --- a/devicetypes/smartthings/everspring-flood-sensor.src/everspring-flood-sensor.groovy +++ b/devicetypes/smartthings/everspring-flood-sensor.src/everspring-flood-sensor.groovy @@ -12,7 +12,7 @@ * */ metadata { - definition (name: "Everspring Flood Sensor", namespace: "smartthings", author: "SmartThings") { + definition (name: "Everspring Flood Sensor", namespace: "smartthings", author: "SmartThings", ocfDeviceType: "x.com.st.d.sensor.moisture") { capability "Water Sensor" capability "Configuration" capability "Sensor" @@ -29,7 +29,7 @@ metadata { status "battery ${i}%": new physicalgraph.zwave.Zwave().batteryV1.batteryReport(batteryLevel: i).incomingMessage() } } - + tiles(scale: 2) { multiAttributeTile(name:"water", type: "generic", width: 6, height: 4){ tileAttribute ("device.water", key: "PRIMARY_CONTROL") { diff --git a/devicetypes/smartthings/fibaro-motion-sensor.src/fibaro-motion-sensor.groovy b/devicetypes/smartthings/fibaro-motion-sensor.src/fibaro-motion-sensor.groovy index c07a019..9e2d769 100644 --- a/devicetypes/smartthings/fibaro-motion-sensor.src/fibaro-motion-sensor.groovy +++ b/devicetypes/smartthings/fibaro-motion-sensor.src/fibaro-motion-sensor.groovy @@ -29,7 +29,7 @@ * 2. 20150125 Todd Wackford * Leaned out parse and moved most device info getting into configuration method. */ - + /** * Sets up metadata, simulator info and tile definition. * @@ -38,7 +38,7 @@ * @return none */ metadata { - definition (name: "Fibaro Motion Sensor", namespace: "smartthings", author: "SmartThings") { + definition (name: "Fibaro Motion Sensor", namespace: "smartthings", author: "SmartThings", ocfDeviceType: "x.com.st.d.sensor.motion") { capability "Motion Sensor" capability "Temperature Measurement" capability "Acceleration Sensor" @@ -47,7 +47,7 @@ capability "Sensor" capability "Battery" capability "Health Check" - + command "resetParams2StDefaults" command "listCurrentParams" command "updateZwaveParam" @@ -110,7 +110,7 @@ state("active", label:'vibration', icon:"st.motion.acceleration.active", backgroundColor:"#53a7c0") state("inactive", label:'still', icon:"st.motion.acceleration.inactive", backgroundColor:"#ffffff") } - + main(["motion", "temperature", "acceleration", "illuminance"]) details(["motion", "temperature", "acceleration", "battery", "illuminance", "configure"]) @@ -130,18 +130,18 @@ def configure() { sendEvent(name: "checkInterval", value: 8 * 60 * 60 + 2 * 60, displayed: false, data: [protocol: "zwave", hubHardwareId: device.hub.hardwareID]) def cmds = [] - + // send associate to group 3 to get sensor data reported only to hub cmds << zwave.associationV2.associationSet(groupingIdentifier:3, nodeId:[zwaveHubNodeId]).format() // turn on tamper sensor with active/inactive reports (use it as an acceleration sensor) default is 0, or off cmds << zwave.configurationV1.configurationSet(configurationValue: [4], parameterNumber: 24, size: 1).format() cmds << zwave.configurationV1.configurationGet(parameterNumber: 24).format() - + // temperature change report threshold (0-255 = 0.1 to 25.5C) default is 1.0 Celcius, setting to .5 Celcius cmds << zwave.configurationV1.configurationSet(configurationValue: [5], parameterNumber: 60, size: 1).format() - cmds << zwave.configurationV1.configurationGet(parameterNumber: 60).format() - + cmds << zwave.configurationV1.configurationGet(parameterNumber: 60).format() + cmds << response(zwave.batteryV1.batteryGet()) cmds << response(zwave.versionV1.versionGet().format()) cmds << response(zwave.manufacturerSpecificV2.manufacturerSpecificGet().format()) @@ -155,20 +155,20 @@ def parse(String description) { def result = [] def cmd = zwave.parse(description, [0x72: 2, 0x31: 2, 0x30: 1, 0x84: 1, 0x9C: 1, 0x70: 2, 0x80: 1, 0x86: 1, 0x7A: 1, 0x56: 1]) - + if (description == "updated") { result << response(zwave.wakeUpV1.wakeUpIntervalSet(seconds: 7200, nodeid:zwaveHubNodeId)) - result << response(zwave.manufacturerSpecificV2.manufacturerSpecificGet()) + result << response(zwave.manufacturerSpecificV2.manufacturerSpecificGet()) } - + if (cmd) { - if( cmd.CMD == "8407" ) { + if( cmd.CMD == "8407" ) { result << response(zwave.batteryV1.batteryGet().format()) - result << new physicalgraph.device.HubAction(zwave.wakeUpV1.wakeUpNoMoreInformation().format()) + result << new physicalgraph.device.HubAction(zwave.wakeUpV1.wakeUpNoMoreInformation().format()) } result << createEvent(zwaveEvent(cmd)) } - + if ( result[0] != null ) { log.debug "Parse returned ${result}" result @@ -189,14 +189,14 @@ def zwaveEvent(physicalgraph.zwave.commands.crc16encapv1.Crc16Encap cmd) } } -def createEvent(physicalgraph.zwave.commands.manufacturerspecificv2.ManufacturerSpecificReport cmd, Map item1) { +def createEvent(physicalgraph.zwave.commands.manufacturerspecificv2.ManufacturerSpecificReport cmd, Map item1) { log.debug "manufacturerId: ${cmd.manufacturerId}" log.debug "manufacturerName: ${cmd.manufacturerName}" log.debug "productId: ${cmd.productId}" log.debug "productTypeId: ${cmd.productTypeId}" } -def createEvent(physicalgraph.zwave.commands.versionv1.VersionReport cmd, Map item1) { +def createEvent(physicalgraph.zwave.commands.versionv1.VersionReport cmd, Map item1) { updateDataValue("applicationVersion", "${cmd.applicationVersion}") log.debug "applicationVersion: ${cmd.applicationVersion}" log.debug "applicationSubVersion: ${cmd.applicationSubVersion}" @@ -205,7 +205,7 @@ def createEvent(physicalgraph.zwave.commands.versionv1.VersionReport cmd, Map it log.debug "zWaveProtocolSubVersion: ${cmd.zWaveProtocolSubVersion}" } -def createEvent(physicalgraph.zwave.commands.firmwareupdatemdv1.FirmwareMdReport cmd, Map item1) { +def createEvent(physicalgraph.zwave.commands.firmwareupdatemdv1.FirmwareMdReport cmd, Map item1) { log.debug "checksum: ${cmd.checksum}" log.debug "firmwareId: ${cmd.firmwareId}" log.debug "manufacturerId: ${cmd.manufacturerId}" @@ -304,7 +304,7 @@ def zwaveEvent(physicalgraph.zwave.commands.manufacturerspecificv2.ManufacturerS def msr = String.format("%04X-%04X-%04X", cmd.manufacturerId, cmd.productTypeId, cmd.productId) log.debug "msr: $msr" updateDataValue("MSR", msr) - + if ( msr == "010F-0800-2001" ) { //this is the msr and device type for the fibaro motion sensor configure() } @@ -334,7 +334,7 @@ def test() { * @return none */ def updateZwaveParam(params) { - if ( params ) { + if ( params ) { def pNumber = params.paramNumber def pSize = params.size def pValue = [params.value] @@ -344,7 +344,7 @@ def updateZwaveParam(params) { def cmds = [] cmds << zwave.configurationV1.configurationSet(configurationValue: pValue, parameterNumber: pNumber, size: pSize).format() cmds << zwave.configurationV1.configurationGet(parameterNumber: pNumber).format() - delayBetween(cmds, 1000) + delayBetween(cmds, 1000) } } @@ -388,13 +388,13 @@ def resetParams2StDefaults() { cmds << zwave.configurationV1.configurationSet(configurationValue: [18], parameterNumber: 86, size: 1).format() cmds << zwave.configurationV1.configurationSet(configurationValue: [28], parameterNumber: 87, size: 1).format() cmds << zwave.configurationV1.configurationSet(configurationValue: [1], parameterNumber: 89, size: 1).format() - + delayBetween(cmds, 500) } /** - * Lists all of available Fibaro parameters and thier current settings out to the - * logging window in the IDE This will be called from the "Fibaro Tweaker" or + * Lists all of available Fibaro parameters and thier current settings out to the + * logging window in the IDE This will be called from the "Fibaro Tweaker" or * user's own app. * *
THIS IS AN ADVANCED OPERATION. USE AT YOUR OWN RISK! READ OEM DOCUMENTATION! @@ -433,7 +433,6 @@ def listCurrentParams() { cmds << zwave.configurationV1.configurationGet(parameterNumber: 86).format() cmds << zwave.configurationV1.configurationGet(parameterNumber: 87).format() cmds << zwave.configurationV1.configurationGet(parameterNumber: 89).format() - + delayBetween(cmds, 500) } - diff --git a/devicetypes/smartthings/ge-link-bulb.src/ge-link-bulb.groovy b/devicetypes/smartthings/ge-link-bulb.src/ge-link-bulb.groovy index 2510a2f..778796b 100644 --- a/devicetypes/smartthings/ge-link-bulb.src/ge-link-bulb.groovy +++ b/devicetypes/smartthings/ge-link-bulb.src/ge-link-bulb.groovy @@ -42,7 +42,7 @@ */ metadata { - definition (name: "GE Link Bulb", namespace: "smartthings", author: "SmartThings") { + definition (name: "GE Link Bulb", namespace: "smartthings", author: "SmartThings", ocfDeviceType: "oic.d.light") { capability "Actuator" capability "Configuration" diff --git a/devicetypes/smartthings/open-closed-sensor.src/open-closed-sensor.groovy b/devicetypes/smartthings/open-closed-sensor.src/open-closed-sensor.groovy index 8883096..a535d7f 100644 --- a/devicetypes/smartthings/open-closed-sensor.src/open-closed-sensor.groovy +++ b/devicetypes/smartthings/open-closed-sensor.src/open-closed-sensor.groovy @@ -12,7 +12,7 @@ * */ metadata { - definition (name: "Open/Closed Sensor", namespace: "smartthings", author: "SmartThings") { + definition (name: "Open/Closed Sensor", namespace: "smartthings", author: "SmartThings", ocfDeviceType: "x.com.st.d.sensor.contact") { capability "Contact Sensor" capability "Sensor" @@ -44,7 +44,7 @@ def parse(String description) { if (description.startsWith("zone")) { resMap = createEvent(name: "contact", value: zigbee.parseZoneStatus(description).isAlarm1Set() ? "open" : "closed") } - + log.debug "Parse returned $resMap" return resMap } diff --git a/devicetypes/smartthings/wemo-bulb.src/wemo-bulb.groovy b/devicetypes/smartthings/wemo-bulb.src/wemo-bulb.groovy index 8f98b02..3329fd2 100644 --- a/devicetypes/smartthings/wemo-bulb.src/wemo-bulb.groovy +++ b/devicetypes/smartthings/wemo-bulb.src/wemo-bulb.groovy @@ -18,8 +18,8 @@ //DEPRECATED - Using the generic DTH for this device. Users need to be moved before deleting this DTH metadata { - definition (name: "WeMo Bulb", namespace: "smartthings", author: "SmartThings") { - + definition (name: "WeMo Bulb", namespace: "smartthings", author: "SmartThings", ocfDeviceType: "oic.d.light") { + capability "Actuator" capability "Configuration" capability "Refresh" @@ -57,7 +57,7 @@ metadata { valueTile("level", "device.level", inactiveLabel: false, decoration: "flat") { state "level", label: 'Level ${currentValue}%' } - + main(["switch"]) details(["switch", "level", "levelSliderControl", "refresh"]) @@ -87,11 +87,11 @@ def parse(String description) { if (description?.startsWith("read attr")) { log.debug description[-2..-1] def i = Math.round(convertHexToInt(description[-2..-1]) / 256 * 100 ) - + sendEvent( name: "level", value: i ) } - - + + } def on() { @@ -136,16 +136,16 @@ def setLevel(value) { def configure() { log.debug "Configuring Reporting and Bindings." - def configCmds = [ - + def configCmds = [ + //Switch Reporting "zcl global send-me-a-report 6 0 0x10 0 3600 {01}", "delay 500", "send 0x${device.deviceNetworkId} 1 1", "delay 1000", - + //Level Control Reporting "zcl global send-me-a-report 8 0 0x20 5 3600 {0010}", "delay 200", "send 0x${device.deviceNetworkId} 1 1", "delay 1500", - + "zdo bind 0x${device.deviceNetworkId} 1 1 6 {${device.zigbeeId}} {}", "delay 1000", "zdo bind 0x${device.deviceNetworkId} 1 1 8 {${device.zigbeeId}} {}", "delay 500", ] diff --git a/devicetypes/smartthings/zll-dimmer-bulb.src/zll-dimmer-bulb.groovy b/devicetypes/smartthings/zll-dimmer-bulb.src/zll-dimmer-bulb.groovy index a0568e7..c706147 100644 --- a/devicetypes/smartthings/zll-dimmer-bulb.src/zll-dimmer-bulb.groovy +++ b/devicetypes/smartthings/zll-dimmer-bulb.src/zll-dimmer-bulb.groovy @@ -16,7 +16,7 @@ import groovy.transform.Field @Field Boolean hasConfiguredHealthCheck = false metadata { - definition (name: "ZLL Dimmer Bulb", namespace: "smartthings", author: "SmartThings") { + definition (name: "ZLL Dimmer Bulb", namespace: "smartthings", author: "SmartThings", ocfDeviceType: "oic.d.light") { capability "Actuator" capability "Configuration" diff --git a/devicetypes/smartthings/zll-rgb-bulb.src/zll-rgb-bulb.groovy b/devicetypes/smartthings/zll-rgb-bulb.src/zll-rgb-bulb.groovy index 1e5345f..64ab4a1 100644 --- a/devicetypes/smartthings/zll-rgb-bulb.src/zll-rgb-bulb.groovy +++ b/devicetypes/smartthings/zll-rgb-bulb.src/zll-rgb-bulb.groovy @@ -14,7 +14,7 @@ import physicalgraph.zigbee.zcl.DataType metadata { - definition (name: "ZLL RGB Bulb", namespace: "smartthings", author: "SmartThings") { + definition (name: "ZLL RGB Bulb", namespace: "smartthings", author: "SmartThings", ocfDeviceType: "oic.d.light") { capability "Actuator" capability "Color Control" diff --git a/devicetypes/smartthings/zll-rgbw-bulb.src/zll-rgbw-bulb.groovy b/devicetypes/smartthings/zll-rgbw-bulb.src/zll-rgbw-bulb.groovy index 74cb921..aab76fb 100644 --- a/devicetypes/smartthings/zll-rgbw-bulb.src/zll-rgbw-bulb.groovy +++ b/devicetypes/smartthings/zll-rgbw-bulb.src/zll-rgbw-bulb.groovy @@ -14,7 +14,7 @@ import physicalgraph.zigbee.zcl.DataType metadata { - definition (name: "ZLL RGBW Bulb", namespace: "smartthings", author: "SmartThings") { + definition (name: "ZLL RGBW Bulb", namespace: "smartthings", author: "SmartThings", ocfDeviceType: "oic.d.light") { capability "Actuator" capability "Color Control" diff --git a/devicetypes/smartthings/zll-white-color-temperature-bulb-5000k.src/zll-white-color-temperature-bulb-5000k.groovy b/devicetypes/smartthings/zll-white-color-temperature-bulb-5000k.src/zll-white-color-temperature-bulb-5000k.groovy index a43c948..924c042 100644 --- a/devicetypes/smartthings/zll-white-color-temperature-bulb-5000k.src/zll-white-color-temperature-bulb-5000k.groovy +++ b/devicetypes/smartthings/zll-white-color-temperature-bulb-5000k.src/zll-white-color-temperature-bulb-5000k.groovy @@ -16,7 +16,7 @@ import groovy.transform.Field @Field Boolean hasConfiguredHealthCheck = false metadata { - definition (name: "ZLL White Color Temperature Bulb 5000K", namespace: "smartthings", author: "SmartThings") { + definition (name: "ZLL White Color Temperature Bulb 5000K", namespace: "smartthings", author: "SmartThings", ocfDeviceType: "oic.d.light") { capability "Actuator" capability "Color Temperature" @@ -101,7 +101,7 @@ def refresh() { if (!((device.getDataValue("manufacturer") == "Eaton") && (device.getDataValue("model") == "Halo_LT01"))) { cmds = cmds + zigbee.onOffConfig() + zigbee.levelConfig() + zigbee.colorTemperatureConfig() } - + cmds } diff --git a/devicetypes/smartthings/zll-white-color-temperature-bulb.src/zll-white-color-temperature-bulb.groovy b/devicetypes/smartthings/zll-white-color-temperature-bulb.src/zll-white-color-temperature-bulb.groovy index ee3130d..f143395 100644 --- a/devicetypes/smartthings/zll-white-color-temperature-bulb.src/zll-white-color-temperature-bulb.groovy +++ b/devicetypes/smartthings/zll-white-color-temperature-bulb.src/zll-white-color-temperature-bulb.groovy @@ -16,7 +16,7 @@ import groovy.transform.Field @Field Boolean hasConfiguredHealthCheck = false metadata { - definition (name: "ZLL White Color Temperature Bulb", namespace: "smartthings", author: "SmartThings") { + definition (name: "ZLL White Color Temperature Bulb", namespace: "smartthings", author: "SmartThings", ocfDeviceType: "oic.d.light") { capability "Actuator" capability "Color Temperature" diff --git a/devicetypes/smartthings/zwave-door-window-sensor.src/zwave-door-window-sensor.groovy b/devicetypes/smartthings/zwave-door-window-sensor.src/zwave-door-window-sensor.groovy index 0f751e9..b68e8b5 100644 --- a/devicetypes/smartthings/zwave-door-window-sensor.src/zwave-door-window-sensor.groovy +++ b/devicetypes/smartthings/zwave-door-window-sensor.src/zwave-door-window-sensor.groovy @@ -17,7 +17,7 @@ */ metadata { - definition (name: "Z-Wave Door/Window Sensor", namespace: "smartthings", author: "SmartThings") { + definition (name: "Z-Wave Door/Window Sensor", namespace: "smartthings", author: "SmartThings", ocfDeviceType: "x.com.st.d.sensor.contact") { capability "Contact Sensor" capability "Sensor" capability "Battery" diff --git a/devicetypes/smartthings/zwave-motion-sensor.src/zwave-motion-sensor.groovy b/devicetypes/smartthings/zwave-motion-sensor.src/zwave-motion-sensor.groovy index 2395602..60808ae 100644 --- a/devicetypes/smartthings/zwave-motion-sensor.src/zwave-motion-sensor.groovy +++ b/devicetypes/smartthings/zwave-motion-sensor.src/zwave-motion-sensor.groovy @@ -17,7 +17,7 @@ */ metadata { - definition (name: "Z-Wave Motion Sensor", namespace: "smartthings", author: "SmartThings") { + definition (name: "Z-Wave Motion Sensor", namespace: "smartthings", author: "SmartThings", ocfDeviceType: "x.com.st.d.sensor.motion") { capability "Motion Sensor" capability "Sensor" capability "Battery" @@ -36,7 +36,7 @@ metadata { status "inactive": "command: 3003, payload: 00" status "active": "command: 3003, payload: FF" } - + tiles { standardTile("motion", "device.motion", width: 2, height: 2) { state("active", label:'motion', icon:"st.motion.motion.active", backgroundColor:"#00A0DC") @@ -197,4 +197,4 @@ def zwaveEvent(physicalgraph.zwave.commands.manufacturerspecificv2.ManufacturerS result << createEvent(descriptionText: "$device.displayName MSR: $msr", isStateChange: false) result -} \ No newline at end of file +} diff --git a/devicetypes/smartthings/zwave-plus-door-window-sensor.src/zwave-plus-door-window-sensor.groovy b/devicetypes/smartthings/zwave-plus-door-window-sensor.src/zwave-plus-door-window-sensor.groovy index 403e5d9..9dedb75 100644 --- a/devicetypes/smartthings/zwave-plus-door-window-sensor.src/zwave-plus-door-window-sensor.groovy +++ b/devicetypes/smartthings/zwave-plus-door-window-sensor.src/zwave-plus-door-window-sensor.groovy @@ -16,7 +16,7 @@ */ metadata { - definition (name: "Z-Wave Plus Door/Window Sensor", namespace: "smartthings", author: "SmartThings") { + definition (name: "Z-Wave Plus Door/Window Sensor", namespace: "smartthings", author: "SmartThings", ocfDeviceType: "x.com.st.d.sensor.contact") { capability "Contact Sensor" capability "Configuration" capability "Battery" diff --git a/devicetypes/smartthings/zwave-virtual-momentary-contact-switch.src/zwave-virtual-momentary-contact-switch.groovy b/devicetypes/smartthings/zwave-virtual-momentary-contact-switch.src/zwave-virtual-momentary-contact-switch.groovy index 5f4db51..42c4903 100644 --- a/devicetypes/smartthings/zwave-virtual-momentary-contact-switch.src/zwave-virtual-momentary-contact-switch.groovy +++ b/devicetypes/smartthings/zwave-virtual-momentary-contact-switch.src/zwave-virtual-momentary-contact-switch.groovy @@ -16,7 +16,7 @@ * Date: 2013-03-07 */ metadata { - definition (name: "Z-Wave Virtual Momentary Contact Switch", namespace: "smartthings", author: "SmartThings") { + definition (name: "Z-Wave Virtual Momentary Contact Switch", namespace: "smartthings", author: "SmartThings", ocfDeviceType: "x.com.st.d.sensor.contact") { capability "Actuator" capability "Switch" capability "Refresh" diff --git a/devicetypes/smartthings/zwave-water-sensor.src/zwave-water-sensor.groovy b/devicetypes/smartthings/zwave-water-sensor.src/zwave-water-sensor.groovy index bd867b9..3fea1de 100644 --- a/devicetypes/smartthings/zwave-water-sensor.src/zwave-water-sensor.groovy +++ b/devicetypes/smartthings/zwave-water-sensor.src/zwave-water-sensor.groovy @@ -17,7 +17,7 @@ */ metadata { - definition (name: "Z-Wave Water Sensor", namespace: "smartthings", author: "SmartThings") { + definition (name: "Z-Wave Water Sensor", namespace: "smartthings", author: "SmartThings", ocfDeviceType: "x.com.st.d.sensor.moisture") { capability "Water Sensor" capability "Sensor" capability "Battery" @@ -29,7 +29,7 @@ metadata { status "dry": "command: 3003, payload: 00" status "wet": "command: 3003, payload: FF" } - + tiles { standardTile("water", "device.water", width: 2, height: 2) { state "dry", icon:"st.alarm.water.dry", backgroundColor:"#ffffff"