parsing weather data for calculations

71 views
Skip to first unread message

Bernhard Walser

unread,
Apr 24, 2020, 1:33:03 PM4/24/20
to weewx-user
Hello Im using a rasperry 3 weewx  v3.9.2 and i want to add some special data and also use this for some pin outputs (heating on-of for melting snow and so one).

Therefore i installed your filepille extension and add some code.

I now have to import data like outTemp to calculate an wetbulb temperatur. I tried many parses and it worked in wxformulas but only for HTML but there are no recordet data for images or max min values.

Does anybody know the right import and parsing to put in filepille.py, for a value like current.outTemp?
filepile.py
wxformulas.py

Tom Keffer

unread,
Apr 24, 2020, 4:16:52 PM4/24/20
to weewx-user
If I am understanding your question correctly, the current temperature can be obtained from NEW_ARCHIVE_RECORD event:

    def new_archive_record(self, event):
        temperature = event.record['outTemp']
        ...

Is that what you need?

Be aware that the value may be None, or even missing. So a better approach is:

    def new_archive_record(self, event):
        temperature = event.record.get('outTemp')
        if temperature is not None:
            # Calculate wet bulb temperature
            ...

-tk

--
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+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/weewx-user/a5b7be97-4dc6-4db1-8cb1-38043aed4812%40googlegroups.com.

Bernhard Walser

unread,
Apr 24, 2020, 4:50:29 PM4/24/20
to weewx-user
That is exactly what i mean!
Thank you for your help, and also a big thank for your great software witch can adaptet to nealry everything!
Reply all
Reply to author
Forward
0 new messages