Any advice on what to do when the decimal places are way too many and screw up my Dashboard? When it reports so many decimal places it pushes over the battery icon and it's no longer visible. The device is a laptop running Fully Kiosk Browser. It doesn't do it all the time, just every so often one of the battery levels have a long list of digits after the decimal, lol. Even if the device is reporting a pile of decimal places shouldn't the Dashboard tile only report max 3 digits so it doesn't screw up it's formatting? I managed to capture this today so you can see what I am talking about a little better.
What is the Device Driver that is producing the excessive decimal places? If custom code, I would modify it to truncate to only 1 decimal place (or none.) If this is a built-in Hubitat driver, then you should report it to the Hubitat team.
Well thanks for that @ogiewon, it's the "Fully Kiosk Browser Controller" Driver. Great Idea!! Just have to find that part of the code and figure out how to do it, lol.
Maybe the developer will hear my sad story and help me @gavincampbell
Looks like lines 184 and 423 are the ones that issue the sendEvent() calls for the battery attribute. You'll just need to do a little formatting on the 'value' to make sure the excess decimal places are removed.
Hi @ogiewon , I never did get this to work properly. I tried Round, Trunc and mess with a couple big decimal and Math things. They just keep coming back with an error. I am sure I am not doing it correctly with the syntax and still get the bigggggg long decimal and my battery indicator shifts out of the tile. I am certainly no programmer, but I try. Would you be so kind and have a look at what needs to be done to fix this? I tried reaching out to the original developer, but sadly no response.
@chad.andrews
This is how I have been doing rounding and it seems to work good for any variable type, as it converts to a double first. Change the number to be how many decimals you want.
@jtp10181 , this looks promising. I hit refresh and no errors, and the battery level jumped to no decimal places, like I want. I will keep an eye and see how it goes. Thanks