#
# IMPORTANT NOTE
#
# This chart inherits from our common library chart. You can check the default values/options here:
# https://github.com/k8s-at-home/library-charts/tree/main/charts/stable/common/values.yaml
#

image:
  # -- image repository
  repository: koenkk/zigbee2mqtt
  # -- image tag
  tag: 1.19.1
  # -- image pull policy
  pullPolicy: IfNotPresent

# -- environment variables. See [image docs](https://www.zigbee2mqtt.io/information/configuration.html#override-via-environment-variables) for more details.
# @default -- See below
env:
  # -- Set the data folder for Zigbee2MQTT.
  ZIGBEE2MQTT_DATA: /data

# -- Configures service settings for the chart. Normally this does not need to be modified.
# @default -- See values.yaml
service:
  main:
    ports:
      http:
        port: 8080

ingress:
  # -- Enable and configure ingress settings for the chart under this key.
  # @default -- See values.yaml
  main:
    enabled: false

securityContext:
  # -- (bool) Privileged securityContext may be required if USB controller is accessed directly through the host machine
  privileged:  # true

# -- Configure persistence settings for the chart under this key.
# @default -- See values.yaml
persistence:
  data:
    enabled: false
    mountPath: /data
  # -- Configure a hostPathMount to mount a USB device in the container.
  # @default -- See values.yaml
  usb:
    enabled: false
    type: hostPath
    hostPath: /dev/serial/by-id/usb-dresden_elektronik_ingenieurtechnik_GmbH_ConBee_II_DE2400981-if00

# -- Affinity constraint rules to place the Pod on a specific node.
# [[ref]](https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#affinity-and-anti-affinity)
affinity: {}
#   nodeAffinity:
#     requiredDuringSchedulingIgnoredDuringExecution:
#       nodeSelectorTerms:
#       - matchExpressions:
#         - key: app
#           operator: In
#           values:
#           - zigbee-controller

# -- zigbee2mqtt configuration settings.
# This will be copied into the container's persistent storage at first run only.
# Further configuration should be done in the application itself!
# See [project documentation](https://www.zigbee2mqtt.io/information/configuration.html) for more information.
# @default -- See values.yaml
config:
  # These will be applied ONLY on first run
  # Home Assistant integration (MQTT discovery)
  homeassistant: false

  # allow new devices to join
  # WARNING: Disable this after all devices have been paired! (default: false)
  # Note: this will be controllable in the UI
  permit_join: true

  # MQTT settings
  mqtt:
    # MQTT base topic for zigbee2mqtt MQTT messages
    base_topic: zigbee2mqtt
    # MQTT server URL
    server: "mqtt://localhost"
    # MQTT server authentication, uncomment if required:
    # user: my_user
    # password: my_password
    # client_id: my_id
    # Alternatively, credentials may be put into a separate file, managed through a secret:
    # password: '!secret password'

    # Optional: Include device information to mqtt messages (default: false)
    include_device_information: true

  # USB / Serial settings
  serial:
    # Location of your zigbee device
    # port: /dev/serial/by-id/usb-dresden_elektronik_ingenieurtechnik_GmbH_ConBee_II_DE2400981-if00

    # Optional: adapter type, not needed unless you are experiencing problems (options: zstack, deconz)
    # adapter: deconz

  advanced:
    network_key: GENERATE
    log_output:
      - console
    log_level: info

    # Optional: ZigBee channel, changing requires re-pairing of all devices. (Note: use a ZLL channel: 11, 15, 20, or 25 to avoid Problems)
    # default: 11
    # channel: 11

    # Optional: Baudrate for serial port (default: 115200 for Z-Stack, 38400 for Deconz)
    # baudrate: 38400

    # Optional: RTS / CTS Hardware Flow Control for serial port (default: false)
    # rtscts: true

    # Optional: Add a last_seen attribute to MQTT messages, contains date/time of last Zigbee message
    # possible values are: disable (default), ISO_8601, ISO_8601_local, epoch (default: disable)
    last_seen: 'ISO_8601'

    homeassistant_discovery_topic: 'homeassistant'
    homeassistant_status_topic: 'homeassistant/status'

    # Optional: Enables report feature (see information -> report for more details) (default: false)
    # report: true

    # Optional: Add an elapsed attribute to MQTT messages, contains milliseconds since the previous msg (default: false)
    # elapsed: true

  # Both of these need to be enabled for the webui
  frontend:
    port: 8080
  experimental:
    new_api: true
