LGSTrayBattery stops working after the computer was in Standby
First of all, thank you for this tool, exactly what i was looking for! Annoying that GHUB does not do this by default...
I noticed that if i put my computer into sleep mode / standby (for example over night or when i leave for a couple of hours) and turn it back on again, the tool doesn't work anymore-->the battery % is not updated anymore. If i restart the pc it works just fine again. Something in the tools
A tiny bit annoying, since i do not want to shut down my pc every time. Anyone else having similar issues?
My workaround is to rediscover devices every time after waking up the system. You will then have duplicated devices in the list. Uncheck the old ones and select the new ones.
That seems to work, thanks! I will still leave this thread open, maybe the developer will work on a new version some time where this will be fixed. Not a big issue, still a bit annoying that this needs to be done every time 😄
That seems to work, thanks! I will still leave this thread open, maybe the developer will work on a new version some time where this will be fixed. Not a big issue, still a bit annoying that this needs to be done every time 😄
Totally agree.
Also note that this only happens on devices with the GHUB method, not the Native ones. I'm guessing that GHUB would refresh device ids on every restore from standby. There might not be a quick fix as the developer mentioned that the GHUB method depends entirely on GHUB protocol.
@andyvorld Just noticed that after waking up from sleep the devices are no longer updated (L Ghub). Seems like Ids change on re-discovery.:
i.e. my keyboard was visible as dev00000001 before sleep, and after sleep is no longer available at that address - rediscover creates a new device with different ID:
This XML file does not appear to have any style information associated with it. The document tree is shown below.
<xml>
<device_id>dev00000005</device_id>
<device_name>G515 LIGHTSPEED TKL Gaming Keyboard</device_name>
<device_type>Keyboard</device_type>
<battery_percent>56.00</battery_percent>
<battery_voltage>0.00</battery_voltage>
<mileage>24.52</mileage>
<charging>False</charging>
<last_update>12/14/2025 13:04:13 +01:00</last_update>
</xml>
Because of different ID my HomeAssistant scrape sensors no longer update, and my wireless charger automation ceases to work :D
Possible idea for the solution:
- detect wake up events
- after wake up automatic rediscover
- map to the old id to make web api return same device
And after all - great tool, one of a kind!
EDIT:
it seem we can query the device with it's name, so that's a workaround for point no. 3 --> to be tested
http://192.168.1.4:12342/device/G515%20LIGHTSPEED%20TKL%20Gaming%20Keyboard
EDIT2: Maybe we could workaround the freezing issue by killing and restarting the app with a script added as a scheduled task to user logon event?
This needs further testing - today after waking up my native (non G Hub) device updated, just after the configured 30 minute interval passed. This might've caused me thinking that it's not updating after the wake up. It's possible that the only problem is id change - which can be easily mitigated by scraping by name (unless someone has more than one identical keyboard :D)
"synthetic" test, rebooted, put to sleep, woken up after about 15 minutes. Native seem to update after configured 15 minute interval, GHub provider still stuck at old percentage. Left PC on to wait for any state change. I don't see what I noticed previously - id change of the device on Ghub provider. I assume id did actually change, and proper values are reported by GHub on new id probably dev00000002. Native seem to work just fine.
Another sleep - wake up cycle. Native polling works, new value updated. Ghub provider stuck. Manual "Rediscover devices" - GHub devices shown up, new ids and updated values. For the time being I'll fall back to native polling.