I have an ESPhome component for the user to enter Geographic Latitude:
number:
- platform: template
name: "Observer Latitude"
id: observer_latitude
icon: "mdi:latitude"
mode: box
initial_value: 12.3456789
min_value: -90.0
max_value: 90.0
step: 0.0000001
optimistic: true
A value pasted from Google Maps, for example, has 7dp precision. It would be nice to preserve this, commensurate with the initial value above.
HA Cards do not appear to allow easy input of such precision. The default slider is too coarse; a box requires a click on the component heading and then entry in the popup box.
The only card that seems to work conveniently within the dashboard is Entities. Here’s the YAML:
type: entities
entities:
- entity: number.solar_calculations_observer_latitude
grid_options:
columns: 24
rows: 2
The control has no means of specifying its default precision - indeed that seems to be set at 5dp.
There is a problem entering values at high precision that seems erratic:
Entering 70.1234567 is rounded to 70.12346

But if I use the spin wheel I can get 7dp:

If I then change that value manually by entering text I can maintain the 7dp:

A look at Developer Tools → States tells a different story:
But if I change the state value in Developer Tools to any precision of my choosing, that value is always preserved in the dashboard Entities Card. It even survives a screen refresh.
I could easily conclude: writes are inconsistent; reads are always exact and enduring.
Can anyone confirm this behaviour?
And, in the event of there being no obvious fix, Is there an alternative approach I could use for entering high-precision numbers?
Thanks,
Ric
