Weather Software > WeeWX Software
weewx and TFA Dostmann Klimalogg Pro (tips and tricks)
(1/1)
Gyvate:
This may be interesting for all owners of a (at least in Europe rather wide-spread) TFA Dostmann Klimalogg Pro Temperature/Humidity data logger which supports up to eight (8 ) external T/H sensors.
[ You are not allowed to view attachments ]
The extension/driver to be used for that with weewx can be found at https://github.com/matthewwall/weewx-klimalogg
In the standard setup the dewpoint and heatindex are not shown in the user interface (skin). And it is until now unfortunately not documented with the driver how to get this work
(unless you know Python and can read and understand the kl.py driver code).
In general, if you want to show more than four (4) sensors in the skin, you will need to modify (add entries) to the weewx.conf, skin.conf and index.html.template files.
For this it is good to know/remember the general weewx concept.
Weewx does in principle three things
1. read sensor data from a weather station
2. save sensor data in a user defined interval (default 5 min) into a sqlite database (can also be mySQL) - weewx term: archive
3. present the data from the database on a webpage (usually http://IP-address/weewx - for Klimalogg http://IP-address/weewx/kl) - in weewx terminology on a skin
The default weewx skin is the "Seasons" skin. For Klimalogg there is a separate special Klimalogg skin ("kl") with a bright or dark background theme (activation/switch in skin.conf).
The control over weewx and its data presentation happens in three places (where the first overwrites the latter)
a) weewx.conf (location: /etc/weewx/weewx.conf on a Debian/Linux system e.g. on a Raspberry Pi)
here the central configuration takes place
b) skin.conf (location: /etc/weewx/skins/Seasons for the Seasons skin - /etc/weewx/skins/kl for the Klimalogg skin)
here the pictures, snippets of the sensors values over time are created (and renewed at every archiving interval) - what sensor shows on which snippet is defined here
the respective labels are defined in weewx.conf - the so-called Cheetah-Generator produces the pictures now and places them into /var/www/html/weewx where they can be read from the web browser
(of course a web server e.g. nginx or Apache needs to installed and running on the server) after having been integrated into a web page (skin); see c).
[if you use a temporary in-memory file system to avoid write activity on your SD card on a Raspberry Pi, the Cheetah generator output will be redirected; e.g. using the example from
https://jackstromberg.com/2018/06/setting-up-weewx-with-a-raspberry-pi/ point 10., then the target directory will be /var/weewx/reports/kl - you will then also have to change
the HTML_ROOT in weewx.conf accordingly if you do this manually- if you follow all the instruction under 10. in the before link, you don't have to do anything in addition - it's all included there]
there will be pictures/snippets for the day/week/month/year
c) index.html.tmpl (location: /etc/weewx/skins/Seasons for the Seasons skin - /etc/weewx/skins/kl for the Klimalogg skin)
there will also be code for current conditions, high/low values, day, week, month, year
the coding in this file makes the Cheetah generator create a file called index.html and which puts all the wanted information (text, pictures, arrangement...)
on the web page which the browser then can read when entering http://ip-address/weewx (or http://ip-address/weewx/kl for Klimalogg) - e.g. 192.168.1.77/weewx or http://my-weewx.com/weewx ....
So if for Klimalogg you have more than 4 sensors to be displayed
(all the T&H values of connected sensors are always stored/archived in the database - dewpoint and heatindex only if use use the below sensor map),
you will have to edit skin.conf and add stanzas for the new sensors (easy to tell from what's already there) to get pictures/snippets (day, week, month, year).
Correspondingly in index.html.tmpl for current conditions, high/low values, day, week, month, year.
Once you get it working for current, high/low and day, the remainder (week, month, year) becomes +/- just copy-and-paste
examples (for the dark skin - there is also a bright one) see attachments - dewpoint and heatindex are the blue (heatindex) and white (dewpoint) small numbers next to the big numbers (Temp) in the current data section
Here is what needs to be done for heat index and dewpoint to be displayed (and saved/archived in the database).
1. create a sensor map in the [Klimalogg] section in weewx.conf
[[sensor_map]]
temp0 = Temp0
humidity0 = Humidity0
heatindex0 = heatindex0
dewpoint0 = dewpoint0
temp1 = Temp1
humidity1 = Humidity1
heatindex1 = heatindex1
dewpoint2 = dewpoint1
temp2 = Temp2
humidity2 = Humidity2
heatindex2 = heatindex2
dewpoint2 = dewpoint2
temp3 = Temp3
humidity3 = Humidity3
heatindex3 = heatindex3
dewpoint3 = dewpoint3
temp4 = Temp4
humidity4 = Humidity4
heatindex4 = heatindex4
dewpoint4 = dewpoint4
temp5 = Temp5
humidity5 = Humidity5
heatindex5 = heatindex5
dewpoint5 = dewpoint45
temp6 = Temp6
humidity6 = Humidity6
heatindex6 = heatindex6
dewpoint6 = dewpoint6
temp7 = Temp4
humidity7 = Humidity7
heatindex7 = heatindex7
dewpoint7 = dewpoint7
temp8 = Temp8
humidity8 = Humidity8
heatindex8 = heatindex8
dewpoint8 = dewpoint8
rxCheckPercent = SignalQuality
batteryStatus0 = BatteryStatus0
batteryStatus1 = BatteryStatus1
batteryStatus2 = BatteryStatus2
batteryStatus3 = BatteryStatus3
batteryStatus4 = BatteryStatus4
batteryStatus5 = BatteryStatus5
batteryStatus6 = BatteryStatus6
batteryStatus7 = BatteryStatus7
batteryStatus8 = BatteryStatus8
and
2. create entries in the extensions.py file of weewx for the units and numbers to be shown properly on the skin
# to be added to extensions.py in /usr/share/weewx/user
# 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'
3. assign the dewpoint0 thru dewpoint8 (whichever you use) and heatindex0 thru heatindex8 in skin.conf to a (or more or an already existing) day/weewk/month/year picture/snippet and add the snippets/pictures to index.html.tmpl
What you have to do exactly is pretty clear from what has already been done for sensors ending in 0 - 4 in the file. (the 0 ending is for the indoor sensors in the console, 1-8 for the external sensors).
Copy these lines and change the ending number.
Gyvate:
By the way - a Klimalogg installation with weewx needs two (2) databases - weewx.sdb and weewx-kl.db (default names).
Even though all data is archived into weewx-kl.db, the weewx.sdb needs to be present for some reason - it's only created when weewx runs with the kl driver for the first time.
When you do regular backups (what you should ! 8-)), you need to backup weewx.sdb (usually 960 KB size) together with weewx-kl.sdb - and when you do a restore have to restore/copy back both !!.
Gyvate:
I did some experiments with the current data section of the kl skin;
and think that I made it a bit more readable by enlarging the table and using different colo(u)rs and
display head lines for the dewpoint and heat index - which are not there in the original skin.
(the latter is of course a matter of taste - and can be easily changed)
One can of course stay with the original design - shape-wise and colo(u)r-wise.
Navigation
[0] Message Index
Go to full version