Ok,

I think I see what is going on. I think you have stumbled onto a deficiency 
with the Klimalogg driver, I say deficiency rather than bug as I think the 
issue could be solved in the Klimalogg driver documentation rather than the 
code. In a nutshell, when you alter the schema used by weeWX you need to 
make sure that weeWX knows what unit groups each of the new fields belongs 
to, ie weeWX needs to know that field dewpoint0 is a temperature. This is 
automatically taken care of by the Klimalogg driver when you tell it to use 
either the default Klimalogg sensor map (sensor_map_id = 0) or the standard 
weeWX sensor map (sensor_map_id = 1). However, if you specify a custom 
sensor map using [[sensor_map]] the Klimalogg driver does not take care of 
telling weeWX what fields belong in what observation groups. Fortunately 
this is easy to setup manually in an enduring manner (ie it will survive 
weeWX upgrades). What I suggest you try is edit bin/user/extensions.py and 
add the following at the bottom of the file:

# setup units to support custom Klimalogg sensor map
from weewx.units import obs_group_dict 
obs_group_dict['temp0'] = 'group_temperature'
obs_group_dict['temp1'] = 'group_temperature'
obs_group_dict['temp2'] = 'group_temperature'
obs_group_dict['temp3'] = 'group_temperature'
obs_group_dict['temp4'] = 'group_temperature'
obs_group_dict['temp5'] = 'group_temperature'
obs_group_dict['temp6'] = 'group_temperature'
obs_group_dict['temp7'] = 'group_temperature'
obs_group_dict['temp8'] = 'group_temperature'
obs_group_dict['humidity0'] = 'group_percent'
obs_group_dict['humidity1'] = 'group_percent'
obs_group_dict['humidity2'] = 'group_percent'
obs_group_dict['humidity3'] = 'group_percent'
obs_group_dict['humidity4'] = 'group_percent'
obs_group_dict['humidity5'] = 'group_percent'
obs_group_dict['humidity6'] = 'group_percent'
obs_group_dict['humidity7'] = 'group_percent'
obs_group_dict['humidity8'] = 'group_percent'
obs_group_dict['dewpoint0'] = 'group_temperature'
obs_group_dict['dewpoint1'] = 'group_temperature'
obs_group_dict['dewpoint2'] = 'group_temperature'
obs_group_dict['dewpoint3'] = 'group_temperature'
obs_group_dict['dewpoint4'] = 'group_temperature'
obs_group_dict['dewpoint5'] = 'group_temperature'
obs_group_dict['dewpoint6'] = 'group_temperature'
obs_group_dict['dewpoint7'] = 'group_temperature'
obs_group_dict['dewpoint8'] = 'group_temperature'
obs_group_dict['heatindex0'] = 'group_temperature'
obs_group_dict['heatindex1'] = 'group_temperature'
obs_group_dict['heatindex2'] = 'group_temperature'
obs_group_dict['heatindex3'] = 'group_temperature'
obs_group_dict['heatindex4'] = 'group_temperature'
obs_group_dict['heatindex5'] = 'group_temperature'
obs_group_dict['heatindex6'] = 'group_temperature'
obs_group_dict['heatindex7'] = 'group_temperature'
obs_group_dict['heatindex8'] = 'group_temperature'
obs_group_dict['rxCheckPercent'] = 'group_percent'
obs_group_dict['batteryStatus0'] = 'group_count'
obs_group_dict['batteryStatus1'] = 'group_count'
obs_group_dict['batteryStatus2'] = 'group_count'
obs_group_dict['batteryStatus3'] = 'group_count'
obs_group_dict['batteryStatus4'] = 'group_count'
obs_group_dict['batteryStatus5'] = 'group_count'
obs_group_dict['batteryStatus6'] = 'group_count'
obs_group_dict['batteryStatus7'] = 'group_count'
obs_group_dict['batteryStatus8'] = 'group_count'

I know you do not use some of those fields but it will not matter. Save 
extensions.py then stop weeWX if it was running and then start weeWX. You 
should be able to easily tell if the units issue is fixed if you run weeWX 
directly and look at the LOOP records. They should display with usUnits = 1 
and temperatures should be in degree F. If this is the case your database 
should be fine.

Let us know how you go. I am not sure what Luc and Matthew had in mind for 
supporting a custom sensor map (one way ahead would be to add dewpoint0 and 
friends to the default Klimalogg sensor map, another to document the unit 
group additions in extensions.py), I will raise the issue with Matthew when 
he is back in the land of reliable internet.

Gary

On Friday, 2 June 2017 05:55:55 UTC+10, Fry3k wrote:
>
> Hi Gary,
>
> Thanks again, it worked! The packets now look like this:
>
> LOOP:   2017-06-01 21:35:31 CEST (1496345731) altimeter: None, appTemp: 
> None, barometer: None, batteryStatus0: 0, batteryStatus1: 0, 
> batteryStatus2: 0, batteryStatus3: 0, batteryStatus4: 0, batteryStatus5: 0
> , batteryStatus6: 0, batteryStatus7: 0, batteryStatus8: 0, cloudbase: None
> , dateTime: 1496345731, dewpoint: None, dewpoint0: 12.4395622918, 
> dewpoint1: 10.2028620613, dewpoint2: 13.3146548925, dewpoint3: 
> 15.3598579755, dewpoint4: 13.2895672777, heatindex: None, heatindex0: 26.4
> , heatindex1: 22.4, heatindex2: 26.2, heatindex3: 27.3566888636, 
> heatindex4: 25.8, humidex: None, humidity0: 42, humidity1: 46, humidity2: 
> 45, humidity3: 49, humidity4: 46, humidity5: None, humidity6: None, 
> humidity7: None, humidity8: None, inDewpoint: None, maxSolarRad: None, 
> pressure: None, rainRate: 0, rxCheckPercent: 100, temp0: 26.4, temp1: 22.4
> , temp2: 26.2, temp3: 27.0, temp4: 25.8, temp5: None, temp6: None, temp7: 
> None, temp8: None, usUnits: 1, windchill: None
>
> REC:    2017-06-01 21:35:00 CEST (1496345700) altimeter: None, appTemp: 
> None, barometer: None, cloudbase: None, dateTime: 1496345700, dewpoint: 
> None, dewpoint0: 12.5292678342, dewpoint1: 10.293701522, dewpoint2: 
> 13.3146548925, dewpoint3: 15.4512548665, dewpoint4: 13.2895672777, ET: 
> None, heatindex: None, heatindex0: 26.5, heatindex1: 22.5, heatindex2: 
> 26.2, heatindex3: 27.4492357563, heatindex4: 25.8, humidex: None, 
> humidity0: 42, humidity1: 46, humidity2: 45, humidity3: 49, humidity4: 46, 
> humidity5: None, humidity6: None, humidity7: None, humidity8: None, 
> inDewpoint: None, interval: 5, maxSolarRad: None, pressure: None, rainRate
> : 0, temp0: 26.5, temp1: 22.5, temp2: 26.2, temp3: 27.1, temp4: 25.8, 
> temp5: None, temp6: None, temp7: None, temp8: None, usUnits: 1, windchill: 
> None, windrun: 0.0
>
> The SQlite database now contains the all values from the LOOP/REC packets 
> except the ones that weren't in there before (like cloudbase or inDewpoint).
>
> Just a question for understanding: I assume that you found out by reading 
> the drivers source code, that the names of the Klimalogg parameters are 
> what you have written on the right side of the expressions (the left side 
> beeing the column headers in the database). How did the connection between 
> sensor names and database name work before? (since there was no 
> [[sensor_map]] stanza)
>
>
>
> One odd thing happened: the values are now saved in celsius instead of 
> fahrenheit in the database but the usUnits field is still set to 1 (see 
> image below)
>
>
> <https://lh3.googleusercontent.com/-yLE30aEZqGw/WTBuaR7jfKI/AAAAAAAAM6Q/Hs5ReIFQoIcrVmJwR7O5g1f3-M9Wr20LgCLcB/s1600/Unbenannt.PNG>
>
> The new columns containing dewpoint and heatindex use now celsius too. The 
> generated graphs showed celsius before the change (which means that they 
> were converted from the database bevor graph drawing). Now the are just 
> showing the actual value from the database. For me celsius would be just 
> fine but the user guide states that the [StdConvert] -> target_unit should 
> not be changed unless I know exactly what I'm doing (which I am certainly 
> not).
>

-- 
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.

Reply via email to