So, I think you're saying that rain is a hard-coded value that does a delta
on rain_total.
rain_total is something I must assign to a measurement.
However it looks like you still need to declare rain in the sensor map...
When I had
rain = rain_total.0B4E.Acurite5n1Packet
rain_total = rain_total.0B4E.Acurite5n1Packet
rain_counter = rain_counter.0B4E.Acurite5n1Packet
I was getting this data
| from_unixtime(dateTime) | rainRate | rain |
rain_counter |
+-------------------------+--------------------+---------------------+------------------+
| 2018-08-20 00:15:00 | 0.0257425742574298 | 0.0100000000000016 |
2543.75 |
| 2018-08-20 00:20:00 | 0.0869902912621378 | 0.0199999999999996 |
2545.42857142857 |
| 2018-08-20 00:25:00 | 0.144571428571428 | 0.00999999999999801 |
2546.625 |
| 2018-08-20 00:30:00 | 0.134018691588778 | 0 |
2547 |
| 2018-08-20 00:35:00 | 0.0998994974874364 | 0.0100000000000016 |
2547.68421052632 |
| 2018-08-20 00:40:00 | 0.0580710659898504 | 0 |
2548 |
| 2018-08-20 00:45:00 | 0.0400000000000063 | 0 |
2548 |
| 2018-08-20 00:50:00 | 0.0153535353535378 | 0 |
2548 |
However, I then thought about why I was assigning the sensor reading to
"rain", when clearly rain was being calculated as some kind of delta
(although I was unaware of the undocumented delta quadrant at the time. -
see what I did there?)
So I removed that line.
However it appears that rain has to be "mentioned" somewhere in the sensor
map to get it to write the value?
As since, I have had rain, and no rain or rainRate data
| from_unixtime(dateTime) | rainRate | rain | rain_counter |
+-------------------------+----------+------+------------------+
| 2018-08-20 23:18:00 | 0 | NULL | 2553.75 |
| 2018-08-20 23:19:00 | 0 | NULL | 2555 |
| 2018-08-20 23:20:00 | 0 | NULL | 2556.5 |
| 2018-08-20 23:21:00 | 0 | NULL | 2559.5 |
| 2018-08-20 23:22:00 | 0 | NULL | 2561 |
| 2018-08-20 23:23:00 | 0 | NULL | 2564 |
| 2018-08-20 23:24:00 | 0 | NULL | 2566 |
| 2018-08-20 23:25:00 | 0 | NULL | 2568 |
| 2018-08-20 23:26:00 | 0 | NULL | 2575.5 |
| 2018-08-20 23:27:00 | 0 | NULL | 2588 |
| 2018-08-20 23:28:00 | 0 | NULL | 2594 |
| 2018-08-20 23:29:00 | 0 | NULL | 2602 |
| 2018-08-20 23:35:00 | 0 | NULL | 2641.16666666667 |
| 2018-08-20 23:40:00 | 0 | NULL | 2665.86363636364 |
| 2018-08-20 23:45:00 | 0 | NULL | 2682.375 |
| 2018-08-20 23:50:00 | 0 | NULL | 2689.45454545455 |
| 2018-08-20 23:55:00 | 0 | NULL | 2697.88888888889 |
| 2018-08-21 00:00:00 | 0 | NULL | 2706.26315789474 |
| 2018-08-21 00:05:00 | 0 | NULL | 2710 |
On Sunday, 19 August 2018 04:24:42 UTC+2, mwall wrote:
>
> david,
>
> the sdr driver defines a special type of variable called a 'delta'
>
> any delta variable will be calculated by taking the difference of the
> current value and the previous value
>
> for example, 'rain' is a delta variable, and it is calculated by the
> differences in the 'rain_total' observation
>
> delta variables are specified in the configuration file like this:
>
> [SDR]
> [[delta]]
> rain = rain_total
>
> in fact, 'rain' is a default delta variable, and it is mapped to
> 'rain_total' (as shown above)
>
> the sensor_map associates an observation name (e.g., rain_total) with the
> fully-qualified observation name (e.g., rain_total.A52B.Acurite5n1Packet)
>
> observation names must be in the database schema in order for the data to
> be recorded. otherwise, the values will show up in loop packets or archive
> records, but they will not be inserted into the database.
>
> why all this complexity?
>
> the sdr driver has to be generic - it has to handle different types of
> observations with different characteristics from different types of
> hardware. all weewx drivers do these mappings
> (observation-name-to-database-field-name, observation-type), but the sdr
> driver does it generically so that you can customize it in the config file,
> not by modifying code.
>
> i try to document these things in the comments at the beginning of every
> driver i write. so its a good idea to read those comments if the
> associated readme leaves you wondering what is happening.
>
> hope that helps.
>
> m
>
>
--
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.