Hi,
I wrote an extension to weewx, that calculates the amount of drought (evapotranspiration minus rain). Basilcally, drought is a 'bucket'-type. Every time a rain-tick of an evaotranspiration (ET)-calculation (on top every hour), drought is calculated as ET minus rain. I am talking about a Davis Vantage Pro. It's an extension on schema_extended
I saw that the Belchertown skin calculates rainTotal, to use that variable to draw an accumulated (growing when rain occurs during the year) rain graph.
I also want to plot the drought-variable as an accumulated value, just like rainTotal. Is this possible in the graph.conf file, to achieve this? Or do I need an calculation by myself, and store that accumulated value in another column (for example, droughtyear)?
I have added a column 'drought' to the archive table, also a table is created 'archive_day_drought'. All is populated using the weewx-services; this is working very well. Only question is: how to plot the accumulated drought as a graph.
Archive table (see at the end, drought):
| dateTime | usUnits | interval | altimeter | appTemp | appTemp1 | barometer | batteryStatus1 | batteryStatus2 | batteryStatus3 | batteryStatus4 | batteryStatus5 | batteryStatus6 | batteryStatus7 | batteryStatus8 | cloudbase | co | co2 | consBatteryVoltage | dewpoint | dewpoint1 | ET | extraHumid1 | extraHumid2 | extraHumid3 | extraHumid4 | extraHumid5 | extraHumid6 | extraHumid7 | extraHumid8 | extraTemp1 | extraTemp2 | extraTemp3 | extraTemp4 | extraTemp5 | extraTemp6 | extraTemp7 | extraTemp8 | forecast | hail | hailBatteryStatus | hailRate | heatindex | heatindex1 | heatingTemp | heatingVoltage | humidex | humidex1 | inDewpoint | inHumidity | inTemp | inTempBatteryStatus | leafTemp1 | leafTemp2 | leafWet1 | leafWet2 | lightning_distance | lightning_disturber_count | lightning_energy | lightning_noise_count | lightning_strike_count | luminosity | maxSolarRad | nh3 | no2 | noise | o3 | outHumidity | outTemp | outTempBatteryStatus | pb | pm10_0 | pm1_0 | pm2_5 | pressure | radiation | rain | rainBatteryStatus | rainRate | referenceVoltage | rxCheckPercent | signal1 | signal2 | signal3 | signal4 | signal5 | signal6 | signal7 | signal8 | snow | snowBatteryStatus | snowDepth | snowMoisture | snowRate | so2 | soilMoist1 | soilMoist2 | soilMoist3 | soilMoist4 | soilTemp1 | soilTemp2 | soilTemp3 | soilTemp4 | supplyVoltage | txBatteryStatus | UV | uvBatteryStatus | windBatteryStatus | windchill | windDir | windGust | windGustDir | windrun | windSpeed | drought |
Live data:
+-------------------------+---------+--------+------+
| from_unixtime(dateTime) | drought | ET | rain |
+-------------------------+---------+--------+------+
| 2020-05-30 12:05:00 | 0 | 0 | 0 |
| 2020-05-30 12:04:00 | 0 | 0 | 0 |
| 2020-05-30 12:03:00 | 0 | 0 | 0 |
| 2020-05-30 12:02:00 | 0 | 0 | 0 |
| 2020-05-30 12:01:00 | 0 | 0 | 0 |
| 2020-05-30 12:00:00 | 0.4826 | 0.4826 | 0 |
| 2020-05-30 11:59:00 | 0 | 0 | 0 |
| 2020-05-30 11:58:00 | 0 | 0 | 0 |
| 2020-05-30 11:57:00 | 0 | 0 | 0 |
+-------------------------+---------+--------+------+
Archive table archive_day_drought, live data:
mysql> select from_unixtime(datetime),min,mintime,max,maxtime,sum,count,wsum,sumtime from archive_day_drought order by datetime desc limit 10;
+-------------------------+--------+------------+---------------------+------------+--------------------+-------+---------------------+---------+
| from_unixtime(datetime) | min | mintime | max | maxtime | sum | count | wsum | sumtime |
+-------------------------+--------+------------+---------------------+------------+--------------------+-------+---------------------+---------+
| 2020-05-30 00:00:00 | 0 | 1590789660 | 0.4826 | 1590832800 | 1.6256 | 756 | 97.536 | 45360 |
| 2020-05-29 00:00:00 | 0 | 1590703260 | 0.5334 | 1590757200 | 5.206999999999999 | 1440 | 312.42 | 86400 |
| 2020-05-28 00:00:00 | 0 | 1590616860 | 0.5588 | 1590670800 | 5.029200000000001 | 1435 | 301.752 | 86100 |
| 2020-05-27 00:00:00 | 0 | 1590530460 | 0.4826 | 1590577200 | 4.4196 | 1437 | 265.17600000000004 | 86220 |
| 2020-05-26 00:00:00 | 0 | 1590444060 | 0.508 | 1590498000 | 4.572 | 1440 | 274.31999999999994 | 86400 |
| 2020-05-25 00:00:00 | -0.254 | 1590388620 | 0.3302 | 1590415200 | 2.5907999999999998 | 1440 | 155.448 | 86400 |
| 2020-05-24 00:00:00 | -0.254 | 1590312540 | 0.22859999999999997 | 1590307200 | -4.648199999999999 | 1315 | -278.89200000000005 | 78900 |
| 2020-05-23 00:00:00 | 0 | 1590184860 | 0.5334 | 1590235200 | 5.1053999999999995 | 1424 | 306.324 | 85440 |
| 2020-05-22 00:00:00 | 0 | 1590098460 | 0.4064 | 1590148800 | 3.1750000000000003 | 1440 | 190.50000000000003 | 86400 |
| 2020-05-21 00:00:00 | 0 | 1590012060 | 0.5334 | 1590066000 | 4.978400000000001 | 1440 | 298.704 | 86400 |
+-------------------------+--------+------------+---------------------+------------+--------------------+-------+---------------------+---------+
10 rows in set (0.00 sec)