Clarification - SDR sensor mapping for lux > illuminance or luminosity?

267 views
Skip to first unread message

David Schulz

unread,
Dec 13, 2022, 7:28:28 AM12/13/22
to weewx-user
I recently upgrade my venerable WH1080 sensor to the WH65B sensor array.  I'm grabbing data directly using the SDR driver.  Just having trouble nailing down the correct sensor mapping for the lux values being reported.

I'm looking at this post -  https://groups.google.com/g/weewx-user/c/7ouux0bviRE/m/u46MyYN5BQAJ, which lead me to believe there should be a field called illuminance which maps to the illuminance group which sets the units to be lux.  It sounds like there might have been a column called luminosity in the schema at one point but it was replaced with illuminance?

My database is using the extended schema but is still showing only a luminosity column and has no illuminance column.  I've just run a clean install on a spare Pi and I'm seeing the same column names as my main system. 

Contemplating whether I add a new column called illuminance or assign the existing luminosity column to the illuminance group so that correct units get applied.  I'd appreciate any recommendations on which is the safer path regarding things working cleanly with future upgrades.

Appreciate your assistance!
David

Greg Troxel

unread,
Dec 13, 2022, 8:09:32 AM12/13/22
to David Schulz, weewx-user

David Schulz <davidjs...@gmail.com> writes:

> I recently upgrade my venerable WH1080 sensor to the WH65B sensor array.
> I'm grabbing data directly using the SDR driver. Just having trouble
> nailing down the correct sensor mapping for the lux values being reported.
>
> I'm looking at this post -
> https://groups.google.com/g/weewx-user/c/7ouux0bviRE/m/u46MyYN5BQAJ, which
> lead me to believe there should be a field called illuminance which maps to
> the illuminance group which sets the units to be lux. It sounds like there
> might have been a column called luminosity in the schema at one point but
> it was replaced with illuminance?

First, read this:

https://github.com/weewx/weewx/wiki/Watts-and-lux

> My database is using the extended schema but is still showing only a
> luminosity column and has no illuminance column. I've just run a clean
> install on a spare Pi and I'm seeing the same column names as my main
> system.
>
> Contemplating whether I add a new column called illuminance or assign the
> existing luminosity column to the illuminance group so that correct units
> get applied. I'd appreciate any recommendations on which is the safer path
> regarding things working cleanly with future upgrades.

I am not at all clear on the details of those sensors.

illuminance has units lux; it is human-perceived light falling per area.

Luminosity is a radiometric unit (power) rather than photometric (human
perception). And, it's total power from a source, which doesn't make
any sense for a weather station:

https://en.wikipedia.org/wiki/Luminosity

The two things weather stations often measure are:

illuminance in lux, super roughly 200 000 in full sun
irradiance in W/m^2, roughly 1000 in full sun

So the big questions are

What is the measurement showing up in your luminosity column? What
is being measured, with what units? What kinds of numbers do you see
when the sun shines directly on the weather station, blue sky?

Is something continuing to put data in that column? Why?

Is "luminosity" being used in some code as a synonym (incorrectly) for
"irradiance"?

and then when you understand those answers you can figure out what to
do, or post back with them.

signature.asc

David Schulz

unread,
Dec 14, 2022, 5:26:09 PM12/14/22
to weewx-user
Hi Greg,

Thanks for taking the time to respond.  

The WH65B reports values for 'UV', 'UVI' and 'Light' as you can see in the data coming through (shown below) when running rtl-433 from the command line.
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

time      : 2022-12-14 22:05:08

model     : Fineoffset-WH65B                       ID        : 133

Battery   : 1            Temperature: 22.4 C       Humidity  : 59 %          Wind direction: 205       Wind speed: 0.0 m/s       Gust speed: 0.0 m/s       Rainfall  : 13.2 mm       UV        : 83            UVI       : 0             Light     : 10922.0 lux   Integrity : CRC

In my SDR device sensor map I am mapping the UV value to radiation, the UVI value to UV.  Those values seem to be landing in the 'intended' columns and display nicely in repots with correct values assigned.  

        radiation = uv.133.FOWH65BAltPacket

        UV = uv_index.133.FOWH65BAltPacket

        luminosity = light.133.FOWH65BAltPacket

It is the value being reported as 'light' from the sensor that I'm struggling with.  It's currently I'm mapping that value to field I can physically see in the database called luminosity.  That stores data in the database but the display shows no units and presents with 6 decimal places.  

After some searching through this group, I found the post referenced where it sounded like there 'should' be a column called 'illuminance' which is mapped to a group with the same name which uses lux as units.  When I make that mapping, weewx refuses to start - not surprisingly.

