Belchertown Skin - display Units

174 views
Skip to first unread message

Xant

unread,
Sep 23, 2019, 2:05:25 PM9/23/19
to weewx-user
Recently updated to WeatherFlow (and happy with it), which provides:
  • Temperature
  • Humidity
  • Barometric Pressure
  • Wind speed/direction
  • Rainfall
  • UV
  • Solar Radiation
  • Luminance *
  • Lightning count/distance *
Was able to report Luminance through Belchertown Skin, but not yet able to display unit ("lux").


WeeWX.conf:

[WeatherFlowUDP]
    [[sensor_map]]
        lux = illuminance.SK-000XXXXX.obs_sky

    [[Defaults]]
        [[[Labels]]]
            [[[[Generic]]]]
                lux = Luminance


Belchertown skin.conf:

[Extras]
    station_observations = "barometer", "dewpoint", "outHumidity", "rainWithRainRate", "visibility", "cloudbase", "UV", "radiation", "lux"

[Units]
[[Groups]]
        group_lux          = lux

[[StringFormats]]
        lux                = %.0f

[[Lables]]
        lux               = " lux"




PS: interesting note regarding Brightness, Luminance & Confusion --> http://crompton.com/light/index.html

vince

unread,
Sep 23, 2019, 2:54:14 PM9/23/19
to weewx-user
Belchertown skin.conf:

[[Lables]]
        lux               = " lux"



You have 'Labels' spelled wrong :-)

Armando Esteves

unread,
Sep 23, 2019, 5:02:00 PM9/23/19
to weewx...@googlegroups.com
Funny, but typo only on posting. It is correct at config files.
--

You received this message because you are subscribed to a topic in the Google Groups "weewx-user" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/weewx-user/CMwtsQ6SrpE/unsubscribe.
To unsubscribe from this group and all its topics, send an email to weewx-user+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/weewx-user/9c133fc9-3dfb-4c63-af2f-bb1df3dd17e0%40googlegroups.com.

Pat

unread,
Sep 25, 2019, 10:22:00 PM9/25/19
to weewx-user
Is this resolved? Have you added this new 'lux' observation to the known observation group dictionary?

Here's how you would do it for the lightning sensor's average distance. Change the values below to lux, and you'll need to find the relevant group for lux. 

weewx.units.obs_group_dict['avg_distance'] = 'group_distance'




On Monday, September 23, 2019 at 5:02:00 PM UTC-4, Xant wrote:
Funny, but typo only on posting. It is correct at config files.



On September 23, 2019 at 2:54 PM, vince (vince...@gmail.com) wrote:

Belchertown skin.conf:

[[Lables]]
lux = " lux"


You have 'Labels' spelled wrong :-)


--

You received this message because you are subscribed to a topic in the Google Groups "weewx-user" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/weewx-user/CMwtsQ6SrpE/unsubscribe.
To unsubscribe from this group and all its topics, send an email to weewx...@googlegroups.com.

Xant

unread,
Sep 30, 2019, 1:27:43 PM9/30/19
to weewx-user

Pat

Later figured out that actually more complex than thought (instead of simple HTML display).

Will investigate further later on...

Thx,
Xant

Xant

unread,
Oct 8, 2019, 9:25:56 PM10/8/19
to weewx-user

After much time, I've done it!


The following is my "CookBook" step-by-step, as to add new Units Group to Dictionary:

Example, consider adding new Group "illuminance" with Unit 'lux' (lx), after adding 'illuminance' data to Extended Database.

1) Edit 'belchertown.py' or associated 'driverfile.py' file - according to your hardware - that will run upon weewx start (a driver file may makes sense, as it contains the Extension/data variable associated with the Unit)

% cd /usr/share/weewx/user
% nano driverfile.py

add the following (modifying accordingly to your new Group and Unit):

import weewx.units (might be already in file)
weewx.units.obs_group_dict['illuminance'] = 'group_illuminance'

weewx.units.USUnits['group_illuminance'] = 'lux'
weewx.units.MetricUnits['group_illuminance'] = 'lux'
weewx.units.MetricWXUnits['group_illuminance'] = 'lux'

weewx.units.default_unit_format_dict['lux'] = '%.0f'
weewx.units.default_unit_label_dict['lux'] = ' lx'

2) Edit 'weewx.conf' and 'skin.conf' adding new Group and Unit accordingly

3) Restart weewx


http://www.weewx.com/docs/customizing.htm#Creating_a_new_unit_group

Xant
Reply all
Reply to author
Forward
0 new messages