# Bayou Radar Skywarn 0.2.0
# Bayou Radar is the primary weather-alert service. The direct NWS API is used
# only when the Bayou Radar request for a monitored area fails validation,
# times out, or otherwise cannot be completed.

app:
  enabled: true
  poll_seconds: 30
  startup_quiet: true
  state_db: /var/lib/bayouradar-skywarn/state.db
  runtime_dir: /run/bayouradar-skywarn
  log_level: INFO

data_sources:
  primary: bayou_radar
  fallback: nws
  fallback_enabled: true

bayou_radar:
  api_base: https://backend.bayouradar.com
  point_endpoint: /api/alerts
  bbox_endpoint: /api/alerts/active
  health_endpoint: /api/health
  user_agent: BayouRadarSkywarn/0.2.0
  timeout_seconds: 12
  retries: 2
  include_zones: true
  # Optional private deployment headers or bearer token. Public Bayou Radar
  # endpoints normally leave these empty.
  headers: {}
  api_token: ""

# A county UGC code is required for direct NWS fallback and alert matching.
# A Bayou Radar bounding box is preferred for county-wide coverage. A single
# latitude/longitude can instead monitor the repeater's exact location.
areas:
  - code: LAC019
    name: Calcasieu Parish
    bbox:
      west: -93.765851
      south: 30.038041
      east: -92.887222
      north: 30.490523
    # Point-mode alternative:
    # latitude: 30.2293504
    # longitude: -93.3579244

nws:
  api_base: https://api.weather.gov
  user_agent: "(BayouRadarSkywarn/0.2.0, admin@example.com)"
  timeout_seconds: 15
  retries: 2
  # effective announces when the alert is published; onset waits for onset time.
  time_basis: effective
  include_events: []
  exclude_events:
    - Test

asterisk:
  enabled: true
  binary: /usr/sbin/asterisk
  nodes:
    - "1999"
  playback_command:
    - "{binary}"
    - "-rx"
    - "rpt localplay {node} {audio_base}"

audio:
  enabled: true
  # espeak works fully offline. Piper provides higher-quality local speech when installed.
  engine: espeak
  voice: en-us
  rate: 155
  piper_model: ""
  custom_command: []
  ffmpeg_binary: /usr/bin/ffmpeg
  # Optional silence before each announcement, useful for keyed transmitters.
  delay_ms: 350
  keep_generated: false

announcements:
  say_new: true
  say_updates: true
  say_clear: true
  say_all_clear: true
  include_areas: true
  include_expiration: true
  max_description_chars: 850
  include_events: []
  exclude_events: []
  say_all_active_on_change: false
  new_prefix_audio: []
  update_prefix_audio: []
  clear_prefix_audio: []
  suffix_audio: []

tail_message:
  enabled: true
  path: /run/bayouradar-skywarn/wx-tail
  include_events: []
  exclude_events: []
  prefix_audio: []
  suffix_audio: []

courtesy_tones:
  enabled: false
  trigger_events:
    - "*Warning"
  files: {}
  # files:
  #   /var/lib/asterisk/sounds/tones/ct1.ulaw:
  #     normal: /opt/bayouradar-skywarn/audio/tones/normal-ct1.ulaw
  #     weather: /opt/bayouradar-skywarn/audio/tones/weather-ct1.ulaw

id_change:
  enabled: false
  trigger_events:
    - "*Warning"
  normal: /opt/bayouradar-skywarn/audio/ids/normal.ulaw
  weather: /opt/bayouradar-skywarn/audio/ids/weather.ulaw
  target: /var/lib/asterisk/sounds/rpt-id.ulaw

actions:
  enabled: false
  active_commands: []
  inactive_commands: []
  mappings:
    - name: tornado-response
      triggers:
        - Tornado Warning
      match: ANY
      on_active: []
      on_clear: []
      # DTMF example:
      # on_active:
      #   - type: dtmf
      #     nodes: ["1999"]
      #     commands: ["*123"]
      # Shell example:
      # on_clear:
      #   - type: shell
      #     command: /usr/local/sbin/weather-all-clear

notifications:
  pushover:
    enabled: false
    user_key: ""
    api_token: ""

supermon:
  enabled: true
  warnings_path: /tmp/AUTOSKY/warnings.txt

web:
  enabled: true
  bind: 127.0.0.1
  port: 8765

testing:
  inject: false
  alerts:
    - event: Tornado Warning
      area_desc: Calcasieu Parish
      areas: [LAC019]
      description: A severe thunderstorm capable of producing a tornado was located in the test area.
      instruction: Move to an interior room on the lowest floor of a sturdy building.
