I am working on a new driver for the ZXT-120. I am finding that it doesn’t update it’s temperature value unless I select refresh.
I thought I needed to add poll capability and found this thread.
But looking at sample code for “Aeon Multisensor” which works fine in my ST I don’t see any polling code.
I do see this config code
def configure() {
delayBetween([
// REMOVED CODE RELATIVE TO MOTION REPORTING
...
// send all data (temperature, humidity, illuminance & battery) periodically
zwave.configurationV1.configurationSet(parameterNumber: 101, size: 4, scaledConfigurationValue: 225).format(),
// set data reporting period to 5 minutes
zwave.configurationV1.configurationSet(parameterNumber: 111, size: 4, scaledConfigurationValue: 300).format()
])
}
But this looks specific to the Aeon Multi.
Is polling the correct way to do this or are sensors different since they are intended to send data ?
On a side note. I am trying to add a “Last Polled” tile to display the date/time of the last poll.
// Last Poll Tile
standardTile(“lastPoll”, “device.lastPoll”, inactiveLabel: false) {
state “lastPoll”, label:‘${currentValue}’
}
But I can’t figure out how to populate the device.lastPoll value in my poll method. Forgive me if this is just a simple groovy command. I am new to groovy and still trying to figure out what is Groovy API and what is ST API. I think I need to create an event but not sure how. I tried the following in poll and I know it gets hit when I select refresh.
def now=new Date()
def nowString = now.format("MMM/dd HH:mm")
sendEvent("name":"lastPoll", "value":nowString)