2020-04-15 23:55:21 +02:00
|
|
|
{ pkgs, lib, config, ... }: {
|
2020-04-15 21:47:21 +02:00
|
|
|
imports = [
|
|
|
|
./mqtt.nix
|
2020-10-21 00:24:16 +02:00
|
|
|
./zigbee2mqtt/buttons.nix
|
2020-11-22 01:58:32 +01:00
|
|
|
./zigbee2mqtt/configurationHelper.nix
|
2020-10-21 00:24:16 +02:00
|
|
|
./zigbee2mqtt/doors.nix
|
2020-10-30 23:39:40 +01:00
|
|
|
./zigbee2mqtt/fyrtur.nix
|
2020-10-30 00:36:00 +01:00
|
|
|
./zigbee2mqtt/heater.nix
|
2020-10-21 00:24:16 +02:00
|
|
|
./zigbee2mqtt/leds.nix
|
2020-04-15 21:47:21 +02:00
|
|
|
./zigbee2mqtt/lights.nix
|
|
|
|
./zigbee2mqtt/motion.nix
|
2020-10-30 00:36:00 +01:00
|
|
|
./zigbee2mqtt/repeater.nix
|
2020-04-15 23:55:21 +02:00
|
|
|
./zigbee2mqtt/temperatur.nix
|
2020-04-15 21:47:21 +02:00
|
|
|
];
|
|
|
|
|
2020-11-22 01:58:32 +01:00
|
|
|
#services.zigbee2mqtt = {
|
|
|
|
# enable = true;
|
|
|
|
# mqttPassword = lib.fileContents <secrets/zigbee/password>;
|
|
|
|
# networkKey = import <secrets/home-assistant/zigbee/networkKey>;
|
|
|
|
# # only turn on for new devices, usually turn of for security reasons.
|
|
|
|
# discover = true;
|
|
|
|
#};
|
|
|
|
|
|
|
|
# new
|
2020-05-09 16:43:47 +02:00
|
|
|
services.zigbee2mqtt = {
|
|
|
|
enable = true;
|
2020-11-22 01:58:32 +01:00
|
|
|
config = {
|
|
|
|
|
|
|
|
# Home Assistant integration (MQTT discovery)
|
|
|
|
homeassistant = false;
|
|
|
|
|
|
|
|
# allow new devices to join
|
|
|
|
permit_join = true;
|
|
|
|
|
|
|
|
# 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 <secrets/zigbee/password>;
|
|
|
|
};
|
|
|
|
|
|
|
|
# Serial settings
|
|
|
|
serial = {
|
|
|
|
port = "/dev/ttyACM0";
|
|
|
|
# disable LED of CC2531 USB sniffer
|
|
|
|
disable_led = true;
|
|
|
|
};
|
|
|
|
|
|
|
|
# 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 <secrets/home-assistant/zigbee/networkKey>;
|
|
|
|
|
|
|
|
# todo : devices should be defined later
|
|
|
|
#devices = cfg.devices;
|
|
|
|
|
|
|
|
};
|
2020-05-09 16:43:47 +02:00
|
|
|
};
|
2020-04-08 16:43:09 +02:00
|
|
|
|
|
|
|
}
|