Before I answer a quick WeeWX units 101. The WeeWX unit system is the core 
that allows WeeWX to convert between units (eg C to F), format observation 
data in reports and add unit labels. The system is predicated on each 
observation being allocated to a unit group (eg outTemp, inTemp, dewpoint 
etc are allocated to group_temperature). In essence this tells WeeWX that 
each of these observations are a temperature, so WeeWX knows how to convert 
to other temperature units, format the numeric data and what unit labels to 
use.

There is a bit of history to light related observations in WeeWX. Without 
going into the details the WeeWX extended schema includes a field named 
illuminance that belongs to group_illuminance which uses the unit lux. 
There is no field named luminosity in the WeeWX extended schema. 
Consequently, when you use a field named luminosity in reports and plots 
etc WeeWX will still happily display the data but you don't get any unit 
labels, formatting of numeric values, unit conversion etc. So how to fix? 
Simple, you need to tell WeeWX about the data in field luminosity. This is 
covered to a certain extent in the Customization Guide under the section 
Customizing 
units and unit groups 
<http://weewx.com/docs/customizing.htm#customizing_units>. In your case 
though the preferred approach would be to add a couple of lines to 
extensions.py 
(located in /home/weewx/bin/user or /usr/share/weewx/user depending on your 
WeeWX install), something like the following should work (untested): 

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

Save extensions.py and restart WeeWX. Your plots and reports should now 
contain properly formatted/labelled luminosity data.

Gary
On Thursday, 3 March 2022 at 21:36:16 UTC+10 f4n...@gmail.com wrote:

> It was the skin.conf, now they appear, thanks!
>
> Is there a way to add "lux" to the lux reading in the graph and current 
> conditions list? Could i just add it in weewx.conf?
>
> In the current conditions list, the lux number reads like this 
> "70070.000000". 
> Can i add something like lux = %.1f to weewx.conf?
>
>
>
>
> gjr80 schrieb am Mittwoch, 2. März 2022 um 00:27:57 UTC+1:
>
>> The only real definitive way of determining what schema you are using is 
>> to access the database and check what fields are there. If you have only 
>> ever installed v 4.0.0 or later and did not explicitly change the schema 
>> you are almost certainly using the extended schema. If you have upgraded a 
>> v3.x or earlier install you are most likely using the legacy wview schema 
>> unless you explicitly changed schemas. You can check the schema config 
>> option for the binding concerned under [DataBindings] in weewx.conf, eg:
>>
>> [DataBindings] 
>>
>>      [[wx_binding]] 
>>          ....
>>          # The schema defines the structure of the database. 
>>          # It is *only* used when the database is created. schema = 
>> schemas.wview_extended.schema
>>          schema = schemas.wview_extended.schema
>>
>> However, the schema config option is only used when the database is 
>> created so it is possible that it may be different to the actual schema of 
>> the database you are using. 
>>
>> The fact you don't get luminosity plots could be due to any one of a 
>> myriad of issues, schema is just but one of the possible causes. The most 
>> likely cause is that your skin is not set to generate and display such 
>> plots.
>>
>> If you are using the 4.6.x Seasons skin you can specify in the skin 
>> config file what observations you wish to see reported and plotted. As I 
>> said in my previous post I suggest you have a look through the 
>> [DisplayOptions] stanza, the comments should guide you. One thing I did 
>> omit was that you will need to add suitable entries to the 
>> [ImageGenerator] stanza of the skin config file to create your 
>> luminosity plot files, something like (untested):
>>
>>
>> [ImageGenerator]
>>     ....
>>     [[day_images]]
>>         ....
>>         [[[dayluminosity]]]
>>             [[[[luminosity]]]]
>>
>> likewise for week, month and year plots in [[week_images]], 
>> [[month_images]] and [[year_images]]. Provided you have appropriate 
>> settings in [DisplayOptions] your plots should appear. If things don't 
>> work as expected check if the luminosity plot files are being generated, 
>> check the log for errors and confirm the [DisplayOptions] settings.
>>
>> Gary
>> On Wednesday, 2 March 2022 at 01:21:47 UTC+10 f4n...@gmail.com wrote:
>>
>>> I'm currently only using the standard Seasons skin. How do i find out 
>>> which schema weewx uses? I never really changed this setting so what would 
>>> be the standard weewx installation schema? I thought it was the extended 
>>> one but as it seems i'm not getting any luminosity plots in the Seasons 
>>> skin, just the current luminosity value
>>>
>>> gjr80 schrieb am Montag, 28. Februar 2022 um 03:17:01 UTC+1:
>>>
>>>> The short answer is yes, it is possible. However, what you need to do 
>>>> depends. I assume you are using the SDR driver, if that is the case it 
>>>> should be providing you with the 'light' reading in Lux mapped to whatever 
>>>> WeeWX field you have specified in the sensor map (the usual mapping would 
>>>> be to the 'luminosity' field in the WeeWX extended schema).  You can have 
>>>> WeeWX derive/estimate the radiation field from this data by adding an 
>>>> entry 
>>>> under [StdCalibrate] [[Corrections]] in weewx.conf, something like:
>>>>
>>>> [StdCalibrate]
>>>>     ....
>>>>     [[Corrections]]
>>>>         radiation = luminosity/126.7 if luminosity is not None else 
>>>> None
>>>>
>>>> should see WeeWX calculate WeeWX field radiation from the WeeWX field 
>>>> luminosity and add it to any loop packet/archive records where 
>>>> luminosity appears.
>>>>
>>>> What you do from here depends on your current skin arrangement and what 
>>>> you wish to display. If your database is using the extended schema both 
>>>> radiation and luminosity will be stored in your database allowing you 
>>>> to use any radiation or luminosity tags in your reports as well as 
>>>> using radiation or luminosity in plots. If you are using the legacy 
>>>> wview schema then only radiation will be saved to database meaning only 
>>>> the 
>>>> current luminosity value can be displayed, ie no luminosity stats or 
>>>> plots. To display luminosity stats or plots you would need to add 
>>>> luminosity to your schema or change to the extended schema. 
>>>>
>>>> You don't mention what skin your are using, if it is the WeeWX 4.6 or 
>>>> later Seasons skin then radiation will be automatically displayed, but 
>>>> you will need to edit the [DisplayOptions] settings in the Seasons 
>>>> skin config file skin.conf and add luminosity. If you are using some 
>>>> other skin or wish to display some other radiation or luminosity stats 
>>>> then you would need to follow the skin authors suggestion or add the 
>>>> appropriate tags to the skin you are using.
>>>>
>>>> Gary
>>>> On Saturday, 26 February 2022 at 18:26:30 UTC+10 f4n...@gmail.com 
>>>> wrote:
>>>>
>>>>> Hi, i have a WH65 sensor and receive the data with an sdr stick. The 
>>>>> WH65 sensor array sends its radiation readings in lux and is being 
>>>>> converted back to w/m2 on the console, with the correction factor of 
>>>>> /126.7, which gives an approximate value in w/m2, i guess this is the 
>>>>> usual 
>>>>> way to do in weewx too, so it can be compared with the ecowitt data.
>>>>>
>>>>> But since this is only an approximation as stated here:
>>>>> https://github.com/weewx/weewx/wiki/Watts-and-lux
>>>>>
>>>>> I wonder if it would be possible to get both values into the report, 
>>>>> so the original lux value would also be visible. Is this somehow possible?
>>>>>
>>>>

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/weewx-user/cc2f920e-608a-49af-a489-5b654057470fn%40googlegroups.com.

Reply via email to