Low battery notification bug (formerly Issues with SmartThings support through app)

Three weeks ago I used the Menu - Contact Us - Error report feature of the SmartThings app to report the broken user interface for groups. Never got a response (and it’s still broken but that’s not the topic of this post).

Today I decided to write about another issue, in this case multiple low battery notifications that happen from time to time, for devices that according to the battery level in the capability are above 60%.

This time I got a response, but quite unexpected! For context, my country is Spain but my Android is set to English and the app is set to English so the screenshots and my own text were in English just like I write here.

Dear Customer,

Thank you for contacting us.

We appreciate the opportunity to assist you.

Kindly know that you have contacted the Samsung Apps and Services department, here we offer support for certain applications (Galaxy Store, Galaxy Themes, SmartThings Find and many others).

Our department can offer assistance in the Spanish.

If you want to receive assistance for your inquiry in Spanish please contact us again as soon as possible.

If not, please try seeking support through the Samsung Members app, as other languages are supported through the application

Thank you for using our services. Your satisfaction is very important to us. Kind regards,

Hi, @mocelet

Did you reply to them to get help? I don’t know why they wanted to give you the whole support in Spanish if you wrote the description in English. Sometimes we struggle with screenshots when they’re in another language, but there are tools that can help us translate text in a picture.
If you want, since I saw this was mentioned in another post, I can take this case; I speak Spanish as well FWIW :smiley:

So, I would need the following:

  1. Whenever you receive a “low battery” notification. Please take a screenshot to see the complete message there
  2. Then, collect the app logs. These are the instructions for Android and iOS:
    —Android

—iOS

  1. I’m guessing the device name appears in the notification, right? I’ll need support access to your account to get its info and current status,
3 Likes

Thanks @nayelyz , before going full troubleshooting I’d like to check something first.

The type of notifications are these:

Sometimes it says 1%, sometimes 15%. When I go to the device screen the actual battery level is 60% or more.

There are usually two or three notifications at the same time, not always the same buttons. I’m more or less convinced it happens once after a hub firmware update since I can find a pattern between the frequency of the notifications and the frequency of hub updates.

The ones in the screenshot happened in May 30th, 22:16 local time (that’s 20:16 UTC). Coincidentally or not, there was a recent hub firmware update to 57.13.

Turns out most of my battery-powered devices are IKEA buttons that are supported by my custom driver shared here so I actually would like to know if the issue comes from the device or the driver reporting a wrong value.

There used to be the option to check the battery history from the app or the battery events from the advanced website, is there no way to see the history now?

If you can access the battery history for me (already allowed access), please check the “SOMRIG Button” for instance (hub named Hub, my email is not the same of the community but you probably know that from previous DMs) to see if there’s any weird battery report during May 30th. Thanks!

Edit: No need for that, skip forward to Low battery notification bug (formerly Issues with SmartThings support through app) - #6 by mocelet

What are the raw value.values here?

local battery_perc_attr_handler = function(driver, device, value, zb_rx)
  -- Battery readings depends on the model and firmware version.
  -- See has_old_ikea_firmware function
  local reported_value = has_old_ikea_firmware(device) and value.value or utils.round(value.value / 2)
  local percentage = utils.clamp_value(reported_value, 0, 100)
  device:emit_event(capabilities.battery.battery(percentage))
end

There used to be the option to check the battery history from the app or the battery events from the advanced website, is there no way to see the history now?

Do you have a log line in your development driver?

I’m asking, because the device/firmware could have a bug and reports wrong values every so often.

The raw value doesn’t matter, the battery level is correct everytime I look at it. That’s why I want @nayelyz to confirm that there’s not an out of place report in the history of battery events, which is what SmartThings checks to notify low battery.

I don’t think it’s related to the reports of the device, I’ve never seen a report of 0%, which is the only percentage that would trigger a “less than 1%” battery. Plus, it’s a relatively recent issue.

Now everything makes sense, there’s indeed a bug in SmartThings that will generate false low-battery warnings that nobody but me could experience! :exploding_head:.

I was able to replicate it, happens right when the hub restarts. That’s why I associated it to a hub update, my hub only restarts when it updates (or the eventual country-wide power outage, now that I recall).

The funny stuff: of the 8 buttons using the same driver, I only get 2 or 3 false low-battery warnings and at the same time. They don’t correlate to any actual battery level report received, there are no battery reports at all because that happens every 6 hours, not on demand when the hub restarts, and I was logging before driver initialization to confirm it.

