Skip to content

Commit

Permalink
Added rain_hour to minute_data. Bump to 1.2.3
Browse files Browse the repository at this point in the history
  • Loading branch information
briis committed May 6, 2024
1 parent c791ad8 commit 76a3fb7
Show file tree
Hide file tree
Showing 6 changed files with 44 additions and 3 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,12 @@

# Release 1.2.3

**Date**: `2024-05-06`

## What Changed

* Added `rain_hour` to Minute Data

# Release 1.2.2

**Date**: `2024-05-05`
Expand Down
31 changes: 31 additions & 0 deletions meteobridge/service_commands.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
********************************************
** MONTHLY DATA **
TABLE: monthly_data
Interval: before every full hour
********************************************

INSERT INTO `monthly_data` (`logdate`, `temperature_low`, `temperature_high`, `humidity_low`, `humidity_high`, `rain_total`, `wind_speed_max`, `wind_speed_avg`, `wind_direction_avg`, `uvindex_max`, `solar_radiation_max`, `pressure_low`, `pressure_high`, `air_quality_low`, `air_quality_high`) VALUES ('[YYYY]-[MM]-01', '[th0temp-mmin:0.0]', '[th0temp-mmax:0.0]', '[th0hum-mmin:0]', '[th0hum-mmax:0]', '[rain0total-monthsum:0.0]', '[wind0wind-mmax:0.0]', '[wind0wind-mavg:0.0]', '[wind0dir-mavg:0]', '[uv0index-mmax:0]', '[sol0rad-mmax:0]', '[thb0seapress-mmin:0]', '[thb0seapress-mmax:0]', '[air0pm-mmin:0]', '[air0pm-mmax:0]') ON DUPLICATE KEY UPDATE `temperature_low` = '[th0temp-mmin:0.0]', `temperature_high` = '[th0temp-mmax:0.0]', `humidity_low` = '[th0hum-mmin:0]', `humidity_high` = '[th0hum-mmax:0]', `rain_total` = '[rain0total-monthsum:0.0]', `wind_speed_max` = '[wind0wind-mmax:0.0]', `wind_speed_avg` = '[wind0wind-mavg:0.0]', `wind_direction_avg` = '[wind0dir-mavg:0]', `uvindex_max` = '[uv0index-mmax:0]', `solar_radiation_max` = '[sol0rad-mmax:0]', `pressure_low` = '[thb0seapress-mmin:0]', `pressure_high` = '[thb0seapress-mmax:0]', `air_quality_low` = '[air0pm-mmin:0]', `air_quality_high` = '[air0pm-mmax:0]'

********************************************
** DAILY DATA **
TABLE: daily_data
Interval: every full 15 minutes
********************************************

INSERT INTO `daily_data` (`logdate`, `temperature_low`, `temperature_high`, `humidity_low`, `humidity_high`, `rain_total`, `wind_speed_max`, `wind_speed_avg`, `wind_direction_avg`, `uvindex_max`, `solar_radiation_max`, `pressure_low`, `pressure_high`, `air_quality_low`, `air_quality_high`) VALUES ('[YYYY]-[MM]-[DD]', '[th0temp-dmin:0.0]', '[th0temp-dmax:0.0]', '[th0hum-dmin:0]', '[th0hum-dmax:0]', '[rain0total-daysum:0.0]', '[wind0wind-dmax:0.0]', '[wind0wind-davg:0.0]', '[wind0dir-davg:0]', '[uv0index-dmax:0]', '[sol0rad-dmax:0]', '[thb0seapress-dmin:0]', '[thb0seapress-dmax:0]', '[air0pm-dmin:0]', '[air0pm-dmax:0]') ON DUPLICATE KEY UPDATE `temperature_low` = '[th0temp-dmin:0.0]', `temperature_high` = '[th0temp-dmax:0.0]', `humidity_low` = '[th0hum-dmin:0]', `humidity_high` = '[th0hum-dmax:0]', `rain_total` = '[rain0total-daysum:0.0]', `wind_speed_max` = '[wind0wind-dmax:0.0]', `wind_speed_avg` = '[wind0wind-davg:0.0]', `wind_direction_avg` = '[wind0dir-davg:0]', `uvindex_max` = '[uv0index-dmax:0]', `solar_radiation_max` = '[sol0rad-dmax:0]', `pressure_low` = '[thb0seapress-dmin:0]', `pressure_high` = '[thb0seapress-dmax:0]', `air_quality_low` = '[air0pm-dmin:0]', `air_quality_high` = '[air0pm-dmax:0]'

********************************************
** MINUTE DATA **
TABLE: minute_data
Interval: every full 10 minutes
********************************************

INSERT INTO `minute_data` (`logdate`, `temperature`, `wind_chill`, `air_Quality_pm1`, `air_Quality_pm10`, `air_Quality_pm25`, `heat_index`, `humidity`, `dewpoint`, `rain_rate`, `rain_day`, `rain_hour`, `wind_speed`, `wind_gust`, `wind_bearing`, `pressure`, `pressure_trend`, `uv`, `solar_radiation`) VALUES ('[YYYY]-[MM]-[DD] [hh]:[mm]', '[th0temp-act:0]', '[wind0chill-act:0]', '[air0pm-act:0]', '[air1pm-act:0]', '[air2pm-act:0]', '[th0heatindex-act:0]', '[th0hum-act:0]', '[th0dew-act:0]', '[rain0rate-act:0]', '[rain0total-daysum:0]', '[rain0total-hoursum:0]', '[wind0avgwind-act:0]', '[wind0wind-max10:0]', '[wind0dir-avg10:0]', '[thb0seapress-act:0]', '[thb0seapress-delta3h:0]', '[uv0index-act:0]', '[sol0rad-act:0]')

********************************************
** REALTIME DATA **
TABLE: realtime_data
Interval: every 30 seconds
********************************************

UPDATE `realtime_data` SET `temperature` = '[th0temp-act:0]',`tempmax` = '[th0temp-dmax:0]', `tempmin` = '[th0temp-dmin:0]', `windchill` = '[wind0chill-act:0]', `pm1` = '[air0pm-act:0]', `pm25` = '[air1pm-act:0]', `pm10` = '[air2pm-act:0]', `heatindex` = '[th0heatindex-act:0]', `temp15min` = '[th0temp-val15:0]', `humidity` = '[th0hum-act:0]', `windspeedavg` = '[wind0avgwind-act:0]', `windgust` = '[wind0wind-max10:0]', `dewpoint` = '[th0dew-act:0]', `rainrate` = '[rain0rate-act:0]', `raintoday` = '[rain0total-daysum:0]', `rainyesterday` = '[rain0total-ydaysum:0]', `windbearing` = '[wind0dir-act:0]', `beaufort` = '[wind0wind-act=bft.0:0]', `sealevelpressure` = '[thb0seapress-act:0]', `uv` = '[uv0index-act:0]', `uvdaymax` = '[uv0index-dmax:0]', `solarrad` = '[sol0rad-act:0]', `solarraddaymax` = '[sol0rad-dmax:0]', `pressuretrend` = '[thb0seapress-delta3h:0]', `mb_ip` = '[mbsystem-ip:-]', `mb_swversion` = '[mbsystem-swversion:-]', `mb_buildnum` = '[mbsystem-buildnum:-]', `mb_platform` = '[mbsystem-platform:-]', `mb_station` = '[mbsystem-station:-]' WHERE `ID` = '[mbsystem-mac:0]'
2 changes: 1 addition & 1 deletion php/forecast_visualcrossing.php
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@

