nixos-config/nixos/machines/chungus/hass-zigbee2mqtt.nix

57 lines
1.4 KiB
Nix
Raw Normal View History

2023-05-05 22:33:05 +02:00
{ pkgs, lib, config, private_assets, ... }:
{
imports = [ ./hass-mqtt.nix ];
services.zigbee2mqtt = {
enable = true;
dataDir = "/srv2/zigbee2mqtt";
2023-05-05 22:33:05 +02:00
settings = {
# Home Assistant integration (MQTT discovery)
homeassistant = true;
# allow new devices to join
permit_join = false;
# MQTT settings
mqtt = {
# MQTT base topic for zigbee2mqtt MQTT messages
base_topic = "zigbee2mqtt";
# MQTT server URL
server = "mqtt://127.0.0.1:1883";
# MQTT server authentication, uncomment if required:
user = "zigbee";
password = lib.fileContents "${private_assets}/zigbee/home-assistant-password";
};
# Serial settings
serial = {
#port = "/dev/ttyACM0";
port = "/dev/ttyUSB0";
# disable LED of CC2531 USB sniffer
2023-05-12 23:47:19 +02:00
disable_led = true;
2023-05-05 22:33:05 +02:00
};
# you own network key,
# 16 numbers between 0 and 255
# see https://www.zigbee2mqtt.io/how_tos/how_to_secure_network.html
advanced = {
network_key = import "${private_assets}/zigbee/networkKey.nix";
log_output = [ "console" ];
log_level = "warn";
pan_id = 1337;
# add last seen information
last_seen = "ISO_8601_local";
};
# configure web ui
frontend.port = 9666;
frontend.host = "0.0.0.0";
experimental.new_api = true;
};
};
}