Skip to content

Commit bc5a82b

Browse files
authored
Add additional weather parameters to request from Open Meteo API (#13)
1 parent 4811c2d commit bc5a82b

File tree

5 files changed

+52
-28
lines changed

5 files changed

+52
-28
lines changed

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
FROM alpine:3.23.2
22

33
LABEL maintainer="Michael Oberdorf <info@oberdorf-itc.de>"
4-
LABEL site.local.program.version="1.1.1"
4+
LABEL site.local.program.version="1.2.0"
55

66
ENV TZ="UTC" \
77
REQUESTS_CA_BUNDLE=/etc/ssl/certs/ca-certificates.crt \

README.md

Lines changed: 35 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,8 @@ Container image: [DockerHub](https://hub.docker.com/r/oitc/weather2mqtt)
2626

2727
# Supported tags and respective `Dockerfile` links
2828

29-
* [`latest`, `1.1.1`](https://github.com/cybcon/docker.weather2mqtt/blob/v1.1.1/Dockerfile)
29+
* [`latest`, `1.2.0`](https://github.com/cybcon/docker.weather2mqtt/blob/v1.2.0/Dockerfile)
30+
* [`1.1.1`](https://github.com/cybcon/docker.weather2mqtt/blob/v1.1.1/Dockerfile)
3031
* [`1.1.0`](https://github.com/cybcon/docker.weather2mqtt/blob/v1.1.0/Dockerfile)
3132
* [`1.0.2`](https://github.com/cybcon/docker.weather2mqtt/blob/v1.0.2/Dockerfile)
3233
* [`1.0.0`](https://github.com/cybcon/docker.weather2mqtt/blob/v1.0.0/Dockerfile)
@@ -56,22 +57,22 @@ The results will be parsed, formatted in JSON and published via MQTT.
5657
"utc_offset_seconds": 3600
5758
},
5859
"current": {
59-
"time": "2025-12-31T13:45:00+01:00",
60-
"temperature_2m": 0.10000000149011612,
61-
"relative_humidity_2m": 66,
60+
"time": "2026-01-06T09:45:00+01:00",
61+
"temperature_2m": -6.849999904632568,
62+
"relative_humidity_2m": 89,
6263
"is_day": 1,
6364
"rain": 0,
6465
"showers": 0,
6566
"snowfall": 0,
66-
"weather_code": 1,
67-
"cloud_cover": 6,
68-
"surface_pressure": 974.9057006835938,
69-
"wind_speed_10m": 3.3190360069274902,
70-
"wind_direction_10m": 257.47119140625,
71-
"wind_gusts_10m": 8.640000343322754,
72-
"weather_code_text": "Mainly clear"
67+
"weather_code": 71,
68+
"cloud_cover": 100,
69+
"surface_pressure": 967.1641845703125,
70+
"wind_speed_10m": 2.0364675521850586,
71+
"wind_direction_10m": 224.99989318847656,
72+
"wind_gusts_10m": 4.320000171661377,
73+
"weather_code_text": "Snow fall: Slight intensity"
7374
},
74-
"message_timestamp": "2025-12-31T13:55:18.454689+01:00"
75+
"message_timestamp": "2026-01-06T09:59:13.119176+01:00"
7576
}
7677
```
7778

@@ -90,23 +91,34 @@ The results will be parsed, formatted in JSON and published via MQTT.
9091
"utc_offset_seconds": 3600
9192
},
9293
"tomorrow": {
93-
"date": "2026-01-01",
94-
"temperature_2m_min": -9.211000442504883,
95-
"temperature_2m_max": 2.439000129699707,
94+
"date": "2026-01-07",
95+
"temperature_2m_mean": -5.241146087646484,
96+
"temperature_2m_min": -8.211000442504883,
97+
"temperature_2m_max": -3.510999917984009,
9698
"rain_sum": 0,
9799
"showers_sum": 0,
98100
"snowfall_sum": 0,
99-
"weather_code": 71,
100-
"wind_speed_10m_max": 17.771753311157227,
101-
"wind_direction_10m_dominant": 234.57273864746094,
102-
"wind_gusts_10m_max": 32.39999771118164,
101+
"weather_code": 3,
102+
"wind_speed_10m_mean": 6.99040412902832,
103+
"wind_speed_10m_min": 1.9386591911315918,
104+
"wind_speed_10m_max": 13.10419750213623,
105+
"wind_direction_10m_dominant": 194.28439331054688,
106+
"wind_gusts_10m_mean": 13.739999771118164,
107+
"wind_gusts_10m_min": 5.039999961853027,
108+
"wind_gusts_10m_max": 25.559999465942383,
103109
"sunrise": 0,
104110
"sunset": 0,
105-
"daylight_duration": 30052.92578125,
106-
"sunshine_duration": 23301.818359375,
107-
"weather_code_text": "Snow fall: Slight intensity"
111+
"daylight_duration": 30511.171875,
112+
"sunshine_duration": 23594.3828125,
113+
"surface_pressure_mean": 964.9620971679688,
114+
"surface_pressure_min": 961.7695922851562,
115+
"surface_pressure_max": 968.2794189453125,
116+
"relative_humidity_2m_mean": 80.78125,
117+
"relative_humidity_2m_min": 69,
118+
"relative_humidity_2m_max": 89,
119+
"weather_code_text": "Cloudy"
108120
},
109-
"message_timestamp": "2025-12-31T14:37:19.159381+01:00"
121+
"message_timestamp": "2026-01-06T09:57:42.813048+01:00"
110122
}
111123
```
112124

src/app/bin/weather2mqtt.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
# Author: Michael Oberdorf
1212
# Date: 2025-04-11
1313
# Last modified by: Michael Oberdorf
14-
# Last modified at: 2026-01-01
14+
# Last modified at: 2026-01-06
1515
###############################################################################
1616
"""
1717

@@ -29,7 +29,7 @@
2929
from lib.weather_codes import translate_weather_code
3030
from retry_requests import retry # seeAlso: https://pypi.org/project/retry-requests/
3131

32-
__version__ = "1.1.1"
32+
__version__ = "1.2.0"
3333
__script_path__ = os.path.dirname(__file__)
3434
__config_path__ = os.path.join(os.path.dirname(__script_path__), "etc")
3535
__local_tz__ = pytz.timezone("UTC")

src/app/etc/current.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@
1313
"surface_pressure",
1414
"wind_speed_10m",
1515
"wind_direction_10m",
16-
"wind_gusts_10m"
16+
"wind_gusts_10m",
17+
"surface_pressure"
1718
]
1819
}
1920
}

src/app/etc/tomorrow.json

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,19 +4,30 @@
44
"forecast_days": 3,
55
"past_days": 0,
66
"daily": [
7+
"temperature_2m_mean",
78
"temperature_2m_min",
89
"temperature_2m_max",
910
"rain_sum",
1011
"showers_sum",
1112
"snowfall_sum",
1213
"weather_code",
14+
"wind_speed_10m_mean",
15+
"wind_speed_10m_min",
1316
"wind_speed_10m_max",
1417
"wind_direction_10m_dominant",
18+
"wind_gusts_10m_mean",
19+
"wind_gusts_10m_min",
1520
"wind_gusts_10m_max",
1621
"sunrise",
1722
"sunset",
1823
"daylight_duration",
19-
"sunshine_duration"
24+
"sunshine_duration",
25+
"surface_pressure_mean",
26+
"surface_pressure_min",
27+
"surface_pressure_max",
28+
"relative_humidity_2m_mean",
29+
"relative_humidity_2m_min",
30+
"relative_humidity_2m_max"
2031
]
2132
}
2233
}

0 commit comments

Comments
 (0)