Temperature/Humidity notification failed


#1

I'm using Xaiomi Temperature sensor. and get error when triggered temperature or humidity using Notifications. Get no message from the Pushover.

app:1012019-04-29 09:22:54.321 pm errorgroovy.lang.MissingMethodException: No signature of method: notifiApp.firstTemperature() is applicable for argument types: (null) values: [null] (tempHandler)
app:1032019-04-29 09:22:54.298 pm errorgroovy.lang.MissingMethodException: No signature of method: notifiApp.firstHumidity() is applicable for argument types: (null) values: [null] (humidHandler)
dev:352019-04-29 09:22:53.959 pm debugMotherRm_Temp: Creating event [name:humidity, value:66.1, unit:%, descriptionText:Humidity is 66.1%]
dev:352019-04-29 09:22:53.957 pm infoMotherRm_Temp: Humidity is 66.1%
dev:352019-04-29 09:22:53.952 pm debugMotherRm_Temp: Raw reported humidity = 66.08%
dev:352019-04-29 09:22:53.949 pm debugMotherRm_Temp: Message payload: 19D0
dev:352019-04-29 09:22:53.944 pm debugMotherRm_Temp: Parsing message: read attr - raw: E6440104050A000021D019, dni: E644, endpoint: 01, cluster: 0405, size: 0A, attrId: 0000, encoding: 21, command: 0A, value: D019
dev:352019-04-29 09:22:53.944 pm debugMotherRm_Temp: Creating event [name:temperature, value:27.19, unit:°C, descriptionText:Temperature is 27.19°C, translatable:true]
dev:352019-04-29 09:22:53.942 pm infoMotherRm_Temp: Temperature is 27.19°C
dev:352019-04-29 09:22:53.940 pm debugMotherRm_Temp: Data type of payload is little-endian; reversing byte order
dev:352019-04-29 09:22:53.917 pm debugMotherRm_Temp: Raw reported temperature = 27.19°C
dev:352019-04-29 09:22:53.914 pm debugMotherRm_Temp: Message payload: 0A9F
dev:352019-04-29 09:22:53.909 pm debugMotherRm_Temp: Parsing message: read attr - raw: E6440104020A0000299F0A, dni: E644, endpoint: 01, cluster: 0402, size: 0A, attrId: 0000, encoding: 29, command: 0A, value: 9F0A
dev:352019-04-29 09:22:53.906 pm debugMotherRm_Temp: Data type of payload is little-endian; reversing byte order

#2

The hotfix released today for 2.0.9 should address this.


#3

@bravenel
It seams that the hotfix did not solve this temperature notification completely.
It works for my Xaiomi temperature sensor but not some other.

I get this error in log when trying a notification rule. The same rule work's great when Xaiomi triggers over 25 degrees. When my Philio sensor get's over 25 this error comes in firmware 2.0.9.129.

app:5162019-05-01 16:47:38.922 errorjava.lang.NullPointerException: null (tempHandler)
app:5162019-05-01 16:47:28.743 errorjava.lang.NullPointerException: null (tempHandler)

#4

Please show your Notify main page setup.


#5

It is fixed for my case. I can't believe it can be fixed in such a short period. Many thanks.


#6

I think it's driver related. When switch to Generic z-wave Temperature/Humidity it works. When below driver is used it does not work. Is the driver wrong or is there still some bug in Notification ?.

/*
 * Philio PST02-1A 4-in-1 Multi Sensor Device Type
 *
 * Based on Philio PSM02 4-in-1 Multi Sensor Device Type by eyeonall
 * AND PSM01 Sensor created by SmartThings/Paul Spee
 * AND SmartThings' Aeon MultiSensor 6 Device Type
 * 
 *  Converted it for Philio PAT02-1B Temperature/Humidity sensor. /ChrBratt
 *  Added debug on/off option. /ChrBratt
*/
metadata {

    definition (name: "Philio PAT02-1B Sensor", namespace: "ertanden", author: "Ertan Deniz") {
        capability "Temperature Measurement"
        capability "RelativeHumidityMeasurement"
        capability "Configuration"
        capability "Sensor"
        capability "Battery"
        capability "Refresh"
        capability "Polling"

        fingerprint deviceId: "0x0513", inClusters: "0x5E,0x80,0x71,0x85,0x70,0x72,0x86,0x30,0x31,0x84,0x59,0x73,0x5A,0x8F,0x98,0x7A", outClusters: "0x20"
        fingerprint mfr:"013C", prod:"0002", model:"000B"
    }

/*    tiles {


        valueTile("temperature", "device.temperature", inactiveLabel: false) {
            state "temperature", label:'${currentValue}°',
                    backgroundColors:[
                            [value: 31, color: "#153591"],
                            [value: 44, color: "#1e9cbb"],
                            [value: 59, color: "#90d2a7"],
                            [value: 74, color: "#44b621"],
                            [value: 84, color: "#f1d801"],
                            [value: 95, color: "#d04e00"],
                            [value: 96, color: "#bc2323"]
                    ]
        }

        valueTile("humidity", "device.humidity", inactiveLabel: false) {
            state "humidity", label:'${currentValue} ${unit}', unit:"%"
        }

        valueTile("battery", "device.battery", inactiveLabel: false, decoration: "flat") {
            state "battery", label:'${currentValue}% battery', unit:""
        }

        main(["humidity", "temperature"])
        details(["humidity", "temperature", "battery", "configure", "refresh"])
    }
*/
    preferences {
        input description: "This feature allows you to correct any temperature variations by selecting an offset. Ex: If your sensor consistently reports a temp that's 5 degrees too warm, you'd enter \"-5\". If 3 degrees too cold, enter \"+3\".", displayDuringSetup: false, type: "paragraph", element: "paragraph"
        input "tempOffset", "number", title: "Temperature Offset", description: "Adjust temperature by this many degrees", range: "*..*", displayDuringSetup: false
		input name: "debugOutput", type: "bool", title: "Enable debug logging?", defaultValue: false
    }
}

preferences {
}

def installed() {
    logDebug "Installed with settings: ${settings}"

    setConfigured("false") //wait until the next time device wakeup to send configure command after user change preference
}

def updated() {
    logDebug "Updated with settings: ${settings}"
	    unschedule()
    if (debugOutput) runIn(1800,logsOff)

    setConfigured("false") //wait until the next time device wakeup to send configure command after user change preference
}

def parse(String description) {
    logDebug "parse() >> description: $description"
    def result = null
    if (description.startsWith("Err 106")) {
        logDebug "parse() >> Err 106"
        result = createEvent( name: "secureInclusion", value: "failed", isStateChange: true,
                descriptionText: "This sensor failed to complete the network security key exchange. If you are unable to control it via SmartThings, you must remove it from your network and add it again.")
	} else if (description != "updated") {
		if (logEnable) logDebug "parse() >> zwave.parse(description)"
		
		def myDesc
			if(	description.contains("command: 3003"))
			{
				myDesc = description.substring(0, description.length() - 7)
					if (logEnable) logDebug  "Removed chars from 3003() >> description: $myDesc"
			}
		else{
			myDesc = description
				if (logEnable) logDebug  "Telegram kept intact() >> description: $myDesc"
		}
		
		def cmd = zwave.parse(myDesc, [0x20: 1, 0x5E: 5, 0x5A: 5, 0x30: 2, 0x31: 5, 0x5A: 5, 0x70: 1, 0x72: 1, 0x80: 1, 0x84: 2, 0x85: 1, 0x86: 1])
									
		if (cmd) {
			result = zwaveEvent(cmd)
		}
	}
	if (logEnable) logDebug "After zwaveEvent(cmd) >> Parsed '${description}' to ${result.inspect()}"
	return result
}

// Event Generation
//this notification will be sent only when device is battery powered
def zwaveEvent(hubitat.zwave.commands.wakeupv2.WakeUpNotification cmd) {
    def result = [createEvent(descriptionText: "${device.displayName} woke up", isStateChange: false)]
    def cmds = []

    // Only ask for battery if we haven't had a BatteryReport in a while
    if (!state.lastbatt || now() - state.lastbatt > 24*60*60*1000) {
        result << response(command(zwave.batteryV1.batteryGet()))
        result << response("delay 1200")  // leave time for device to respond to batteryGet
    }

    if (!isConfigured()) {
        logDebug("late configure")
        result << response(configure())
    } else {
        logDebug("Device has been configured sending >> wakeUpNoMoreInformation()")
        cmds << zwave.wakeUpV2.wakeUpNoMoreInformation().format()
        result << response(cmds)
    }
    result
}

def zwaveEvent(hubitat.zwave.commands.multicmdv1.MultiCmdEncap cmd) {

    logDebug "multicmdencap: ${cmd.payload}"


    //def encapsulatedCommand = cmd.encapsulatedCommand()
    //if (encapsulatedCommand) {
    //    zwaveEvent(encapsulatedCommand)
    //}
}

def zwaveEvent(hubitat.zwave.commands.securityv1.SecurityMessageEncapsulation cmd) {
    def encapsulatedCommand = cmd.encapsulatedCommand([0x20: 1, 0x5E: 5, 0x5A: 5, 0x30: 2, 0x31: 5, 0x5A: 5, 0x70: 1, 0x72: 1, 0x80: 1, 0x84: 2, 0x85: 1, 0x86: 1])
    state.sec = 1
    logDebug "encapsulated: ${encapsulatedCommand}"
    if (encapsulatedCommand) {
        zwaveEvent(encapsulatedCommand)
    } else {
        log.warn "Unable to extract encapsulated cmd from $cmd"
        createEvent(descriptionText: cmd.toString())
    }
}

def zwaveEvent(hubitat.zwave.commands.securityv1.SecurityCommandsSupportedReport cmd) {
    log.info "Executing zwaveEvent 98 (SecurityV1): 03 (SecurityCommandsSupportedReport) with cmd: $cmd"
    state.sec = 1
}

def zwaveEvent(hubitat.zwave.commands.securityv1.NetworkKeyVerify cmd) {
    state.sec = 1
    log.info "Executing zwaveEvent 98 (SecurityV1): 07 (NetworkKeyVerify) with cmd: $cmd (node is securely included)"
    def result = [createEvent(name:"secureInclusion", value:"success", descriptionText:"Secure inclusion was successful", isStateChange: true)]
    result
}

def zwaveEvent(hubitat.zwave.commands.configurationv1.ConfigurationReport cmd) {
    logDebug "---CONFIGURATION REPORT V1--- ${device.displayName} parameter ${cmd.parameterNumber} with a byte size of ${cmd.size} is set to ${cmd.configurationValue}"
}

def zwaveEvent(hubitat.zwave.commands.sensormultilevelv5.SensorMultilevelReport cmd)
{
    logDebug "PAT02: SensorMultilevel before def map temp/humidity ${cmd.toString()}"
    def map = [:]
    switch (cmd.sensorType) {
        case 1:
            // temperature
            def cmdScale = cmd.scale == 1 ? "F" : "C"
            map.value = convertTemperatureIfNeeded(cmd.scaledSensorValue, cmdScale, cmd.precision)
            logDebug "Temperature cmd.scaledSensorValue ${map.value}"
			map.unit = getTemperatureScale()
            map.name = "temperature"
            if (tempOffset) {
                def offset = tempOffset as int
                def v = map.value as int
                map.value = v + offset
            }
            logDebug "Adjusted temp value ${map.value}"
			logDebug "Adjusted temp value ${map.name}"
			log.info "Temperature ${map.value}"
            break;
        case 5:
            // humidity
            map.value = cmd.scaledSensorValue
			logDebug "Humidity cmd.scaledSensorValue ${cmd.scaledSensorValue}"
            map.unit = "%"
            map.name = "humidity"
			logDebug "Adjusted humidity value ${map.value}"
			logDebug "Adjusted humidity value ${map.name}"
			log.info "Humidity ${map.value}"
            break;
    }
	
    //map
    createEvent(map)
}