$sql = "INSERT INTO `forecast_hourly` (`hour_num`, `datetime`, `temperature`, `apparent_temperature`, `description`, `icon`, `humidity`, `precipitation_probability`, `precipitation`, `pressure`, `wind_bearing`, `wind_speed`, `wind_gust`, `uv_index`, `visibility`) ";
$sql = $sql . "VALUES (".$hour_num.",'".$jobj_hour->datetime."',".$jobj_hour->native_temperature.",".$jobj_hour->apparent_temperature.",'".$jobj_hour->description."','".$jobj_hour->icon."',".$jobj_hour->humidity.",".$jobj_hour->precipitation_probability.",".$jobj_hour->native_precipitation."," .$jobj_hour->native_pressure.",".$jobj_hour->wind_bearing.",".$jobj_hour->native_wind_speed.",".$jobj_hour->native_wind_gust.",".$jobj_hour->uvindex.",".$jobj_hour->visibility.") ";
$sql = $sql . "ON DUPLICATE KEY UPDATE `datetime`='".$jobj_hour->datetime."', `temperature`=".$jobj_hour->native_temperature.", `apparent_temperature`=".$jobj_hour->apparent_temperature.", `description`='".$jobj_hour->description."', `icon`='".$jobj_hour->icon."', `humidity`=".$jobj_hour->humidity.", `precipitation_probability`=".$jobj_hour->precipitation_probability.", `precipitation`=".$jobj_hour->native_precipitation.", `pressure`=".$jobj_hour->native_pressure.", `wind_bearing`=".$jobj_hour->wind_bearing.", `wind_speed`=".$jobj_hour->native_wind_speed.", `wind_gust`=".$jobj_hour->native_wind_gust.", `uv_index`=".$jobj_hour->visibility.", `uv_index`=".$jobj_hour->visibility;
$sql = $sql . "ON DUPLICATE KEY UPDATE `datetime`='".$jobj_hour->datetime."', `temperature`=".$jobj_hour->native_temperature.", `apparent_temperature`=".$jobj_hour->apparent_temperature.", `description`='".$jobj_hour->description."', `icon`='".$jobj_hour->icon."', `humidity`=".$jobj_hour->humidity.", `precipitation_probability`=".$jobj_hour->precipitation_probability.", `precipitation`=".$jobj_hour->native_precipitation.", `pressure`=".$jobj_hour->native_pressure.", `wind_bearing`=".$jobj_hour->wind_bearing.", `wind_speed`=".$jobj_hour->native_wind_speed.", `wind_gust`=".$jobj_hour->native_wind_gust.", `uv_index`=".$jobj_hour->uvindex.", `visibility`=".$jobj_hour->visibility;
++$hour_num;

if (!mysqli_query($conn, $sql)) {
Expand Down
2 changes: 1 addition & 1 deletion pymeteobridgesql/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@
from .data import ForecastDaily, ForecastHourly, MinuteData, MonthlyData, RealtimeData, StationData

__title__ = "pymeteobridgesql"
__version__ = "1.2.2"
__version__ = "1.2.3"
__author__ = "briis"
__license__ = "MIT"
2 changes: 2 additions & 0 deletions pymeteobridgesql/data.py
Original file line number Diff line number Diff line change
Expand Up @@ -324,6 +324,7 @@ class MinuteData:
dewpoint: float
rain_rate: float
rain_day: float
rain_hour: float
wind_speed: float
wind_gust: float
wind_bearing: int
Expand All @@ -345,6 +346,7 @@ def to_dict(self):
"dewpoint": self.dewpoint,
"rain_rate": self.rain_rate,
"rain_day": self.rain_day,
"rain_hour": self.rain_hour,
"wind_speed": self.wind_speed,
"wind_gust": self.wind_gust,
"wind_bearing": self.wind_bearing,
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

setuptools.setup(
name="pymeteobridgesql",
version="1.2.2",
version="1.2.3",
author="briis",
author_email="bjarne@briis.com",
description="Gets weather data from a MySQL table",
Expand Down

0 comments on commit 76a3fb7

Please sign in to comment.