-
-
Notifications
You must be signed in to change notification settings - Fork 20
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Configurable number of decimal places for precip_accumulation entities #192
Comments
In the 1.4.2 release I added When you look at the sensor in your HA install is it rounded to 4 decimal places or does it show all 11 decimal places? Starting in 2023.3 you are able to change the display precision for each sensor individually which should solve your issue here. |
I've actually made some precision changes to some of those PW sensors using
the drop-down in the Entity settings UI... to no effect. The entity state
remains in its full, extended value.
Have a look at the attachments...
Thanks!
[image: Entity State.png][image: Lovelace.png][image: Entity Settings.png]
…On Mon, Feb 12, 2024 at 11:39 AM Kev ***@***.***> wrote:
In the 1.4.2 release I added suggested_display_precision to all the
sensors and for the precipitation accumulation sensor I set it to only have
4 decimal places. When I look at the sensor in my HA I see the following:
image.png (view on web)
<https://github.com/Pirate-Weather/pirate-weather-ha/assets/10248058/26c3a4a9-d866-48f8-a77e-082145f5cf46>
When you look at the sensor in your HA install is it rounded to 4 decimal
places or does it show all 11 decimal places? Starting in 2023.3
<https://www.home-assistant.io/blog/2023/03/01/release-20233/#sensor-display-precision>
you are able to change the display precision for each sensor individually
which should solve your issue here.
—
Reply to this email directly, view it on GitHub
<#192 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ASNXDRRU6MG4JLJEUBAZKQLYTJAU5AVCNFSM6AAAAABDEY4XIGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSMZZGEYTIMBQGI>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
The images you included didn't attach to your post. |
Ah; try this:
https://imgur.com/a/oe0wQYA
I've gone through and set every precip_accum* entity to a precision of x.x
and restarted HA. This is the result.
…On Mon, Feb 12, 2024 at 12:03 PM Kev ***@***.***> wrote:
The images you included didn't attach to your post.
—
Reply to this email directly, view it on GitHub
<#192 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ASNXDRW4HRY5XP6FCRBOJYTYTJDKBAVCNFSM6AAAAABDEY4XIGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSMZZGE2TINBRGY>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
That link worked thanks. As far as I can tell that option doesn't actually change the value of the sensors which is why the 2nd and 3rd screenshots still show the sensor with 11 decimal places. What is the weather card you are using in your third screenshot? It's possible that it hasn't been updated to take advantage of the option to change the display precision in HA. |
I'm using the Platinum Weather Card, and you're probably right... it likely
isn't using the precision attribute. Or, maybe it's not an attribute, but
in any case it doesn't change how the sensors are displayed.
…On Mon, Feb 12, 2024 at 12:58 PM Kev ***@***.***> wrote:
That link worked thanks. As far as I can tell that option doesn't actually
change the value of the sensors which is why the 2nd and 3rd screenshots
still show the sensor with 11 decimal places.
What is the weather card you are using in your third screenshot? It's
possible that it hasn't been updated to take advantage of the option to
change the display precision in HA.
—
Reply to this email directly, view it on GitHub
<#192 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ASNXDRQVRF6ZZJUTO7ABDCTYTJJ5ZAVCNFSM6AAAAABDEY4XIGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSMZZGI2TEMRYGI>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
That weather card hasn't been updated since December 2022 which is before the precision attribute was added to HA. There was code before which should have rounded the sensors to specific number of decimals but it didn't seem to work but maybe it could be looked into and see if it could start working, There's also another issue where the integration is always using scientific units and then they get converted into local units. I remember seeing that it used to not always be that way but it was causing some issues. Either way I'll ping @alexander0042 to see what the options for this are. |
I appreciate you digging into this, thanks.
…On Mon, Feb 12, 2024 at 2:00 PM Kev ***@***.***> wrote:
That weather card hasn't been updated since December 2022 which is before
the precision attribute was added to HA.
There was code before which should have rounded the sensors to specific
number of decimals but it didn't seem to work but maybe it could be looked
into and see if it could start working, There's also another issue where
the integration is always using scientific units and then they get
converted into local units. I remember seeing that it used to not always be
that way but it was causing some issues.
Either way I'll ping @alexander0042 <https://github.com/alexander0042> to
see what the options for this are.
—
Reply to this email directly, view it on GitHub
<#192 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ASNXDRVT6A63SLLXFHRJZHTYTJQ4NAVCNFSM6AAAAABDEY4XIGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSMZZGM2DSNJZHA>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
I've released a 1.4.4 beta version which should hopefully fix the issue with the ridiculous number of decimal places you're seeing with the sensors. It's not configurable at the moment but it's setup so that if rounding is enabled the precipitation related sensors show two decimal places and all other sensors have no decimal places. Let me know if this fixes the issue for you and maybe @alexander0042 could set something up for the next big release after V2 of the API has been released. |
I've just installed the beta--visually, much better, although now instead
of 11 digits after the decimal, the precip_accum* sensors are showing 4
digits after the decimal (rather than two). Vast improvement, in any case.
Thank you.
…On Wed, Feb 14, 2024 at 1:21 PM Kev ***@***.***> wrote:
I've released a 1.4.4 beta version which should hopefully fix the issue
with the ridiculous number of decimal places you're seeing with the
sensors. It's not configurable at the moment but it's setup so that if
rounding is enabled the precipitation related sensors show two decimal
places and all other sensors have no decimal places.
Let me know if this fixes the issue for you.
—
Reply to this email directly, view it on GitHub
<#192 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ASNXDRX6XA4H74465GCQIPDYTT6BLAVCNFSM6AAAAABDEY4XIGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSNBUGM3DKNJYGA>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
Do you have rounding enabled or disabled? If it's enabled it should be showing 2 decimal places instead of 4. If it's not showing 2 decimal places I'll have to debug to see what's going on. |
It was showing 4 digits with rounding disabled; I've enabled rounding and
it is showing 2 digits.
…On Wed, Feb 14, 2024 at 2:25 PM Kev ***@***.***> wrote:
Do you have rounding enabled or disabled? If it's enabled it should be
showing 2 decimal places instead of 4. If it's not showing 2 decimal places
I'll have to debug to see what's going on.
—
Reply to this email directly, view it on GitHub
<#192 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ASNXDRS4NJHVBWPGWLSFKH3YTUFRRAVCNFSM6AAAAABDEY4XIGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSNBUGQ2TGMRWGY>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
Good to know that it's working for you. I created a PR to merge this in so hopefully it can be reviewed so it can be merged in soon. If I knew more about HA I could take a stab at trying to make it configurable but alas I don't nor do I have a dev machine setup for this sort of stuff. @alexander0042 is the one who created the integration and knows more about this sort of stuff so I'll leave it to him to set this up. I can do smaller-scale changes which I've done before to fix other issues that have cropped up. |
Haven't forgotten about this! I finally got a devcontainer setup and working so I should be able to take a stab at this soon (if nobody else beats me to it). I was thinking along the lines of having two sliders - one for the data points which are rounded to 2 decimal points and one for the ones which are rounded to 4 decimal points or do you have a different suggestion. |
Describe the feature
There is currently a feature to round values to the nearest integer. More precision is preferable, but the entity values for my precip_accum* sensors are currently delivered out to 11 decimal places. This is far too many, and none of the weather cards I'm using will truncate or round those values to x.x or x.xx.
Home Assistant version
2024.2.1
Integration version
1.4.3
Acknowledgements
The text was updated successfully, but these errors were encountered: