cloudy

Author Topic: MySQL Database construct SQL  (Read 1089 times)

0 Members and 1 Guest are viewing this topic.

Offline Smitty_kiwi

  • Posts: 28
  • Cheers - John S
  • Clyde - NZ
    • Clyde XML file data feed
MySQL Database construct SQL
« on: July 31, 2009, 02:06:12 AM »
Is there a MySQL database construct sql floating about. In the config txt it says see the read me for the database design, but I must have missed something in the reading there, as there is no mention of the MySQL design in the read me with WDConsole.

Addendum 21:22
I also need to know the order that wdconsole parse's the oww log file, so that I can get that part right, for the 1 wire station here.
« Last Edit: July 31, 2009, 08:23:01 AM by Smitty_kiwi »

Offline Smitty_kiwi

  • Posts: 28
  • Cheers - John S
  • Clyde - NZ
    • Clyde XML file data feed
Re: MySQL Database construct SQL
« Reply #1 on: September 05, 2009, 09:51:27 PM »
Is there a MySQL database construct sql floating about. In the config txt it says see the read me for the database design, but I must have missed something in the reading there, as there is no mention of the MySQL design in the read me with WDConsole.

Addendum 21:22
I also need to know the order that wdconsole parse's the oww log file, so that I can get that part right, for the 1 wire station here.
I have commented this question to bring it up the list.
What I was wondering is there a table description somewhere to create the table for wdconsole to feed data too.
I would also like to know a bit about changing the log file input from oww, so that it could include extra sensors, like solar etc ... this all in relation to wdconsole, in cohorts with owww on a 1 wire system.

Offline niko

  • syzygy
  • Global Moderator
  • Posts: 21,998
  • Crystal Ball broken! Please post the URL.
  • Northern California, U.S.A.
    • http://www.realweatherstation.com
Re: MySQL Database construct SQL
« Reply #2 on: September 05, 2009, 11:05:25 PM »
Doesn't the download include a script that creates the MySQL database?

Offline n7dq

  • Posts: 530
  • Windsor, CO
    • Windsor, CO - Weather -- N7DQ
Re: MySQL Database construct SQL
« Reply #3 on: September 06, 2009, 01:49:39 PM »
I think this is the most current table definition.

#
# Table structure for table `wx_data`
#

CREATE TABLE `wx_data` (
`station_id` varchar(10) NOT NULL default ' ',
`date` date NOT NULL default '0000-00-00',
`time` time NOT NULL default '00:00:00',
`average_windspeed` float NOT NULL default '0',
`wind_direction` smallint(3) NOT NULL default '0',
`gust_windspeed` float NOT NULL default '0',
`temperature` float NOT NULL default '0',
`outdoor_humidity` float NOT NULL default '0',
`barometer` float NOT NULL default '0',
`daily_rainfall` float NOT NULL default '0',
`monthly_rainfall` float NOT NULL default '0',
`yearly_rainfall` float NOT NULL default '0',
`rain_rate` float NOT NULL default '0',
`max_rain_rate_curent_day` float NOT NULL default '0',
`indoor_temperature` float NOT NULL default '0',
`indoor_humidity` float NOT NULL default '0',
`soil_temperature` float NOT NULL default '0',
`forecast_icon` int(3) NOT NULL default '0',
`wmr968_extra_temperature` float NOT NULL default '0',
`wmr968_extra_humidity` float NOT NULL default '0',
`wmr968_extra_sensor_number` smallint(2) NOT NULL default '0',
`yesterday_rainfall` float NOT NULL default '0',
`extra_temperature_sensor_2` float NOT NULL default '0',
`extra_temperature_sensor_3` float NOT NULL default '0',
`extra_temperature_sensor_4` float NOT NULL default '0',
`extra_temperature_sensor_5` float NOT NULL default '0',
`extra_temperature_sensor_6` float NOT NULL default '0',
`extra_temperature_sensor_7` float NOT NULL default '0',
`extra_humidity_2` float NOT NULL default '0',
`extra_humidity_3` float NOT NULL default '0',
`extra_humidity_4` float NOT NULL default '0',
`hour` smallint(2) NOT NULL default '0',
`minute` smallint(2) NOT NULL default '0',
`second` smallint(2) NOT NULL default '0',
`station_name` varchar(100) NOT NULL default '',
`dallas_1_wire_lightning_count` int(11) NOT NULL default '0',
`actual_solar_reading` int(11) NOT NULL default '0',
`day` smallint(2) NOT NULL default '0',
`month` smallint(2) NOT NULL default '0',
`wmr968_battery_level_1` smallint(3) NOT NULL default '0',
`wmr968_battery_level_2` smallint(3) NOT NULL default '0',
`wmr968_battery_level_3` smallint(3) NOT NULL default '0',
`wmr968_battery_level_4` smallint(3) NOT NULL default '0',
`wmr968_battery_level_5` smallint(3) NOT NULL default '0',
`wmr968_battery_level_6` smallint(3) NOT NULL default '0',
`wmr968_battery_level_7` smallint(3) NOT NULL default '0',
`current_windchill` float NOT NULL default '0',
`current_humidex` float NOT NULL default '0',
`max_daily_temperature` float NOT NULL default '0',
`min_daily_temperature` float NOT NULL default '0',
`icon_type` smallint(3) NOT NULL default '0',
`current_weather_desc` varchar(20) NOT NULL default '',
`barometer_trend_last_hour` float NOT NULL default '0',
`max_gust_current_day` float NOT NULL default '0',
`dew_point_temperature` float NOT NULL default '0',
`cloud_height` float NOT NULL default '0',
`max_humidex` float NOT NULL default '0',
`min_humidex` float NOT NULL default '0',
`max_windchill` float NOT NULL default '0',
`min_windchill` float NOT NULL default '0',
`davis_vp_uv` float NOT NULL default '0',
`max_heat_index` float NOT NULL default '0',
`min_heat_index` float NOT NULL default '0',
`heat_index` float NOT NULL default '0',
`max_average_windspeed_day` float NOT NULL default '0',
UNIQUE KEY `station_id` (`station_id`,`date`,`time`)
) TYPE=MyISAM COMMENT='wx_data from Weather Display';


Mike - N7DQ
Mike - N7DQ
----------------------------
http://www.n7dq.com/weather
CWOP: AT059
WeatherUnderground: KCOWINDS8
[

Offline Smitty_kiwi

  • Posts: 28
  • Cheers - John S
  • Clyde - NZ
    • Clyde XML file data feed
Re: MySQL Database construct SQL
« Reply #4 on: September 09, 2009, 09:48:14 PM »
Thanks Mike,
This will give me a base start, what I am not sure about is the mysql part of wdconsole, does it maintain all the data fields in the above tables. I wonder, and indeed, does wdconsole manage to obtain all the necessary data from the OWW logfile. Some of the above fields would be a challenge to construct queries for extracting from the log file I am thinking.
Any Hoo, I am stuffed full of the flu oink oink, so I might have time to make this happen in the next few days ... as long as I can stop my nose dripping on dunhh keyboard ..  :lol: