Is this a porting from ST error, or just wrong coding

Can anyone suggest what is wrong with this?

Error code in logs
groovy.lang.MissingMethodException: No signature of method: dev1538906834217100243632.parseReportAttributeMessage() is applicable for argument types: (java.lang.String) values: [read attr - raw: 34531100060800002000, dni: 3453, endpoint: 11, cluster: 0006, size: 08, attrId: 0000, encoding: 20, value: 00] on line 74 (parse)

Line 73 & 74 in Driver Code

73 else if (description?.startsWith('read attr -')) {
74 map = parseReportAttributeMessage(description)

Device Driver porting questions like this are usually best addressed by @mike.maxwell, the Hubitat Team resident Driver subject matter expert. API specific questions are the specialty of @chuck.schwer. If you reach out to these guys, you will get great support. It often helps to share the entire driver source code to provide some context to what you're working on (if the license of the source code permits, of course.)

Thanks. Here is more of the code. (First line is Line 61) @mike.maxwell

// Parse incoming device messages to generate events

def parse(String description) {
   log.debug "Parsing '${description}'"
   
   def value = zigbee.parse(description)?.text
   log.debug "Parse: $value"
   Map map = [:]
   
   if (description?.startsWith('catchall:')) {
		map = parseCatchAllMessage(description)
	}
	else if (description?.startsWith('read attr -')) {
		map = parseReportAttributeMessage(description)
	}
    else if (description?.startsWith('on/off: ')){
    log.debug "onoff"
    def refreshCmds = zigbee.readAttribute(0x0006, 0x0000, [destEndpoint: 0x10]) +
    				  zigbee.readAttribute(0x0006, 0x0000, [destEndpoint: 0x11]) +
          
    				  zigbee.readAttribute(0x0006, 0x0000, [destEndpoint: 0x12])              
    
   return refreshCmds.collect { new hubitat.device.HubAction(it) }     
    	//def resultMap = zigbee.getKnownDescription(description)
   		//log.debug "${resultMap}"
        
        //map = parseCustomMessage(description) 
    }

	log.debug "Parse returned $map"
    //  send event for heartbeat    
    def now = new Date()
   
    sendEvent(name: "lastCheckin", value: now)
    
	def results = map ? createEvent(map) : null
	return results;
}

Your error message states that the hub can’t find the method: parseReportAttributeMessage()

This method may not have been implemented in Hubitat.
You need one of the HE guys to confirm that for you

@mike.maxwell ??

Andy

parseAttributeMessage doesn't exist, when I've seen this it has been a locally declared method that ends up parsing the data using zigbee.parseDessciptionAsMap. it's simpler to just start off parsing with that method.

@mike.maxwell

Do you mean zigbee.parseDescriptionAsMap ?

If so, where might I find some documentation as I have no clue where to start.

yes, typo.
It's pretty easy to figure out, well maybe not as easy as Z-Wave since Z-Wave pretty much spoon feeds you the answer.

def parse(description) {
    def descMap = zigbee.parseDescriptionAsMap(description)
    log.debug "descMap:${descMap}"
}

This is exactly where I start with a blank driver

1 Like

Maybe for those who code, but where would I find documentation to figure out how to change my code to parseDescriptionAsMap. I can usually work it out, but I need to see working examples, and working examples are few and far between here.
@mike.maxwell

It would probably be less frustrating to post a link to the driver you're trying to migrate, then I can suggest a stock driver that's likely to work with this device.
It appears to be a switch of some sort, there's not much point in reinventing the wheel here...

1 Like

Thanks. Completely at sea. Learning though.

This is the code::;Hubitat Β· GitHub

Have you tried this driver as is, it might work.

Yes, this is the driver I am currently using, however, I'm getting errors on line 71 as discussed above:

map = parseCatchAllMessage(description)

That's what I'm trying to fix, but dont really know how........
@mike.maxwell

I'm a little confused. Can you try running the code in the git repo above again and let me know the error message? I see references to lines 71, 73 and 74 in comments above.

At risk of being a newb........what is the git repo?? (Does the Driver Code not show up in Github, I opened in incognito mode and I could see it.....also the git is public).

Line 71 is getting this error in the logs, when I turn it on at the switch (physical)

Error code in logs
groovy.lang.MissingMethodException: No signature of method: dev1538906834217100243632.parseReportAttributeMessage() is applicable for argument types: (java.lang.String) values: [read attr - raw: 34531100060800002000, dni: 3453, endpoint: 11, cluster: 0006, size: 08, attrId: 0000, encoding: 20, value: 00] on line 74 (parse)

@mike.maxwell @chuck.schwer

Ok, so the error is on line 74, I'm not sure what you mean by line 71. Also git repo = github repository in this case. So yes, you are running the code from that link above. It is missing the method parseReportAttributeMessage(), where did the code come from? Is there a reason that method was removed? You can look at this code, it appears to define the method that you are missing, I have no idea if it works though.

I'm not sure why it's missing the method. It was the provided Device Handler by the seller of the light switch.

Thanks for the example, but I was under the impression that parseReportAttributeMessage() does NOT work in Hubitat (Is this a porting from ST error, or just wrong coding).

I was hoping for an example to see how to turn the above code into zigbee.parseDescriptionAsMap()
Before I get started, will parseReportAttributeMessage() work in Hubitat?
@mike.maxwell @chuck.schwer

Where is the link to that code?

It's not that it does not work, it does not exist. You need to define that method and implement it if you are going to use it. It does NOT work in ST either, it is a method that does not exist in either platform.

https://pastebin.com/d1ayFf9j

Here is the code from the seller.
@chuck.schwer

You'll have to ask them why their code is missing the method. You can try to write your own method for handling those incoming messages, but you need to be experienced with writing Zigbee drivers for you to be able to do this.

Take a look here, this also appears to implement some version of that method you are missing and may be enough to get you started: