Formats and labels are keyed to *unit groups*, not observation types. If
you really want to use luminance (instead of illuminance), you need to tell
the system what unit group it is in. You do that by making an assignment to
the data structure weewx.units.obs_group_dict:

import weewx.units
weewx.units.obs_group_dict['luminance'] = 'group_illuminance'

See the section *Assigning a unit group
<http://www.weewx.com/docs/customizing.htm#Assigning_a_unit_group>* in the
Customizing Guide.

However, be aware that illuminance is not the same of luminance.
Illuminance measures the amount of light falling on a surface area.
Luminance measures the amount of light passing through a solid angle. Only
illuminance is measured in lux.

On Wed, Feb 17, 2021 at 1:28 PM 'Jan-Jaap van der Geer' via weewx-user <
[email protected]> wrote:

> On Tuesday, February 16, 2021 at 10:53:33 PM UTC+1 [email protected] wrote:
>
>> There's already a type for luminosity, but it's called "illuminance",
>> introduced in V4.2. It's a member of group_illuminance.
>>
>
>
>> See issue #613 <https://github.com/weewx/weewx/issues/613>, in
>> particular, this post.
>> <https://github.com/weewx/weewx/issues/613#issuecomment-716136794>
>>
>
> Hm, I'm not sure that helps me. I've tried replacing the 'lux = " lux"'
> with 'illuminance = " lux"' and  adding 'illuminance = %.0f' to the
> StringFormats but there's still no unit on the graph and the low/high table
> still has lot's of digits behind the comma. I'm not sure what to do, but I
> do see that lux/illuminance might be a difficult one to get right because
> of naming confusion.
>
> But I have a graph for the voltage as well. That one also doesn't show the
> unit (v) in its graph. Maybe that's a better example. I added these values
> in weewx.conf:
>
> [[Defaults]]
>   [[[Units]]]
>     [[[[Groups]]]]
>       group_volt = volt
>
>     [[[[Labels]]]]
>       volt = " volt"
>
> But that does not add the unit to the volt-graph. What am I missing?
>
> Thinking about it a bit more I think I might be completely in the wrong
> area as there's nothing in the section I quoted that seems to tell weewx to
> use "°C" for temperatures but still it does.
>
> How does it know this?
>
> Cheers,
> Jan-Jaap
>
> --
> 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 [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/weewx-user/0d1aad64-507e-4c76-a99d-99d0ee2c836cn%40googlegroups.com
> <https://groups.google.com/d/msgid/weewx-user/0d1aad64-507e-4c76-a99d-99d0ee2c836cn%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>

-- 
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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/weewx-user/CAPq0zEDLGQF1rZxgig4B-T5Oa1xkHrf-3kfZa06aamCzQCM4Dw%40mail.gmail.com.

Reply via email to