def zwaveEvent(hubitat.zwave.commands.batteryv1.BatteryReport cmd) {
    logDebug "PAT02-1B: BatteryReport ${cmd.toString()}}"
    def map = [:]
    map.name = "battery"
    map.value = cmd.batteryLevel > 0 ? cmd.batteryLevel.toString() : 1
    map.unit = "%"
    map.displayed = false
	log.info "Battery ${map.value}"
    //map
    state.lastbatt = now()
    createEvent(map)
}



def zwaveEvent(hubitat.zwave.Command cmd) {
    logDebug "PAT02-1B: Catchall reached for cmd: ${cmd.toString()}}"
    [:]
}

def configure() {
    logDebug "PAT02-1B: configure() called"

    def request = []

    request << zwave.configurationV1.configurationSet(parameterNumber: 5, size: 1, scaledConfigurationValue: 1) // Operation Mode 0=Fahrenheit 1=Celsius
    request << zwave.configurationV1.configurationSet(parameterNumber: 7, size: 1, scaledConfigurationValue: 54) // Customer Function
    request << zwave.configurationV1.configurationSet(parameterNumber: 10, size: 1, scaledConfigurationValue: 12) // Auto report Battery time 1-127, default 12
    request << zwave.configurationV1.configurationSet(parameterNumber: 13, size: 1, scaledConfigurationValue: 12) // Auto report Temperature time 1-127, default 12
	request << zwave.configurationV1.configurationSet(parameterNumber: 14, size: 1, scaledConfigurationValue: 12) // Auto Report Humidity Time 1-127, default 12
	
	request << zwave.configurationV1.configurationSet(parameterNumber: 20, size: 1, scaledConfigurationValue: 30) // The interval time for auto report each tick in minutes, default 30
    request << zwave.configurationV1.configurationSet(parameterNumber: 21, size: 1, scaledConfigurationValue: 1) // The temperature differential to report in Fahrenheit. 0 means turn off this function, default 1 
	request << zwave.configurationV1.configurationSet(parameterNumber: 23, size: 1, scaledConfigurationValue: 2) // The humidity differential to report in percent %. 0 means turn off this function, default 5
	
    request << zwave.wakeUpV2.wakeUpIntervalSet(seconds: 24 * 3600, nodeid:zwaveHubNodeId) // Wake up period

    //7. query sensor data
    request << zwave.batteryV1.batteryGet()
    request << zwave.sensorMultilevelV5.sensorMultilevelGet(sensorType: 1) //temperature
    request << zwave.sensorMultilevelV5.sensorMultilevelGet(sensorType: 5) //humidity

    setConfigured("true")

    commands(request) + ["delay 20000", zwave.wakeUpV2.wakeUpNoMoreInformation().format()]
}

private setConfigured(configure) {
    logDebug "setConfigured: ${configure}"
    updateDataValue("configured", configure)
}

private isConfigured() {
    getDataValue("configured") == "true"
}

private command(hubitat.zwave.Command cmd) {
    if (state.sec) {
        zwave.securityV1.securityMessageEncapsulation().encapsulate(cmd).format()
    } else {
        cmd.format()
    }
}

private commands(commands, delay=200) {
    log.info "sending commands: ${commands}"
    delayBetween(commands.collect{ command(it) }, delay)
}

def logsOff(){
log.warn "debug logging disabled..."
device.updateSetting("debugOutput",[value:"false",type:"bool"])
}

private logDebug(msg) {
if (settings?.debugOutput || settings?.debugOutput == null) {
log.debug "$msg"
}
}

#7

Oh, so a custom driver doesn't work and a built-in driver does? Hmmmm... What conclusion would you reach??


#8

Same as you :grinning::+1:
Tested it after the post, so went in to update it but you was to quick and had answered it already :grin:

Will try to troubleshoot it later if i can.