Hmm, I took a look but nothing is standing out.
If anyone is seeing strange behavior since about 2018-09-06 12pm EDT yesterday, please flag it. We’re working to address other issues such as this but may miss the obscure errors.
Hmm, I took a look but nothing is standing out.
If anyone is seeing strange behavior since about 2018-09-06 12pm EDT yesterday, please flag it. We’re working to address other issues such as this but may miss the obscure errors.
What version of groovy is it using now?
Anything devs need to watch out or change for a smooth transition ?
Version 2.5.6
Thanks. Looking at the release notes I came across this:
- The extension methods for the
java.util.Date
class are now in a separategroovy-dateutil
module which isn’t included by default when using thegroovy-all
pom dependency. Add the additional module as a dependency if you need it or consider migrating to the java.time JSR-310 classes (similar Groovy extension methods exist for those classes and they are included by default when using thegroovy-all
pom dependency).
Any changes required to SA/DTH using Date
class methods or is that compatibility inclusion/naming handled internally by the platform?
C’mon guys. Why can’t you communicate this stuff - or better yet, not make changes that destroy basic functionality??
i would hope they keep the code base update. but communication is nice. Did SmartThings ever update to Grails or whatever they were thinking about back in the day?
Release notes on the Apache Groovy site are here if anyone’s wondering.
What I’m wondering…
The Apache site lists 2.5.2 as the latest 2.5.x build. Is there a SmartThings-specific release notes for yesterday’s update that would cover changes most likely to affect ST device handlers and SmartApps?
2.5.6 Grails
2.4.10 Groovy
Big changes to JsonSlurper (use the JsonSlurperClassic if you’re having issues) but I believe that ST’s engineers are taking care of most differences internally for the transition to be smooth but if you do come across an issue post it back here.
Hi RBoy this has gone over my head, all I know is this line
def body = new groovy.json.JsonSlurper().parseText(parsedEvent.body)
Isn’t giving me the result it used too
Can you post the contents of parsedEvent.body
You can try using:
def body = new groovy.json.JsonSlurperClassic().parseText(parsedEvent.body)
What exactly is the issue? I don’t see any obvious issues.
yup I worked that bit out about a hour ago
had to change this
def itemDiscoveryHandler(evt) {
logMessage("evt = ${evt}", "trace")
def bulbs = evt.jsonData[0]
def scenes = evt.jsonData[1]
def groups = evt.jsonData[2]
def schedules = evt.jsonData[3]
def mac = evt.jsonData[4]
to
def itemDiscoveryHandler(evt) {
def data = parseJson(evt.data)
logMessage("evt = ${data}", "trace")
def bulbs = data[0]
def scenes = data[1]
def groups = data[2]
def schedules = data[3]
def mac = data[4]
Its not my code originally but to me I’m surprised it ever worked
But its working again and thats all that matters cheers for your help would never of worked it out if you hadnt posted about the classic json function a few hours ago.
Since I can’t replicate the evt
here can you post back what’s the difference being reported/printed between evt.jsonData
and parseJson(evt.data)
Tagging @Brad_ST and @gausnes FYR
Should evt.jsonData
be different from parseJson(evt.data)
?
with the original code i get the following in IDE
5c7e145a-165a-47cb-992f-b74a756c8c10 1:01:11 AM: error org.codehaus.groovy.runtime.typehandling.GroovyCastException: Cannot cast object '[{1={id=1, label=Spare Room 1, state={alert=none, bri=178, mode=homeautomation, on=false, reachable=true}, type=Dimmable light}, 10={id=10, label=Office 3, state={alert=none, bri=178, mod…[TRUNCATED]
5c7e145a-165a-47cb-992f-b74a756c8c10 1:01:11 AM: trace evt = physicalgrap…[TRUNCATED]
I think jsonData
has been made defunct and possibly because of this casting may not be handled by the platform now.
Maybe Luke or Brad can confirm.
EDIT: This may be of significance since many apps like CoRE and WebCoRE also still use evt.jsonData
Are you still seeing GroovyCastException
? We patched an issue introduced on Thursday that affected community developed SmartApps and DeviceTypeHandlers late last night. This is what I’m seeing
If I still use the code posted above in my smartapp I still get the following error
error org.codehaus.groovy.runtime.typehandling.GroovyCastException: Cannot cast object
Is this happening on a DeviceTypeHandler, if so we did not patch the cluster that handles events for community developed DeviceTypeHandlers? Could you send me your username I would like to look at the error messages that your account is generating.
My nyce hinge sensors have been bouncning between 0% and 100% since this issue first cropped up.