So that leaves me with 2 options - assume my database is 'incorrect' and add a column (wee_database --add-column) called illuminance and remap the light values to that column.  The alternative is to add the existing column to the illuminance group so it uses the correct unit and I can apply some formatting.  I guess I'm wondering if there are other options, and if not, which of the methods is the "safest" in terms of playing nice with future upgrades.

I'm just now looking up the command syntax to add a column and I notice this example from the section on renaming columns - 'wee_database --rename-column=luminosity --to-name=illuminance'.  Maybe not a coincidence that example is used?  That's starting to lok like my third (and best?) option.

Appreciate any guidance on what the intended design is here.

Thanks,
David

an oldman

unread,
Dec 14, 2022, 8:45:32 PM12/14/22
to weewx-user
hi
i have a acurite atlas that report lux, and user weewx-sdr and map it to luminosity = lux.494.AcuriteAtlasPacket.
to get the units/labels i added to user/extensions.py
import weewx.units
 weewx.units.obs_group_dict['luminosity'] = 'group_illuminance'.

hope this helps

Greg Troxel

unread,
Dec 15, 2022, 8:25:57 AM12/15/22
to David Schulz, weewx-user

David Schulz <davidjs...@gmail.com> writes:

> Battery : *1* Temperature: *22.4 C* Humidity : *59 %*
> Wind direction: *205* Wind speed: *0.0 m/s* Gust speed: *0.0
> m/s* Rainfall : *13.2 mm* UV : *83* UVI
> : *0* Light : *10922.0 lux* Integrity : *CRC*
> In my SDR device sensor map I am mapping the UV value to radiation, the UVI
> value to UV. Those values seem to be landing in the 'intended' columns and
> display nicely in repots with correct values assigned.
>
> radiation = uv.133.FOWH65BAltPacket
>
> UV = uv_index.133.FOWH65BAltPacket
>
> luminosity = light.133.FOWH65BAltPacket
> It is the value being reported as 'light' from the sensor that I'm
> struggling with. It's currently I'm mapping that value to field I can
> physically see in the database called luminosity. That stores data in the
> database but the display shows no units and presents with 6 decimal
> places.

As I understand it, Radiation is supposed to be the physical quantity
"irradiance" in W/m^2, 1000ish at noon under blue sky. UV seems to be
some radiometric measurement of just UV, and while that's useful, it is
not irradiance.

UVI I think you have correct.

As I said before, luminosity is not a sensible word in this context.

So stop mapping UV to radiation, figure out what UV really is, and add a
column, perhaps uv_irradiance if it's in mW/m^2 which I think it might
be, but I don't have that kind of hardware.

> After some searching through this group, I found the post referenced where
> it sounded like there 'should' be a column called 'illuminance' which is
> mapped to a group with the same name which uses lux as units. When I make
> that mapping, weewx refuses to start - not surprisingly.

There are multiple schemas, as I understand it (and I am far from an
expert). Original wview, and extended, and then you can add whatever.
Read this carefully:
https://www.weewx.com/docs/customizing.htm#archive_database

Look in bin/schemas in the source.
The wview regular schema has UV and radiation. Schema entries do not
give units. units are mapped in another file.

wview extended adds luminosity. My best guess is that luminosity is a
word to mean illuminance, and that it came from a decision in a scheme
not in weewx long ago

The processing part of the code seems to use illuminance in lux. This
is correct.

The fineoffset driver converts (bogus but the best you can do)
illuminance to radiation and puts that in the radiation column.

> So that leaves me with 2 options - assume my database is 'incorrect' and
> add a column (wee_database --add-column) called illuminance and remap the
> light values to that column. The alternative is to add the existing column
> to the illuminance group so it uses the correct unit and I can apply some
> formatting. I guess I'm wondering if there are other options, and if not,
> which of the methods is the "safest" in terms of playing nice with future
> upgrades.

My read -- and don't trust me -- is that having luminosity in the schema
is a bug, perhaps inherited from wview, and that you want an illuminance
column.

> I'm just now looking up the command syntax to add a column and I notice
> this example from the section on renaming columns - 'wee_database
> --rename-column=luminosity --to-name=illuminance'. Maybe not a coincidence
> that example is used? That's starting to lok like my third (and best?)
> option.

That's what I would do, after making 3 backups, one of which is off
site :-)

> Appreciate any guidance on what the intended design is here.

Note that I am really just guessing in places.
signature.asc

David Schulz

unread,
Dec 15, 2022, 6:26:37 PM12/15/22
to weewx-user
Thanks everyone for your assistance.  I think I've got a good sense of what I need to do.  Much appreciated!
Reply all
Reply to author
Forward
0 new messages