It's a units issue:
40°F = 4.4°C
50°F = 10°C
and so on.

Glenn O'Callaghan schrieb am Mittwoch, 4. Oktober 2023 um 15:23:23 UTC+2:

> Hi,
>
> I'm using WeeWx V4.4.1 and MySQL V8.0.20 with a Davis Vantage Pro 2 and 
> have an RPi measuring my roof space Temp and Humidity and am planning to 
> store the data in extraTemp1 and extraHumid1.
>
> I've successfully created a data_service and am simply writing static 
> values initially as a test. extraHumid1 works (I get the same value I put 
> in out the end) but when I set extraTemp1 I'm getting strange values when 
> viewed in MySQL Workbench. 40 becomes 4.4', 50 = 10. 60 = 15.5', 70 = 
> 21.1', numbers around 30 and below become negatives. But I am yet to see a 
> pattern or find a reason why. extraTemp2 does the same thing (haven't 
> tested any other fields, and they all appear to be typed "double").
>
> My code is below and any help would be greatly appreciated. I've checked 
> and there are no StdCalibrate entries in my configuration.
>
> Thanks,
> Glenn.
>
> import syslog
> import weewx
> from weewx.engine import StdService
>
> class AddRoof(StdService):
>
>     def __init__(self, engine, config_dict):
>
>       # Initialize my superclass first:
>       super(AddRoof, self).__init__(engine, config_dict)
>
>       # Bind to any new archive record events:
>       self.bind(weewx.NEW_ARCHIVE_RECORD, self.new_archive_record)
>
>     def new_archive_record(self, event):
>
> roofTemp = float("50")
> roofHumid = float("9.1")
>
> event.record['extraTemp1'] = roofTemp
> event.record['extraHumid1'] = roofHumid
>
> syslog.syslog(syslog.LOG_INFO, "AddRoof: Temperature %s, Humidity %s" % 
> (roofTemp, roofHumid))
>
>

-- 
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].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/weewx-user/7e184079-a0c3-4267-9b14-70a236b70782n%40googlegroups.com.

Reply via email to