Voltage -- Decimal Places

55 views
Skip to first unread message

Barry

unread,
May 20, 2022, 9:56:23 PM5/20/22
to weewx-user
Hi, using the Tempest Weather station, Weewx and Belchertown.

The battery voltage reported from the Tempest via the UDP message is to 3 decimal places:


'type': 'device_status', 'hub_sn': 'HB-00071538', 'timestamp': 1653091491, 'uptime': 2013501, 'voltage': 2.746, 'firmware_revision': 164,
'type': 'obs_st', 'hub_sn': 'HB-00071538', 'obs': [[1653091491, 0.27, 1.47, 3.31, 201, 3, 992.91, 24.86, 61.75, 2055, 0.14, 17, 0.0, 0, 0, 0, 2.746, 1

In skins.conf [[StringFormats]] I have
volt  = %.1f

With a graph plotting the voltage the y-axis shows 2.6 2.65 2.7 etc which is fine, but when I display the voltage in Station Observations it goes to 6 decimal places 2.746000. The last 3 digits are always 000 so it looks like padding. How can I get the display to limit the voltage to 3 dec places?

Barry

Tom Keffer

unread,
May 27, 2022, 1:15:01 AM5/27/22
to weewx-user
$current.voltage.format("%.3f")

See the section on formatting in the Customizing Guide.



--
You received this message because you are subscribed to the Google Groups "weewx-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to weewx-user+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/weewx-user/cff284de-7eb5-4aef-9ab3-b8aeb41b50d6n%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages