All Zigbee buttons showing 0% Batteries (7 September 2018) Solved

All my buttons show 0% battery from last night. They all are working and changing the battery makes no difference.

What DTH are you using?

Stock ZigBee Button.

I Believe they have made backend changes which is causing math calculations to be wrong or bad code has now become errors. My smartapp is now full of errors

2 Likes

There was a change yesterday which is causing this for devices using the zigbee-button, nyce-motion-sensor, or nyce-open-closed-sensor device handler. It may also be impacted custom devices which use this:

result.value = Math.min(100, (int) pct * 100)

The above can be changed to

result.value = Math.min(100, (int) (pct * 100))

Or

result.value = Math.min(100, Math.round(pct * 100))

We’re looking at a hotfix and I’ll keep this thread updated.

1 Like

We upgraded major versions of Groovy yesterday for executing SmartApps and DeviceTypeHandlers, which included some rather major changes to the language.

If you want to DM me I’d be happy to help you dig into the issues that you are experiencing

1 Like

This…seems like something that may have been good to commmunicate.

6 Likes

Don’t you know that Samsung’s slogan is to “always be proactive, after the fact”?

1 Like

wouldn’t it be more useful to start a topic with whats been deprecated/added/updated

There appears to be quite a few apps & dh that are now getting errors

currently my error is
org.codehaus.groovy.runtime.typehandling.Groovy…[TRUNCATED]

1 Like

What’s the full error?

thats all i get in the ide logs

Support has been fantastic and it looks like a fix is in the works.

A hotfix was deployed. If your device is still reporting 0%, try tapping the “Refresh” tile in the Classic app or remove/re-add the batteries.

3 Likes

Can confirm all is good now. THANK YOU!! :+1:

1 Like

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 ?

2 Likes

Version 2.5.6

3 Likes

Thanks. Looking at the release notes I came across this:

  • The extension methods for the java.util.Date class are now in a separate groovy-dateutil module which isn’t included by default when using the groovy-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 the groovy-all pom dependency).

Any changes required to SA/DTH using Date class methods or is that compatibility inclusion/naming handled internally by the platform?

1 Like

C’mon guys. Why can’t you communicate this stuff - or better yet, not make changes that destroy basic functionality??

4 Likes

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?

1 Like