# WEEWX CONFIGURATION FILE
#
# Copyright (c) 2009-2021 Tom Keffer <tkeffer@gmail.com>
# See the file LICENSE.txt for your rights.

##############################################################################

# This section is for general configuration information.

# Set to 1 for extra debug info, otherwise comment it out or set to zero
debug = 0

# Root directory of the weewx data file hierarchy for this station WEEWX_ROOT = /home/weewx
WEEWX_ROOT = /var/weewx

# Whether to log successful operations
log_success = True

# Whether to log unsuccessful operations
log_failure = True

# How long to wait before timing out a socket (FTP, HTTP) connection
socket_timeout = 20

# Do not modify this. It is used when installing and updating weewx.
version = 4.7.0

# Whether to try indefinitely to load the driver
loop_on_init = 1

##############################################################################

#   This section is for information about the station.

[Station]
    location = "A farm in Castine, Maine"
    latitude = 44.3878547
    longitude = -68.7997522
    altitude = 82, foot    # Choose 'foot' or 'meter' for unit
    station_type = GW1000
    station_url = https://wx.unbl.ink
    rain_year_start = 1
    week_start = 6

##############################################################################

[GW1000]
    # This section is for the GW1000
    
    # The driver itself
    driver = user.gw1000
    ip_address = 192.168.40.180
    port = 45000
    poll_interval = 10

[StdRESTful]
    [[StationRegistry]]
        register_this_station = true
    
    [[AWEKAS]]
        enable = false
        username = replace_me
        password = replace_me
    
    [[CWOP]]
        enable = false
        station = replace_me
    #passcode = replace_me (APRS stations only)
    
    [[PWSweather]]
        enable = false
        station = replace_me
        password = replace_me
    
    [[WOW]]
        enable = false
        station = replace_me
        password = replace_me
    
    [[Wunderground]]
        # This section is for configuring posts to the Weather Underground.
        
        # If you wish to do this, set the option 'enable' to true,
        # and specify a station (e.g., 'KORHOODR3') and password.
        # To guard against parsing errors, put the password in quotes.
        enable = false
        station = replace_me
        password = replace_me
        
        # If you plan on using wunderfixer, set the following
        # to your API key:
        api_key = replace_me
        
        # Set the following to True to have weewx use the WU "Rapidfire"
        # protocol. Not all hardware can support it. See the User's Guide.
        rapidfire = False

##############################################################################

#   This section specifies what reports, using which skins, to generate.

[StdReport]
    SKIN_ROOT = skins
    HTML_ROOT = public_html
    data_binding = wx_binding
    log_success = true
    log_failure = true
    
    [[SeasonsReport]]
        # The SeasonsReport uses the 'Seasons' skin, which contains the
        # images, templates and plots for the report.
        skin = Seasons
        enable = true
        HTML_ROOT = public_html/seasons
    
    [[SmartphoneReport]]
        # The SmartphoneReport uses the 'Smartphone' skin, and the images and
        # files are placed in a dedicated subdirectory.
        skin = Smartphone
       enable = false
        HTML_ROOT = public_html/smartphone
    
    [[MobileReport]]
        # The MobileReport uses the 'Mobile' skin, and the images and files
        # are placed in a dedicated subdirectory.
        skin = Mobile
        enable = false
        HTML_ROOT = public_html/mobile

    [[neowx-material]]
        skin = neowx-material
        HTML_ROOT = public_html/neowx
        enable = true
    
    [[StandardReport]]
        # This is the old "Standard" skin. By default, it is not enabled.
        skin = Standard
        enable = true
        HTML_ROOT = public_html/standard

    [[SofaReport]]
        skin = Sofaskin-CW9009-1.4.91
        enable = true
    
    [[FTP]]
        skin = Ftp
        enable = false
        user = replace_me
        password = replace_me
        server = replace_me    # The ftp server name, e.g, www.myserver.org path = replace_me    # The destination directory, e.g., /weather
        secure_ftp = False
        port = 21
        passive = 1
    
    [[RSYNC]]
        skin = Rsync
        enable = false
        server = replace_me
        user = replace_me
        path = replace_me
        #HTML_ROOT = public_html
        delete = 0
    
    [[Defaults]]
        
        [[[Units]]]
            [[[[Groups]]]]
                group_altitude = foot    # Options are 'foot' or 'meter'
                group_degree_day = degree_F_day    # Options are 'degree_F_day' or 'degree_C_day'
                group_distance = mile    # Options are 'mile' or 'km'
                group_pressure = mmHg    # Options are 'inHg', 'mmHg', 'mbar', 'hPa', or 'kPa'
                group_rain = inch    # Options are 'inch', 'cm', or 'mm'
                group_rainrate = inch_per_hour    # Options are 'inch_per_hour', 'cm_per_hour', or 'mm_per_hour'
                group_speed = knot    # Options are 'mile_per_hour', 'km_per_hour', 'knot', or 'meter_per_second'
                group_speed2 = mile_per_hour2    # Options are 'mile_per_hour2', 'km_per_hour2', 'knot2', or 'meter_per_second2'
                group_temperature = degree_F    # Options are 'degree_F' or 'degree_C'
            [[[[StringFormats]]]]
                
                centibar = %.0f
                cm = %.2f
                cm_per_hour = %.2f
                degree_C = %.1f
                degree_F = %.1f
                degree_compass = %.0f
                foot = %.0f
                hPa = %.1f
                hour = %.1f
                inHg = %.3f
                inch = %.2f
                inch_per_hour = %.2f
                km = %.1f
                km_per_hour = %.0f
                km_per_hour2 = %.1f
                knot = %.0f
                knot2 = %.1f
                kPa = %.2f
                mbar = %.1f
                meter = %.0f
                meter_per_second = %.1f
                meter_per_second2 = %.1f
                mile = %.1f
                mile_per_hour = %.0f
                mile_per_hour2 = %.1f
                mm = %.1f
                mmHg = %.1f
                mm_per_hour = %.1f
                percent = %.0f
                second = %.0f
                uv_index = %.1f
                volt = %.1f
                watt_per_meter_squared = %.0f
                NONE = "   N/A"
            [[[[Labels]]]]
                
                meter = " meter", " meters"    # You may prefer "metre".
                day = " day", " days"
                hour = " hour", " hours"
                minute = " minute", " minutes"
                second = " second", " seconds"
                NONE = ""
            [[[[TimeFormats]]]]
                
                hour = %H:%M
                day = %X
                week = %X (%A)
                month = %x %X
                year = %x %X
                rainyear = %x %X
                current = %x %X
                ephem_day = %X
                ephem_year = %x %X
            
            [[[[Ordinates]]]]
                directions = N, NNE, NE, ENE, E, ESE, SE, SSE, S, SSW, SW, WSW, W, WNW, NW, NNW, N/A
            
            [[[[DegreeDays]]]]
                heating_base = 65, degree_F
                cooling_base = 65, degree_F
                growing_base = 50, degree_F
            
            [[[[Trend]]]]
                time_delta = 10800    # 3 hours
                time_grace = 300    # 5 minutes
        
        [[[Labels]]]
            hemispheres = N, S, E, W
            latlon_formats = %02d, %03d, %05.2f
            
            [[[[Generic]]]]
                barometer = Barometer
                dewpoint = Dew Point
                ET = ET
                heatindex = Heat Index
                inHumidity = Inside Humidity
                inTemp = Inside Temperature
                outHumidity = Humidity
                outTemp = Outside Temperature
                radiation = Radiation
                rain = Rain
                rainRate = Rain Rate
                UV = UV Index
                windDir = Wind Direction
                windGust = Gust Speed
                windGustDir = Gust Direction
                windSpeed = Wind Speed
                windchill = Wind Chill
                windgustvec = Gust Vector
                windvec = Wind Vector
                extraTemp1 = Temperature1
                extraTemp2 = Temperature2
                extraTemp3 = Temperature3
                
                rxCheckPercent = Signal Quality
                txBatteryStatus = Transmitter Battery
                windBatteryStatus = Wind Battery
                rainBatteryStatus = Rain Battery
                outTempBatteryStatus = Outside Temperature Battery
                inTempBatteryStatus = Inside Temperature Battery
                consBatteryVoltage = Console Battery
                heatingVoltage = Heating Battery
                supplyVoltage = Supply Voltage
                referenceVoltage = Reference Voltage
        
        [[[Almanac]]]
            moon_phases = New, Waxing crescent, First quarter, Waxing gibbous, Full, Waning gibbous, Last quarter, Waning crescent

##############################################################################

[StdConvert]
    # DO NOT MODIFY THIS VALUE UNLESS YOU KNOW WHAT YOU ARE DOING!
    target_unit = US    # Options are 'US', 'METRICWX', or 'METRIC'

##############################################################################

[StdCalibrate]
    
    [[Corrections]]
        # For each type, an arbitrary calibration expression can be given.
        # It should be in the units defined in the StdConvert section.
        # Example:
        foo = foo + 0.2

##############################################################################

[StdQC]
    [[MinMax]]
        barometer = 26, 32.5, inHg
        pressure = 24, 34.5, inHg
        outTemp = -40, 120, degree_F
        inTemp = 10, 120, degree_F
        outHumidity = 0, 100
        inHumidity = 0, 100
        windSpeed = 0, 120, mile_per_hour
        rain = 0, 10, inch

##############################################################################

[StdWXCalculate]
    [[Calculations]]
        pressure = prefer_hardware
        altimeter = prefer_hardware
        appTemp = prefer_hardware
        barometer = prefer_hardware
        cloudbase = prefer_hardware
        dewpoint = prefer_hardware
        ET = prefer_hardware
        heatindex = prefer_hardware
        humidex = prefer_hardware
        inDewpoint = prefer_hardware
        maxSolarRad = prefer_hardware
        rainRate = prefer_hardware
        windchill = prefer_hardware
        windrun = prefer_hardware

##############################################################################

[StdTimeSynch]
    clock_check = 14400
    max_drift = 5

##############################################################################

[StdArchive]
    
    # If the station hardware supports data logging then the archive interval
    # will be downloaded from the station. Otherwise, specify it (in seconds).
    archive_interval = 300
    
    # If possible, new archive records are downloaded from the station
    # hardware. If the hardware does not support this, then new archive
    # records will be generated in software.
    # Set the following to "software" to force software record generation.
    record_generation = software
    
    # Whether to include LOOP data in hi/low statistics
    loop_hilo = True
    
    # The data binding used to save archive records
    data_binding = wx_binding

##############################################################################

#   This section binds a data store to a database.

[DataBindings]
    
    [[wx_binding]]
        # The database must match one of the sections in [Databases].
        # This is likely to be the only option you would want to change.
        database = archive_sqlite
        # The name of the table within the database
        table_name = archive
        # The manager handles aggregation of data for historical summaries
        manager = weewx.manager.DaySummaryManager
        # The schema defines the structure of the database.
        # It is *only* used when the database is created.
        schema = schemas.wview_extended.schema

##############################################################################

#   This section defines various databases.

[Databases]
    
    # A SQLite database is simply a single file
    [[archive_sqlite]]
        database_name = weewx.sdb
        database_type = SQLite

##############################################################################

#   This section defines defaults for the different types of databases.

[DatabaseTypes]
    
    # Defaults for SQLite databases
    [[SQLite]]
        driver = weedb.sqlite
        # Directory in which the database files are located
        SQLITE_ROOT = %(WEEWX_ROOT)s/archive

##############################################################################

#   This section configures the internal weewx engine.

[Engine]
    
    # The following section specifies which services should be run and in what order.
    [[Services]]
        prep_services = weewx.engine.StdTimeSynch
        data_services = ,
        process_services = weewx.engine.StdConvert, weewx.engine.StdCalibrate, weewx.engine.StdQC, weewx.wxservices.StdWXCalculate
        xtype_services = weewx.wxxtypes.StdWXXTypes, weewx.wxxtypes.StdPressureCooker, weewx.wxxtypes.StdRainRater, weewx.wxxtypes.StdDelta
        archive_services = weewx.engine.StdArchive
        restful_services = weewx.restx.StdStationRegistry, weewx.restx.StdWunderground, weewx.restx.StdPWSweather, weewx.restx.StdCWOP, weewx.restx.StdWOW, weewx.restx.StdAWEKAS
        report_services = weewx.engine.StdPrint, weewx.engine.StdReport

