# See the Reactor documentation at https://reactor.toggledbits.com/docs/
# Template version 25329
#
# Try this browser-based YAML editor: https://onlineyamltools.com/edit-yaml
# Here's a quick YAML checker: https://www.yamlchecker.com/
---
reactor:
  # units - Set the measurement system: "imperial" or "metric" or "uk"
  #         (default: imperial). See "Getting Started" in docs for details and
  #         additional options.
  units: imperial
  #
  # location - Sets the location of your host system, for geo-specific calc-
  #            ulations.
  location:
    #
    # city - Name of your city
    city: "Peachtree City"
    #
    # state or province - If you are in USA, please use "state" and remove or
    #                     comment out "province"; otherwise, use "province"
    #                     and comment out or remove "state".
    state: "GA"  # two-letter US state abbreviation
    #province: ""  # province name (non-US only, optional)
    #
    # postal - Your postal code
    postal: "30269"
    #
    # country - Your two-character (ISO 3166-1 Alpha 2) country code.
    country: "US"
    #
    # latitude and - Your location latitude and longitude in decimal degrees.
    #   longitude    These are required for accurate sunrise/sunset times and
    #                related values.
    latitude: 33.400876
    longitude: -84.581101
    #
    # elevation - Optional, your elevation in METERS (regardless of "units"
    #             above, this value must be specified in meters). If your
    #             location is significantly above sea level, providing this
    #             will improve the accuracy of sunrise/sunset calculations.
    elevation: 0  # meters; optional
  #
  # baseurl - The base URL to access the Reactor system. If you want to use
  #           HTTPS, please see the How-To section of the docs. This only
  #           needs to be set in certain specific circumstances, which are
  #           documented. Do not uncomment/set this value unless you are
  #           given instructions to do so.
  #baseurl: "http://192.168.0.164:8111"
  #
  # allowed_ips - List (array) of IP addresses/prefixes allowed access.
  #               if empty (default, commented out), all IPs are allowed. If
  #               you wish to filter (recommended), uncomment the lines below
  #               and edit the addresses as needed to match your network.
  #allowed_ips:
  #  - "127.0.0.1"
  #  - "192.168.0."  # or whatever your local trusted subnet
  #

  engine:
    #
    # enabled - Whether or not the rules engine runs. Change only when directed.
    enabled: true
    #
    # allow_shell_action - The "Shell Command" reaction action comes with some security risks, so
    #                      by default it is disabled. To enable it, set this value true.
    #allow_shell_action: false
    #
    # shell_action_timeout - The "Shell Command" action will allow the running command to run for
    #                        up to this many milliseconds before it terminates it (to prevent run-
    #                        away processes). The default is 30000 (milliseconds, 30 seconds).
    #shell_action_timeout: 30000
    #
    # http_request_action_timeout - The system default timeout for HTTP request actions. The
    #                               default is 15000 milliseconds (15 seconds).
    #http_request_action_timeout: 15000

