I am working on a service which will take current energy production data from my PV solar monitoring system and store it in the weewx database, to be reported to a modified version of the (pre-4.2) Seasons skin. The data I want to store is already being written at 5 min intervals to a transient file on the Raspberry Pi on which I am running weewx, so so far, so easy. I would also like to display, in 'Current Conditions', but not store, current totals for various periods (e.g. Today, this month, this utility billing period, this year). I assume that the Report generator could compute these from the archived energy generation values, but accurate values for all these totals are already available in the same file that contains the current production data, and it seems stupid, as well as potentially error-prone, to recalculate them. Is it possible just to make such values available to the report generator - e.g. by inserting appropriate tuples in Loop or Archive records within the Service?
--
You received this message because you are subscribed to the Google Groups "weewx-development" group.
To unsubscribe from this group and stop receiving emails from it, send an email to weewx-developm...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/weewx-development/c51f55d7-340f-4ed4-a295-0e559f4ced03n%40googlegroups.com.
All of my 'aggregate' values will be directly available in the file I mentioned in my original message - there will be no need for any actual calculations.
On 1/22/2025 5:42 PM, Tom Keffer wrote:
Yes, an observation value implemented as an XType can be used pretty much anywhere a database value can be used.
However, because they are not stored in the daily summaries, calculating some aggregates of XTypes can be quite expensive. Something to be aware of.
On Wed, Jan 22, 2025 at 2:36 PM Peter Fletcher <pe...@fletchers-uk.com> wrote:
Thanks!
I had obviously not read the introductory documentation (which is all I had read) on XTypes carefully enough, since I had thought it (only) allowed adding new types to be manipulated and stored in the database. I will have to read the full documentation with more care.
-- Peter R. Fletcher <pe...@fletchers-uk.com> Home Page - https://pfletch.fletchers-uk.com-- Peter R. Fletcher <pe...@fletchers-uk.com> Home Page - https://pfletch.fletchers-uk.com
Either of these approaches look to be more straightforward than using XTypes. The search list extension approach probably involves less overhead, since the code presumably only runs when Cheetah does. For the second approach, I assume that I would have to add the values on every loop, even though they would only be used for reporting.