[Accumulator]
    [[lightning_strike_count]]
        extractor = sum
    [[lightning_last_det_time]]
        extractor = last
    [[lightning_distance]]
        extractor = last
    [[daymaxwind]]
        extractor = last
    [[stormRain]]
        extractor = last
    [[hourRain]]
        extractor = last
    [[dayRain]]
        extractor = last
    [[weekRain]]
        extractor = last
    [[monthRain]]
        extractor = last
    [[yearRain]]
        extractor = last
    [[totalRain]]
        extractor = last
    [[pm2_51_24h_avg]]
        extractor = last
    [[pm2_52_24h_avg]]
        extractor = last
    [[pm2_53_24h_avg]]
        extractor = last
    [[pm2_54_24h_avg]]
        extractor = last
    [[pm2_55_24h_avg]]
        extractor = last
    [[pm10_24h_avg]]
        extractor = last
    [[co2_24h_avg]]
        extractor = last
    [[wh40_batt]]
        extractor = last
    [[wh26_batt]]
        extractor = last
    [[wh25_batt]]
        extractor = last
    [[wh65_batt]]
        extractor = last
    [[wh31_ch1_batt]]
        extractor = last
    [[wh31_ch2_batt]]
        extractor = last
    [[wh31_ch3_batt]]
        extractor = last
    [[wh31_ch4_batt]]
        extractor = last
    [[wh31_ch5_batt]]
        extractor = last
    [[wh31_ch6_batt]]
        extractor = last
    [[wh31_ch7_batt]]
        extractor = last
    [[wh31_ch8_batt]]
        extractor = last
    [[wh41_ch1_batt]]
        extractor = last
    [[wh41_ch2_batt]]
        extractor = last
    [[wh41_ch3_batt]]
        extractor = last
    [[wh41_ch4_batt]]
        extractor = last
    [[wh45_batt]]
        extractor = last
    [[wh51_ch1_batt]]
        extractor = last
    [[wh51_ch2_batt]]
        extractor = last
    [[wh51_ch3_batt]]
        extractor = last
    [[wh51_ch4_batt]]
        extractor = last
    [[wh51_ch5_batt]]
        extractor = last
    [[wh51_ch6_batt]]
        extractor = last
    [[wh51_ch7_batt]]
        extractor = last
    [[wh51_ch8_batt]]
        extractor = last
    [[wh51_ch9_batt]]
        extractor = last
    [[wh51_ch10_batt]]
        extractor = last
    [[wh51_ch11_batt]]
        extractor = last
    [[wh51_ch12_batt]]
        extractor = last
    [[wh51_ch13_batt]]
        extractor = last
    [[wh51_ch14_batt]]
        extractor = last
    [[wh51_ch15_batt]]
        extractor = last
    [[wh51_ch16_batt]]
        extractor = last
    [[wh55_ch1_batt]]
        extractor = last
    [[wh55_ch2_batt]]
        extractor = last
    [[wh55_ch3_batt]]
        extractor = last
    [[wh55_ch4_batt]]
        extractor = last
    [[wh57_batt]]
        extractor = last
    [[wh68_batt]]
        extractor = last
    [[ws80_batt]]
        extractor = last
    [[wh40_sig]]
        extractor = last
    [[wh26_sig]]
        extractor = last
    [[wh25_sig]]
        extractor = last
    [[wh65_sig]]
        extractor = last
    [[wh31_ch1_sig]]
        extractor = last
    [[wh31_ch2_sig]]
        extractor = last
    [[wh31_ch3_sig]]
        extractor = last
    [[wh31_ch4_sig]]
        extractor = last
    [[wh31_ch5_sig]]
        extractor = last
    [[wh31_ch6_sig]]
        extractor = last
    [[wh31_ch7_sig]]
        extractor = last
    [[wh31_ch8_sig]]
        extractor = last
    [[wh41_ch1_sig]]
        extractor = last
    [[wh41_ch2_sig]]
        extractor = last
    [[wh41_ch3_sig]]
        extractor = last
    [[wh41_ch4_sig]]
        extractor = last
    [[wh45_sig]]
        extractor = last
    [[wh51_ch1_sig]]
        extractor = last
    [[wh51_ch2_sig]]
        extractor = last
    [[wh51_ch3_sig]]
        extractor = last
    [[wh51_ch4_sig]]
        extractor = last
    [[wh51_ch5_sig]]
        extractor = last
    [[wh51_ch6_sig]]
        extractor = last
    [[wh51_ch7_sig]]
        extractor = last
    [[wh51_ch8_sig]]
        extractor = last
    [[wh51_ch9_sig]]
        extractor = last
    [[wh51_ch10_sig]]
        extractor = last
    [[wh51_ch11_sig]]
        extractor = last
    [[wh51_ch12_sig]]
        extractor = last
    [[wh51_ch13_sig]]
        extractor = last
    [[wh51_ch14_sig]]
        extractor = last
    [[wh51_ch15_sig]]
        extractor = last
    [[wh51_ch16_sig]]
        extractor = last
    [[wh55_ch1_sig]]
        extractor = last
    [[wh55_ch2_sig]]
        extractor = last
    [[wh55_ch3_sig]]
        extractor = last
    [[wh55_ch4_sig]]
        extractor = last
    [[wh57_sig]]
        extractor = last
    [[wh68_sig]]
        extractor = last
    [[ws80_sig]]
        extractor = last
