missingMethod exception when trying to get device events


(Haukur Þórsson) #1

Hi,

I’m trying to get a list of events for a given device (a contact sensor) in a SmartApp. When I try to call the .events() or .eventsSince() etc. methods I get a missingMethod exception.

This is what I’m doing:

contactSensors.findAll( { it.id == id} ).each {

       def result = it.events()?.collect{
    	[
           .....
       ]}		
}

contactSensors is a list of all the contactSensors I’ve granted my app access to. ID is the guid of the sensor I’m looking at. If I print out “it”, then that’s my contact sensor. But it is as though the “it” object has no .events() method. I’m obviously doing something wrong here. Any ideas?

I’m a Groovy n00b so please be gentle :slight_smile:


(Haukur Þórsson) #2

Nobody has any clue? I surely cannot be the first person to try to do this :slight_smile: