From 7c7cbb106f98c70a4a8c86dbec2ef9f6f72aeb61 Mon Sep 17 00:00:00 2001 From: root Date: Sat, 2 May 2026 21:34:42 +0200 Subject: [PATCH 1/9] Changes to my own docker --- docker-compose.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index ce1aa79..679d898 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -48,7 +48,7 @@ services: weewx-init: condition: service_completed_successfully volumes: - - weewx_data:/data + - /opt/weewx:/data environment: - GW1000_IP=${GW1000_IP:-192.168.1.10} restart: unless-stopped @@ -62,7 +62,7 @@ services: ports: - "${NGINX_PORT:-8080}:80" volumes: - - weewx_data:/data:ro + - /opt/weewx:/data:ro command: > sh -c " cp /data/nginx/nginx.conf /etc/nginx/nginx.conf && From 4586916aa2c6993c6c8b4f04fa26abb8bab20c31 Mon Sep 17 00:00:00 2001 From: root Date: Sat, 2 May 2026 21:48:05 +0200 Subject: [PATCH 2/9] A --- docker-compose.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker-compose.yml b/docker-compose.yml index 679d898..e55ff0d 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -11,7 +11,7 @@ services: context: . dockerfile: Dockerfile.init volumes: - - weewx_data:/data + - /opt/weewx:/data environment: - PATH=/opt/venv/bin:/usr/local/bin:/usr/bin:/bin - PIP_TARGET=/data/lib/python/site-packages From db224e7cdcb6f4d31da4e227231bfd0634900d1f Mon Sep 17 00:00:00 2001 From: root Date: Sun, 3 May 2026 09:26:21 +0200 Subject: [PATCH 3/9] Add option to override pressure unit --- init/configure-weewx.sh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/init/configure-weewx.sh b/init/configure-weewx.sh index 062b1a1..790e88c 100755 --- a/init/configure-weewx.sh +++ b/init/configure-weewx.sh @@ -62,6 +62,12 @@ if [ -n "$WEEWX_LANGUAGE" ] && [ "$WEEWX_LANGUAGE" != "en" ]; then /init/weewx_config_api.py set-value "[StdReport][Defaults]" "lang" "$WEEWX_LANGUAGE" fi +#Set pressure unit for all reports +if [ -n "$WEEWX_PRESSURE_UNIT" ]; then + echo "Setting pressure unit: $WEEWX_PRESSURE_UNIT" + /init/weewx_config_api.py set-value "[StdReport][Defaults][Units][Groups]" "group_pressure" "$WEEWX_PRESSURE_UNIT" +fi + # Handle station_url (ConfigObj handles both commented and uncommented cases) if [ -n "$WEEWX_STATION_URL" ]; then echo "Setting station URL: $WEEWX_STATION_URL" From c7485a95382850f9e22b5e1efeae3d84ab0e8dc9 Mon Sep 17 00:00:00 2001 From: root Date: Sun, 3 May 2026 09:48:59 +0200 Subject: [PATCH 4/9] Pressure override in Belchertown skin --- init/configure-weewx.sh | 6 ------ init/extensions.d/belchertown/2_configure.sh | 16 +++++++++++++++- 2 files changed, 15 insertions(+), 7 deletions(-) diff --git a/init/configure-weewx.sh b/init/configure-weewx.sh index 790e88c..062b1a1 100755 --- a/init/configure-weewx.sh +++ b/init/configure-weewx.sh @@ -62,12 +62,6 @@ if [ -n "$WEEWX_LANGUAGE" ] && [ "$WEEWX_LANGUAGE" != "en" ]; then /init/weewx_config_api.py set-value "[StdReport][Defaults]" "lang" "$WEEWX_LANGUAGE" fi -#Set pressure unit for all reports -if [ -n "$WEEWX_PRESSURE_UNIT" ]; then - echo "Setting pressure unit: $WEEWX_PRESSURE_UNIT" - /init/weewx_config_api.py set-value "[StdReport][Defaults][Units][Groups]" "group_pressure" "$WEEWX_PRESSURE_UNIT" -fi - # Handle station_url (ConfigObj handles both commented and uncommented cases) if [ -n "$WEEWX_STATION_URL" ]; then echo "Setting station URL: $WEEWX_STATION_URL" diff --git a/init/extensions.d/belchertown/2_configure.sh b/init/extensions.d/belchertown/2_configure.sh index b032d65..045739c 100755 --- a/init/extensions.d/belchertown/2_configure.sh +++ b/init/extensions.d/belchertown/2_configure.sh @@ -58,7 +58,8 @@ configure_belchertown_options() { /init/weewx_config_api.py remove-section "[StdReport][Belchertown][Extras]" fi /init/weewx_config_api.py create-section "[StdReport][Belchertown][Extras]" - + + # Set Belchertown Extras options (for manifest and site title) /init/weewx_config_api.py set-multiple-values "[StdReport][Belchertown][Extras]" \ "site_title=$WEEWX_LOCATION" \ @@ -84,6 +85,18 @@ configure_belchertown_options() { fi } + + +configure_belchertown_pressure_override() { + + #If env variable set - configure pressure unit override + if [ -n "$WEEWX_PRESSURE_UNIT" ] then + /init/weewx_config_api.py create-section "[StdReport][Belchertown][Units][Groups]" + /init/weewx_config_api.py set-value "[StdReport][Belchertown][Units][Groups]" "group_pressure" "$WEEWX_PRESSURE_UNIT" + fi + +} + # Map language code to proper locale string for Belchertown get_belchertown_locale() { case "${WEEWX_LANGUAGE:-en}" in @@ -153,6 +166,7 @@ configure_default_skin configure_belchertown_options configure_belchertown_locale configure_belchertown_timezone +configure_belchertown_pressure_override # Validate final configuration log_info "Validating final configuration..." From ad7a416b712cae2071a018f105ca5aafe0adc503 Mon Sep 17 00:00:00 2001 From: root Date: Sun, 3 May 2026 09:51:37 +0200 Subject: [PATCH 5/9] Minor error --- init/extensions.d/belchertown/2_configure.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/init/extensions.d/belchertown/2_configure.sh b/init/extensions.d/belchertown/2_configure.sh index 045739c..5010aa5 100755 --- a/init/extensions.d/belchertown/2_configure.sh +++ b/init/extensions.d/belchertown/2_configure.sh @@ -90,7 +90,7 @@ configure_belchertown_options() { configure_belchertown_pressure_override() { #If env variable set - configure pressure unit override - if [ -n "$WEEWX_PRESSURE_UNIT" ] then + if [ -n "$WEEWX_PRESSURE_UNIT" ]; then /init/weewx_config_api.py create-section "[StdReport][Belchertown][Units][Groups]" /init/weewx_config_api.py set-value "[StdReport][Belchertown][Units][Groups]" "group_pressure" "$WEEWX_PRESSURE_UNIT" fi From ecf2845e556ab5286dfcd9d31b81e337cf63a48b Mon Sep 17 00:00:00 2001 From: root Date: Sun, 3 May 2026 10:01:10 +0200 Subject: [PATCH 6/9] Log information --- docker-compose.yml | 1 + init/extensions.d/belchertown/2_configure.sh | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/docker-compose.yml b/docker-compose.yml index e55ff0d..a8bbf6b 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -25,6 +25,7 @@ services: - WEEWX_RAIN_YEAR_START=${WEEWX_RAIN_YEAR_START:-1} - WEEWX_WEEK_START=${WEEWX_WEEK_START:-0} - WEEWX_UNIT_SYSTEM=${WEEWX_UNIT_SYSTEM:-metric} + - WEEWX_PRESSURE_UNIT=${WEEWX_PRESSURE_UNIT:-mbar} - WEEWX_LANGUAGE=${WEEWX_LANGUAGE:-en} - WEEWX_TIMEZONE=${WEEWX_TIMEZONE:-} # Extension configuration diff --git a/init/extensions.d/belchertown/2_configure.sh b/init/extensions.d/belchertown/2_configure.sh index 5010aa5..4d4f63b 100755 --- a/init/extensions.d/belchertown/2_configure.sh +++ b/init/extensions.d/belchertown/2_configure.sh @@ -88,9 +88,10 @@ configure_belchertown_options() { configure_belchertown_pressure_override() { - + log_info "Check if WEEWX_PRESSURE UNIT env variable is set..." #If env variable set - configure pressure unit override if [ -n "$WEEWX_PRESSURE_UNIT" ]; then + log_info "WEEWX_PRESSURE_UNIT set - applying configuration." /init/weewx_config_api.py create-section "[StdReport][Belchertown][Units][Groups]" /init/weewx_config_api.py set-value "[StdReport][Belchertown][Units][Groups]" "group_pressure" "$WEEWX_PRESSURE_UNIT" fi From c311b99764903b18f9883230e51e3f620ce88699 Mon Sep 17 00:00:00 2001 From: root Date: Sun, 3 May 2026 10:08:44 +0200 Subject: [PATCH 7/9] Removed Pressure Override as it's not working in skin settings --- init/extensions.d/belchertown/2_configure.sh | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/init/extensions.d/belchertown/2_configure.sh b/init/extensions.d/belchertown/2_configure.sh index 4d4f63b..89657af 100755 --- a/init/extensions.d/belchertown/2_configure.sh +++ b/init/extensions.d/belchertown/2_configure.sh @@ -85,19 +85,6 @@ configure_belchertown_options() { fi } - - -configure_belchertown_pressure_override() { - log_info "Check if WEEWX_PRESSURE UNIT env variable is set..." - #If env variable set - configure pressure unit override - if [ -n "$WEEWX_PRESSURE_UNIT" ]; then - log_info "WEEWX_PRESSURE_UNIT set - applying configuration." - /init/weewx_config_api.py create-section "[StdReport][Belchertown][Units][Groups]" - /init/weewx_config_api.py set-value "[StdReport][Belchertown][Units][Groups]" "group_pressure" "$WEEWX_PRESSURE_UNIT" - fi - -} - # Map language code to proper locale string for Belchertown get_belchertown_locale() { case "${WEEWX_LANGUAGE:-en}" in @@ -167,7 +154,6 @@ configure_default_skin configure_belchertown_options configure_belchertown_locale configure_belchertown_timezone -configure_belchertown_pressure_override # Validate final configuration log_info "Validating final configuration..." From e5b8e04b9b88b9e49975beb0650d8a72737aa8a9 Mon Sep 17 00:00:00 2001 From: root Date: Sun, 3 May 2026 10:19:44 +0200 Subject: [PATCH 8/9] Global pressure unit override if env set --- init/configure-weewx.sh | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/init/configure-weewx.sh b/init/configure-weewx.sh index 062b1a1..59adfe6 100755 --- a/init/configure-weewx.sh +++ b/init/configure-weewx.sh @@ -62,6 +62,18 @@ if [ -n "$WEEWX_LANGUAGE" ] && [ "$WEEWX_LANGUAGE" != "en" ]; then /init/weewx_config_api.py set-value "[StdReport][Defaults]" "lang" "$WEEWX_LANGUAGE" fi +# If env variable for custom pressure unit set - apply config +if [ -n "$WEEWX_PRESSURE_UNIT" ]; then + + echo "Removing [StdReport][Defaults][Units][Groups]" + /init/weewx_config_api.py remove-section "[StdReport][Defaults][Units][Groups]" + echo "Recreating clean [StdReport][Defaults][Units][Groups]" + /init/weewx_config_api.py create-section "[StdReport][Defaults][Units][Groups]" + echo "Applying custom pressure unit: $WEEWX_PRESSURE_UNIT" + /init/weewx_config_api.py set-value "[StdReport][Defaults][Units][Groups]" "unused" "unused" + /init/weewx_config_api.py set-value "[StdReport][Defaults][Units][Groups]" "group_pressure" "$WEEWX_PRESSURE_UNIT" +fi + # Handle station_url (ConfigObj handles both commented and uncommented cases) if [ -n "$WEEWX_STATION_URL" ]; then echo "Setting station URL: $WEEWX_STATION_URL" From 1f05c4069ca363416010e0ddb9ab80178a5e75d6 Mon Sep 17 00:00:00 2001 From: root Date: Sun, 3 May 2026 10:55:26 +0200 Subject: [PATCH 9/9] Env for overriding pressure unit --- .env.example | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.env.example b/.env.example index af5cb5d..b9beabf 100644 --- a/.env.example +++ b/.env.example @@ -47,6 +47,10 @@ WEEWX_WEEK_START=0 # Options: 'us' (Fahrenheit, inches, etc.), 'metric' (Celsius, mm, etc.), 'metricwx' (meteorological metric) WEEWX_UNIT_SYSTEM=metric +# Custom unit for pressure group - defaults for metric mbar +# Options: inHg, mbar, hPa, kPa +WEEWX_PRESSURE_UNIT = mbar + # Language and Localization # Language code for WeeWX interface (en, de, fr, es, it, etc.) WEEWX_LANGUAGE=en