infra/roles/hass-zigbee2mqtt/templates/configuration.yaml.j2

37 lines
1.1 KiB
Django/Jinja
Executable File

permit_join: false
homeassistant: true
mqtt:
base_topic: zigbee2mqtt
server: {{ hass_zigbee2mqtt_mqtt }}
keepalive: 60
include_device_information: true
serial:
{% if hass_ser2net_zigbee == true %}
port: tcp://{{ hass_ser2net_host.zigbee2mqtt }}:{{ hass_ser2net_port_zigbee }}
adapter: deconz
{% else %}
port: /dev/zigbee
adapter: deconz
{% endif %}
frontend:
port: 8633
url: https://{{ zwavejs_url }}/_zigbee/
{#
# enable the availability feature.
# each device defaults to 'availability: true' which should be enough to enable the feature, but it doesnt seem to work.
# https://www.zigbee2mqtt.io/guide/configuration/device-availability.html
#}
availability: true
{% if hass_zigbee2mqtt_network_key | length > 0 -%}
advanced:
network_key:
{% set network_key = hass_zigbee2mqtt_network_key | to_nice_yaml(indent=2) %}
{{ network_key | indent(4) | trim }}
log_level: warn
{{ {'devices': hass_zigbee2mqtt_devices} | to_nice_yaml(indent=2, sort_keys=false) | trim }}
{{ {'blocklist': hass_zigbee2mqtt_blocklist} | to_nice_yaml(indent=2) | indent(2) | trim }}
{% else -%}
advanced:
network_key: GENERATE
{% endif %}