diff --git a/devicetypes/smartthings/life360-user.src/life360-user.groovy b/devicetypes/smartthings/life360-user.src/life360-user.groovy index d78f5c3..5b72c64 100644 --- a/devicetypes/smartthings/life360-user.src/life360-user.groovy +++ b/devicetypes/smartthings/life360-user.src/life360-user.groovy @@ -39,7 +39,7 @@ metadata { } def generatePresenceEvent(boolean present) { - log.debug "Here in generatePresenceEvent!" + log.info "Life360 generatePresenceEvent($present)" def value = formatValue(present) def linkText = getLinkText(device) def descriptionText = formatDescriptionText(linkText, present) diff --git a/devicetypes/smartthings/smartsense-moisture-sensor.src/smartsense-moisture-sensor.groovy b/devicetypes/smartthings/smartsense-moisture-sensor.src/smartsense-moisture-sensor.groovy index 535359a..a8cb9d5 100644 --- a/devicetypes/smartthings/smartsense-moisture-sensor.src/smartsense-moisture-sensor.groovy +++ b/devicetypes/smartthings/smartsense-moisture-sensor.src/smartsense-moisture-sensor.groovy @@ -128,7 +128,7 @@ private Map parseCatchAllMessage(String description) { if (cluster.command == 0x07) { if (cluster.data[0] == 0x00){ log.debug "TEMP REPORTING CONFIG RESPONSE" + cluster - sendEvent(name: "checkInterval", value: 60 * 12, displayed: false, data: [protocol: "zigbee", hubHardwareId: device.hub.hardwareID]) + resultMap = [name: "checkInterval", value: 60 * 12, displayed: false, data: [protocol: "zigbee", hubHardwareId: device.hub.hardwareID]] } else { log.warn "TEMP REPORTING CONFIG FAILED- error code:${cluster.data[0]}" diff --git a/devicetypes/smartthings/smartsense-motion-sensor.src/smartsense-motion-sensor.groovy b/devicetypes/smartthings/smartsense-motion-sensor.src/smartsense-motion-sensor.groovy index f2f653b..fa71232 100644 --- a/devicetypes/smartthings/smartsense-motion-sensor.src/smartsense-motion-sensor.groovy +++ b/devicetypes/smartthings/smartsense-motion-sensor.src/smartsense-motion-sensor.groovy @@ -132,7 +132,7 @@ private Map parseCatchAllMessage(String description) { if (cluster.command == 0x07) { if (cluster.data[0] == 0x00) { log.debug "TEMP REPORTING CONFIG RESPONSE" + cluster - sendEvent(name: "checkInterval", value: 60 * 12, displayed: false, data: [protocol: "zigbee", hubHardwareId: device.hub.hardwareID]) + resultMap = [name: "checkInterval", value: 60 * 12, displayed: false, data: [protocol: "zigbee", hubHardwareId: device.hub.hardwareID]] } else { log.warn "TEMP REPORTING CONFIG FAILED- error code:${cluster.data[0]}" diff --git a/devicetypes/smartthings/smartsense-multi-sensor.src/smartsense-multi-sensor.groovy b/devicetypes/smartthings/smartsense-multi-sensor.src/smartsense-multi-sensor.groovy index 1183fe2..5cebcd0 100644 --- a/devicetypes/smartthings/smartsense-multi-sensor.src/smartsense-multi-sensor.groovy +++ b/devicetypes/smartthings/smartsense-multi-sensor.src/smartsense-multi-sensor.groovy @@ -161,7 +161,7 @@ private Map parseCatchAllMessage(String description) { if (cluster.command == 0x07) { if(cluster.data[0] == 0x00) { log.debug "TEMP REPORTING CONFIG RESPONSE" + cluster - sendEvent(name: "checkInterval", value: 60 * 12, displayed: false, data: [protocol: "zigbee", hubHardwareId: device.hub.hardwareID]) + resultMap = [name: "checkInterval", value: 60 * 12, displayed: false, data: [protocol: "zigbee", hubHardwareId: device.hub.hardwareID]] } else { log.warn "TEMP REPORTING CONFIG FAILED- error code:${cluster.data[0]}" @@ -339,7 +339,7 @@ private Map getContactResult(value) { log.debug "Contact: ${device.displayName} value = ${value}" def descriptionText = value == 'open' ? '{{ device.displayName }} was opened' : '{{ device.displayName }} was closed' sendEvent(name: 'contact', value: value, descriptionText: descriptionText, displayed: false, translatable: true) - sendEvent(name: 'status', value: value, descriptionText: descriptionText, translatable: true) + return [name: 'status', value: value, descriptionText: descriptionText, translatable: true] } private getAccelerationResult(numValue) { diff --git a/devicetypes/smartthings/smartsense-open-closed-sensor.src/smartsense-open-closed-sensor.groovy b/devicetypes/smartthings/smartsense-open-closed-sensor.src/smartsense-open-closed-sensor.groovy index 0d945cd..b8c9196 100644 --- a/devicetypes/smartthings/smartsense-open-closed-sensor.src/smartsense-open-closed-sensor.groovy +++ b/devicetypes/smartthings/smartsense-open-closed-sensor.src/smartsense-open-closed-sensor.groovy @@ -119,7 +119,7 @@ private Map parseCatchAllMessage(String description) { if (cluster.command == 0x07){ if (cluster.data[0] == 0x00) { log.debug "TEMP REPORTING CONFIG RESPONSE" + cluster - sendEvent(name: "checkInterval", value: 60 * 12, displayed: false, data: [protocol: "zigbee", hubHardwareId: device.hub.hardwareID]) + resultMap = [name: "checkInterval", value: 60 * 12, displayed: false, data: [protocol: "zigbee", hubHardwareId: device.hub.hardwareID]] } else { log.warn "TEMP REPORTING CONFIG FAILED- error code:${cluster.data[0]}" diff --git a/devicetypes/smartthings/smartsense-temp-humidity-sensor.src/smartsense-temp-humidity-sensor.groovy b/devicetypes/smartthings/smartsense-temp-humidity-sensor.src/smartsense-temp-humidity-sensor.groovy index fe93ef3..cd9648e 100644 --- a/devicetypes/smartthings/smartsense-temp-humidity-sensor.src/smartsense-temp-humidity-sensor.groovy +++ b/devicetypes/smartthings/smartsense-temp-humidity-sensor.src/smartsense-temp-humidity-sensor.groovy @@ -103,7 +103,7 @@ private Map parseCatchAllMessage(String description) { if (cluster.command == 0x07) { if (cluster.data[0] == 0x00){ log.debug "TEMP REPORTING CONFIG RESPONSE" + cluster - sendEvent(name: "checkInterval", value: 60 * 12, displayed: false, data: [protocol: "zigbee", hubHardwareId: device.hub.hardwareID]) + resultMap = [name: "checkInterval", value: 60 * 12, displayed: false, data: [protocol: "zigbee", hubHardwareId: device.hub.hardwareID]] } else { log.warn "TEMP REPORTING CONFIG FAILED- error code:${cluster.data[0]}" diff --git a/smartapps/smartthings/life360-connect.src/life360-connect.groovy b/smartapps/smartthings/life360-connect.src/life360-connect.groovy index c4f2b8e..d32fc14 100644 --- a/smartapps/smartthings/life360-connect.src/life360-connect.groovy +++ b/smartapps/smartthings/life360-connect.src/life360-connect.groovy @@ -289,12 +289,12 @@ def initializeLife360Connection() { state.life360AccessToken = result.data.access_token return true; } - log.debug "Response=${result.data}" + log.info "Life360 initializeLife360Connection, response=${result.data}" return false; } catch (e) { - log.debug e + log.error "Life360 initializeLife360Connection, error: $e" return false; } @@ -656,7 +656,7 @@ def generateInitialEvent (member, childDevice) { try { // we are going to just ignore any errors - log.debug "Generate Initial Event for New Device for Member = ${member.id}" + log.info "Life360 generateInitialEvent($member, $childDevice)" def place = state.places.find{it.id==settings.place} @@ -677,6 +677,8 @@ def generateInitialEvent (member, childDevice) { // log.debug "Distance Away = ${distanceAway}" boolean isPresent = (distanceAway <= placeRadius) + + log.info "Life360 generateInitialEvent, member: ($memberLatitude, $memberLongitude), place: ($placeLatitude, $placeLongitude), radius: $placeRadius, dist: $distanceAway, present: $isPresent" // log.debug "External Id=${app.id}:${member.id}" @@ -718,7 +720,7 @@ def haversine(lat1, lon1, lat2, lon2) { def placeEventHandler() { - log.debug "In placeEventHandler method." + log.info "Life360 placeEventHandler: params=$params, settings.place=$settings.place" // the POST to this end-point will look like: // POST http://test.com/webhook?circleId=XXXX&placeId=XXXX&userId=XXXX&direction=arrive @@ -729,8 +731,6 @@ def placeEventHandler() { def direction = params?.direction def timestamp = params?.timestamp - log.debug "Life360 Event: Circle: ${circleId}, Place: ${placeId}, User: ${userId}, Direction: ${direction}" - if (placeId == settings.place) { def presenceState = (direction=="in") @@ -745,10 +745,10 @@ def placeEventHandler() { if (deviceWrapper) { deviceWrapper.generatePresenceEvent(presenceState) - log.debug "Event raised on child device: ${externalId}" + log.debug "Life360 event raised on child device: ${externalId}" } else { - log.debug "Couldn't find child device associated with inbound Life360 event." + log.warn "Life360 couldn't find child device associated with inbound Life360 event." } }