# If you have more than one of any type of controller, just copy the section for controller type
# and give it new (unique) "id". There is no limit on the number of controllers, and you can have
# any number of controllers of the same type/implementation, as long as they all have different IDs.
# Each controller type/implementation has its own documentation page that will give you config details.
controllers:
  - id: vera
    enabled: false
    implementation: VeraController
    name: A sample Vera or openLuup system
    config:
      source: 'http://192.168.0.60:3480'

  - id: hass
    enabled: false
    implementation: HassController
    name: A Home Assistant system
    config:
      source: 'ws://192.168.0.70:8123'
      access_token: "place long-lived access token within"
      #
      # ignore_cert - If true, suppresses certificate validation when using wss:// (Websocket
      #               with SSL/TLS) and thus allows a self-signed certificate to be used on
      #               the Hass system.
      #ignore_cert: false
      #
      # dump_all_states - This is for troubleshooting. Do not enable unless asked.
      #dump_all_states: false

  - id: hubitat
    enabled: false
    implementation: HubitatController
    name: A Hubitat Elevation system
    config:
      # Copy the entire URL from the Maker API app page on your Hubitat UI. A quick, easy way is to
      # right-click the "Get All Devices" link and choose "Copy link location", the paste it below.
      source: "http://192.168.0.30/apps/api/XXX/devices?access_token=00000000-0000-0000-0000-000000000000"
      #
      # dump_all_devices - This is for troubleshooting. Do not enable unless asked.
      dump_all_devices: false

  - id: groups
    enabled: true
    name: "Dynamic Group Controller"
    implementation: DynamicGroupController
    config:
      groups:
        "low_battery":
          select:
            - include_capability: battery_power
          filter_expression: >
            entity.attributes.battery_power.level < 0.35

  - id: virtual
    enabled: true
    name: "Virtual Entity Controller"
    implementation: VirtualEntityController
    config:
      # Configure a few virtual entities to give a new, empty system
      # something to play with. See the documentation for Template
      # types and full configuration instructions.
      entities:
        -
          id: 'A'
          name: Virtual Switch A
          template: Binary Switch
        -
          id: 'B'
          name: Virtual Switch B
          template: Binary Switch
        -
          id: 'C'
          name: Virtual Binary Sensor C
          template: Binary Sensor
        -
          id: 'D'
          name: Virtual Dimmer D
          template: Dimmer
        -
          id: 'E'
          template: Value Sensor
        -
          id: 'F'
          template: String Sensor

  - id: weather
    enabled: false
    implementation: OWMWeatherController
    name: OWM Weather
    config:
      # Place your OWM API key here (remember to enable the controller after adding your appid)
      appid: ""
      # How often weather is allowed to be refreshed. This helps limit OWN API use,
      # to keep you in their good graces (and on their free tier). This value is
      # in minutes.
      interval: 60

  # The Camera Controller is used to interface IP cameras. This is a nascent capability
  # that still needs much work, mostly functional on the dashboard for basic display,
  # but does not yet offer recording, replay, motion detection automations, etc.
  - id: cameras
    enabled: false
    implementation: CameraController
    name: Camera Controller

  # This SystemController instance should always be enabled. Do not remove this entry.
  # This controller publishes the system CPU and memory usage on its System entity
  # using the reactor_system capability.
  - id: reactor_system
    enable: true
    implementation: SystemController
    name: Reactor System
    config:
      #
      # The update_interval can be set lower for more frequent updates. The default is 60
      # seconds, which is probably fine for most cases, but causes the 15-second load av-
      # erage to be inaccurate (the first value in reactor_system.system_load). If you
      # don't care about the 15-second load average, then the default 60 seconds is fine.
      # This value is expressed in milliseconds.
      update_interval: 60000
      #
      # By default, this controller's default group is removed because it contains only
      # one entity. However, it is sometimes desirable to have the controller group be
      # available (e.g. for group navigation in the dashboard). If this value is set and
      # true, the controller's group will not be removed.
      #protect_controller_group: true
      #
      # The report_volumes array tells the SystemController which disk volumes to monitor.
      # If not specified, the Reactor base, data, and logs directories will be monitored
      # (whether these volumes are on the same or different volumes is installation-
      # dependent -- you can provide replacement configuration if you're not happy with
      # the defaults). Each array element is an object containing keys `id`, `path`, and
      # optionally `critical`. The `id` is a short identifier (alphanumeric only) for the
      # `path` (physical directory/mount point) that is to be monitored. The SystemController
      # will set a `reactor_system.volume_<id>` attribute with a four-element array con-
      # taining the free space in kilobytes, volume size in kilobytes, free percentage as
      # a fraction (e.g. 0.25 is 25%), and the path name (for verification/readability).
      # If the `critical` is key is specified, an additional boolean attribute
      # `reactor_system.volume_critical_<id>` will be created, and will be *true* if the
      # free space on the volume falls below this value. The value may be specified either
      # in integer kilobytes, or as a percentage (e.g. "10%").
      #report_volumes:
      #  - id: root
      #    path: /
      #    critical: 10%
      #  - id: home
      #    path: /home

plugins:
  - id: influx
    # See the docs under Standard Plugins for configuration details.
    implementation: InfluxFeed
    enabled: false
    name: InfluxDB Feed
    config:
      # InfluxDB 2.0 configuration -- for 1.8, please refer to the Reactor Documentation
      #
      # influx_url - URL to access InfluxDB server (default: http://localhost:8086)
      #influx_url: http://127.0.0.1:8086
      #
      # influx_token - Token from InfluxDB 2.0 UI (required)
      influx_token: "<your-influx-token>"
      #
      # influx_org - Organization ID (required)
      influx_org: "<your-influx-organization>"
      #
      # influx_bucket - Bucket name to which points are written (required)
      influx_bucket: "reactor"
      #
      # ----- Optional (all versions) -----
      # influx_retention_policy - Retention policy (optional). If not specified,
      #                           the retention policy of the bucket/database
      #                           will be used.
      #influx_retention_policy: ""
      #
      # ----- Filtering (all versions) -----
      # select_capabilities - Capabilities that should be exported in addition
      #                       to the defaults. These are key/value pairs. If the
      #                       value is false, the capability is not exported (so
      #                       you can override the default). If the value is an
      #                       object, it may contain an "attributes" key with an
      #                       array value containing the names of attributes to
      #                       be exported (other attributes in the capability
      #                       are ignored).
      #select_capabilities:
      #  power_switch: true    # export this capability (all attributes)
      #  zwave_network: false  # do not export this capability
      #  wx:                   # export wx capability, but only named attributes
      #    attributes:
      #      - temperature
      #      - humidity
      #
      # select_entities - If specified, limits the entities that are exported to
      #                   those that match any of the listed values. Will match
      #                   canonical ID or name, and patterns are available. See
      #                   the docs (under Standard Plugins).
      #select_entities:
      #  - weather>home
      #  - hubitat>76
      #  - "Living Room Dimmer"
      #
      #filter_entities - If specified, excludes matching entities from export.
      #                  Uses same matching method as select_entities. See the
      #                  docs.
      #filter_entities:
      #  - hass>input_select_demo
