Temperature probe plugged into VP2 UV socket

58 views
Skip to first unread message

Wade

unread,
Oct 11, 2019, 9:18:13 AM10/11/19
to weewx-user
I just joined this great form a few days ago.

I recently plugged a Davis temperature probe into the spare VP2 UV port to try and measure lake water temperature.

Oddly after a bit of reformatting the output seems to be tracking the lake temperature with a negative sign as can be seen in the commandeered UV below.

Simcoe Temperature --16.2°C
Current actual lake temperature = 16.1 C.

Trial A:
I am trying unsuccessfully  to find where I can perform math functions on the UV output to make the displayed temperature match the actual, possibly by data curve matching or table lookup. I have looked at the wxformuals.py and cannot find a UV section.


Trial B:
Using the Simulator: 
I have tried to take the raw data from the UV simulated sensor and point it to the unused extraTemp1 variable by inserting the code below at various places in simulator.py without success.
Typically the log file indicates "undefined variable" for both Station and extraTemp1 and terminates weewx.
Possibly I should define both those variables as Global?
I have meagre but improving Python skills. 


data['extraTemp1'] = Station.decode_UV(raw)

Simulator.py exerpt:

(very bottom of simulator.py


    data['extraTemp1'] = Station.decode_inTemp(raw)

Any of your thoughts on how to implement this would be greatly appreciated.



gjr80

unread,
Oct 11, 2019, 5:53:54 PM10/11/19
to weewx-user
Hi,

Interesting project, I’ll make no comment on accuracy/usefulness (what happens for negative temperature or temperatures off the UV scale for example), guess some testing and development will show one way or another.

As for your questions these can be easily done, depending on exact requirements, without changing any python code. The StdCalibrate service (http://weewx.com/docs/usersguide.htm#StdCalibrate ) is your friend. You can use a ‘correction’ to alter an observation. So to assign you ‘UV’ value to extraTemp1 you could do something like this under [[Corrections]] (untested):

[[Corrections]]
extraTemp1 = UV

you can even take care of your negative sign with:

extraTemp1 = -UV

You can do more complex corrections as long as it can be expressed in a single line of python code, for example if a sensor sometime fails and provides a negative value you can filter those values out and set the observation to None (The python value None is used to typically represent an observation for which a sensor is present but there is no valid reading) using something like:

extraTemp2 = sensor1 if sensor1 >= 0 else None

Gary

Wade Graham

unread,
Oct 11, 2019, 6:05:35 PM10/11/19
to weewx...@googlegroups.com
Thank you Gary
Your input is greatly appreciated.
Regards

Wade




--
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/44f4de5a-414f-401a-aee7-0765eea028c0%40googlegroups.com.

Wade Graham

unread,
Oct 13, 2019, 8:11:08 AM10/13/19
to weewx...@googlegroups.com
Thank you gjr80 your suggestions work absolutely perfectly and are breeze to implement.

Wade

On Fri, Oct 11, 2019 at 5:53 PM gjr80 <gjrod...@gmail.com> wrote:
Reply all
Reply to author
Forward
0 new messages