Thank you very much! That's exactly what I need to know! About services upload, adding a field to database automatically send to services? PS: I didn't read the manual of this (add fields in database) yet (will do today).
2017-07-11 5:06 GMT-03:00 gjr80 <[email protected]>: > Hi, > > What you should do with your illuminance data/field really depends on what > you want to do with the illuminance data. The following may help: > > If you just want to display the current illuminance value in a weeWX > generated report then all you need is for the illuminance field to appear > in loop/archive records generated by weeWX, no need to save it to database. > Judging by your description this is what you have now. If weeWX is creating > a field called illuminance in the archive record then you should be able > to use $current.illuminance in a report and the current illuminance value > will be displayed. > > On the other hand, if you want to (1) plot illuminance values (2) > calculate aggregates from historical luminance data or (3) send illuminance > data to some external service (eg WU - I know WU does not accept > illuminance data but I use it as an example) then you need to have the > illuminance data saved in your weeWX database. You will find that an > out-of-the-box weeWX install does not include a database field for > illuminance. Again there are a couple of options. You can use an existing > unused field to save your illuminance data, for example, soilMoist1 or > some other field that is seldom used. You would then be able to use > $current.soilMoist1.formatted to display the current illuminance value. > You would also have access to the standard weeWX aggregates eg today's > maximum illuminance via $day.soilMoist1.max.formatted. This approach has > pros and cons. On the plus side it is the easiest to implement, no need to > alter the database schema. On the negative side weeWX does not know about > the illuminance units, note the use of the .formatted code, this causes the > field to be displayed without units. Since we are using the soilMoist1 > field by default weeWX will display your data in reports with the cb unit > label (centibar is the soil moisture units used by weeWX). So to display, > for example, something like 35 lux, you would need to manually added the > unit label ie $current.soilMoist1.formatted cb. You also have the > potential of running into unit conversion issues if you use a field that > requires conversion between units systems (eg temperature fields, distance > and speed etc). > > A more complex but at the end of the day more complete approach is to > modify the weeWX database schema to add a field called illuminance, setup > its units properly and then you can use $day.illuminance.max and it will > display the correct unit label (eg 1670 lux) as for any of the other > fields. If your want to be thorough you could also setup a non-SI > illuminance units (foot-candle - which is about 10.8 lux) and be able to > display in lux or foot-candle units just as you can display temperature in > F or C. > > If you want to use an existing database field for your illuminance data > then you can just modify your code that creates the file containing > illuminance=XXX to instead create soilMoist1=XXX (or whatever field you > wish to use as long as it exists and is not otherwise used). Customizing > the database <http://weewx.com/docs/customizing.htm#archive_database> and > Customizing > units and unit groups > <http://weewx.com/docs/customizing.htm#customizing_units> in the > Customization Guide should help you if you want to create an illuminance > field and add the illuminance units to your weeWX install. > > I am no lux expert but as to whether the sensor should be in direct sun or > shade, I guess that depends on what it is you want to measure. I would have > expected it would be in direct sun - unless you want to measure 'the > illuminance under the apple tree' :-) I don't believe illuminance is like > temperature where you want to avoid direct sun on the sensor. > > 1870 lux could be acceptable for an overcast day, accepting the > limitations of Wikipedia <https://en.wikipedia.org/wiki/Lux#Illuminance>, > it seems that on a clear day you could expect from 10000 to 100000 lux. > Might be worth doing some more reasearch on the sensor specs. > > Gary > > > On Tuesday, 11 July 2017 00:48:47 UTC+10, Jonis Maurin Ceará wrote: >> >> Hi. >> As I said before, I'm building (for self-learning) my own weather station. >> For illumination, I"m using BH1750 as a Lux sensor.....the code returns >> an integer value in Lux. >> >> Now the questions: >> 1) My driver simples 'load' an text file nad parse data on it (it's a >> sampel driver alled FileParser). I've added 'illuminance=XXX' on data file >> and it's working fine (I can see value while running weewxd in foreground), >> but I could not find any field for illuminance in database (using SQLite as >> default), so the question is: the value is being saved? I'm not sure if >> this value should be displayed in default report template. If not, should I >> added manually this field to database schema? (I know that there is an >> entry in manual for adding sensors, but I'm not sure if I need to do this >> step with illuminance field). Also, should I save in LUX or convertt to >> other unit? >> >> 2) This sensor should be in direct sunlight or in a shade for correct >> measurement? "Professional weather stations" has this sensor in direct >> sunlight? >> >> 3) I'm getting values of about 1870~ LUX in a sunny day (but with sensor >> in a very large shade). I'm not lloking for a perfect calibration, but only >> to have an ideia if I'm right on these values >> > -- > 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/bQ_wPs8fwkw/unsubscribe. > To unsubscribe from this group and all its topics, send an email to > [email protected]. > For more options, visit https://groups.google.com/d/optout. > -- 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]. For more options, visit https://groups.google.com/d/optout.