What triggers it and why does not happen to everybody using my driver?

Turns out three months ago I added a feature that never published to the shared channel to populate on initialization the battery type (CR2032, AAA) and the battery quantity (1 or 2) so SmartThings can display it. You’re not missing out much:

2025-05-31T17:50:58.222904345Z INFO Ikea Button Tweaks  <ZigbeeDevice: a12a2b84-112a-425c-967a-9ecc9267c16a [0x9A25] (SOMRIG Button)> emitting event: {"attribute_id":"type","capability_id":"battery","component_id":"main","state":{"value":"AAA"}}
2025-05-31T17:50:58.415372261Z INFO Ikea Button Tweaks  <ZigbeeDevice: a12a2b84-112a-425c-967a-9ecc9267c16a [0x9A25] (SOMRIG Button)> emitting event: {"attribute_id":"quantity","capability_id":"battery","component_id":"main","state":{"value":1}}

I am quite sure this is what triggered it, even if it’s not a battery level report.

It is not a spread bug because only one stock driver uses this feature (an Aqara lock, source here) so very few people could experience the issue. On top of that, there’s a race condition for it to happen…

My theory of the bug

I believe it’s sort of a race condition at initialization after a hub restart: as soon as the battery capability is involved because unrelated attributes are emitted (the type and quantity), SmartThings checks the battery level and, since it’s been restarted maybe the value has not sync’ed yet with the cloud or the cache and it’s zero so it triggers the warning. Makes sense that it reports less than 1%.

The race condition explains why it does not happen in the 8 devices and only 2 or 3 that sometimes are random: because that’s the time it takes for the data to sync. By the time the attributes for the fourth button are emitted, the battery capability has been already populated from cache and no warning was generated since it was over 60%.

I guess the fix would be for SmartThings to wait after a hub restart to ensure that the battery level is an actual reported value and not a pre-initialization default value which is what apparently triggers it.

2 Likes

Hi, @mocelet

So, if I understand correctly, you have commands to initialize those values in the Init lifecycle of the driver, right?

I suggest that if you want to initialize a capability value, do it in the “added” lifecycle since that happens only when a device is installed instead of the driver being restarted.
Also, I’ve seen that instead of using a fixed value, you send a “GET” command to get the current value of the capability.

1 Like

Thanks @nayelyz

Indeed, I did it in init lifecycle because that’s the most sensible place to update the information to already installed devices that won’t trigger other lifecycle events like added.

It’s also how the (only?) stock driver using the feature does it too, emitting the two attributes in initialization:

There is no “GET” command by the way, if you meant the logs, that was just the log generated by the two device:emit_event commands.

That’s why I consider that a bug in SmartThings: emit a event which has nothing to do with the battery level and, in some cases, SmartThings will incorrectly notify a less than 1% low-battery.

Granted, probably nobody is going to experience this. I don’t plan to make the battery information feature public and I just removed it from my driver version to avoid the notifications on restart.

I appreciate your suggested workarounds like only populate the info in added. I guess a delayed call to emit_event or using persistent flags in init so it only runs once would also work.

Thanks again @nayelyz for the support, from my part we can leave it here, just let the engineering team know there’s a bug around that can trigger low-battery warnings, at least so they are aware.

Hi, @mocelet
Thank you for sharing your findings. Is it possible for you to replicate the issue and share with us the following, please?

  1. Timestamp of when you reboot the hub
  2. After you see everything comes back again, please submit the hub logs

The bug is getting more interesting as I didn’t even have to reboot the hub! Installed the driver package that emit those attributes and the low battery notifications jumped right away.

This time they were 3 notifications instead of 2 of other times.

So it’s not a race condition when the hub restarts, if any it’s something when the driver restarts.

I just did the Dump Hub Logs, the init of the buttons was today 2025-06-03 at 18:14 UTC time. The notifications were received pretty much instantly.

ok, thanks for the info, I’ll share it with the team.

1 Like

Hi, @mocelet

The engineering team told me they released a fix for this issue. Could you please help us confirm if you stopped getting the “low battery notification” even when you have the event for battery.quantity in the init lifecycle?

2 Likes

It is fixed indeed!! Thanks :grinning_face_with_smiling_eyes:

2 Likes