Not sure where the correct place is to post this, or to whom. There seems to be a change in 2.3.0.111 (from 2.2.9.146) in timeToString() conversion. This is on a C-7. I don't like to bother Bruce (@bravenel) or Victor (@gopher.ny) about something involving a community driver, but it appears that the error is coming from some change within the depths of the Hubitat code.
I'm using a Community integration (app and driver) (Sure PetCare (Connect)), ported to Hubitat from SmartThings by Dominick Meglio (@dman2306) that has been working fine through the past year, across every Hubitat firmware upgrade since Christmas 2020. This integration blew up with the 2.3.0.111 update, parent app throws an error (see subject line) every minute when it refreshes the related child device. The Sure PetCare Pet Door integration is my wife's favorite part of the Hubitat installation.
Here is log screenshot:
If I revert back to 2.2.9.146, the errors stop. If I then update back to 2.3.0.111, the errors return, every minute. Repeatable. No changes have been made to the app or drivers or to their settings.
Background and Operation
The SureFlap Pet Door is a cloud-integrated device with its own hub (integrated to Hubitat). It senses the microchip in each cat's neck, and unlocks the Pet Door to allow the cat to enter and exit, and maintains a history and presence for each cat. Using either the Hubitat Pet Door user app, or the SureFlap mobile app, a Curfew window can be set during which the cats can enter but not leave. The curfew has not been changed, neither by the Hubitat Pet Door user app, nor by the SureFlap mobile app.
Once a minute the Hubitat Pet Door user app polls the Pet Door device and updates the curfew time (in case it was changed by the mobile app) and cat presence (in case the cats enter or leave), plus some other states. If I change the Curfew time (presently, lock pet door at 8:30 pm, unlock pet door at 4:00 am), either by Hubitat Pet Door user app or by the mobile app, the time value changes to the updated times (lock, unlock) and the error message changes appropriately, but still keeps happening.
Here is the code for the Groovy routine that is causing the error on line 694:
Refresh routine
def refreshDevices() {
logDebug "Executing refreshDevices..."
if (atomicState.refreshCounter == null || atomicState.refreshCounter >= 10) {
atomicState.refreshCounter = 0
} else {
atomicState.refreshCounter = atomicState.refreshCounter + 1
}
def resp = apiGET("/api/me/start")
getChildDevices().each { device ->
device.setStatusRespCode(resp.status)
device.setStatusResponse(resp.data)
if (device.typeName == "Sure PetCare Pet") {
logDebug "High Freq Refreshing device ${device.typeName}..."
device.refresh()
} else if (device.typeName == "Sure PetCare Pet Door Connect") {
logDebug "High Freq Refreshing device ${device.typeName}..."
device.refresh()
//Update curfew status
def flap = resp.data.data.devices.find{device.deviceNetworkId.toInteger() == it.id}
if (flap.control.curfew && !flap.control.curfew.isEmpty()) {
def curfewObject = flap.control.curfew[0] ?: flap.control.curfew
app.updateSetting("curfewEnabled#${device.deviceNetworkId}", [type: "bool", value: true])
app.updateSetting("starting#${device.deviceNetworkId}", [type: "time", value: timeToString(curfewObject.lock_time, "yyyy-MM-dd'T'HH:mm:ss.SSSXX")])
app.updateSetting("ending#${device.deviceNetworkId}", [type: "time", value: timeToString(curfewObject.unlock_time, "yyyy-MM-dd'T'HH:mm:ss.SSSXX")])
} else {
app.updateSetting("curfewEnabled#${device.deviceNetworkId}", [type: bool, value: false])
}
} else if (atomicState.refreshCounter == 10) {
logDebug "Low Freq Refreshing device ${device.name} ..."
try {
device.refresh()
} catch (e) {
//WORKAROUND - Catch unexplained exception when refreshing devices.
logResponse(e.response)
}
}
}
}
The line (694) throwing the error is the "starting" time:
app.updateSetting("starting#${device.deviceNetworkId}", [type: "time", value: timeToString(curfewObject.lock_time, "yyyy-MM-dd'T'HH:mm:ss.SSSXX")])
I believe that the following line, for the "ending" time, would throw a similar error if it were ever reached.
Because I can't look into the Hubitat built-in timeToString() or app.updateSetting() code, I really don't know what changed between 2.2.9.146 and 2.3.0.111.
The code for the app that is throwing the error is here:
The code for the three drivers is here:
The ported integration thread is here:
Anyone have any ideas on how to change the time format string to accommodate changes in 2.3.0? Or, is anyone else seeing time conversion errors with 2.3.0?