2020-04-21 12:21:17 +00:00
|
|
|
{config, pkgs, lib, ...}: let
|
|
|
|
|
2020-12-24 21:00:21 +00:00
|
|
|
unstable-pkgs = import <nixpkgs-unstable> {};
|
2020-04-21 12:21:17 +00:00
|
|
|
|
|
|
|
in {
|
|
|
|
# symlink the zigbee controller
|
|
|
|
services.udev.extraRules = ''
|
2020-12-24 21:00:21 +00:00
|
|
|
SUBSYSTEM=="tty", ATTRS{idVendor}=="0451", ATTRS{idProduct}=="16a8", SYMLINK+="cc2531", MODE="0660", GROUP="dialout"
|
|
|
|
SUBSYSTEM=="tty", ATTRS{idVendor}=="10c4", ATTRS{idProduct}=="ea60", SYMLINK+="cc2652", MODE="0660", GROUP="dialout"
|
2020-04-21 12:21:17 +00:00
|
|
|
'';
|
|
|
|
|
2020-12-24 21:00:21 +00:00
|
|
|
# needed to use unstable package
|
|
|
|
systemd.services.zigbee2mqtt.environment.ZIGBEE2MQTT_DATA = "/var/lib/zigbee2mqtt";
|
2020-04-21 12:21:17 +00:00
|
|
|
|
2020-12-24 21:00:21 +00:00
|
|
|
services.zigbee2mqtt = {
|
|
|
|
enable = true;
|
|
|
|
package = unstable-pkgs.zigbee2mqtt;
|
2022-01-28 13:18:38 +00:00
|
|
|
settings = {
|
2020-12-24 21:00:21 +00:00
|
|
|
homeassistant = true;
|
|
|
|
frontend.port = 1337;
|
|
|
|
experimental.new_api = true;
|
|
|
|
permit_join = false;
|
|
|
|
mqtt = {
|
|
|
|
discovery = true;
|
|
|
|
base_topic = "zigbee";
|
|
|
|
server = "mqtt://10.42.0.1";
|
|
|
|
user = "gg23";
|
|
|
|
password = "gg23-mqtt";
|
|
|
|
};
|
|
|
|
serial = {
|
|
|
|
port = "/dev/cc2652";
|
|
|
|
# disable_led = true;
|
|
|
|
};
|
|
|
|
advanced = {
|
|
|
|
pan_id = 4222;
|
|
|
|
};
|
2023-07-23 21:08:27 +00:00
|
|
|
devices = let
|
|
|
|
set_device = id: name:
|
|
|
|
lib.nameValuePair id {
|
|
|
|
};
|
|
|
|
in {
|
|
|
|
# lights https://www.zigbee2mqtt.io/devices/9290022166.html#philips-9290022166
|
|
|
|
"0x0017880106ed3bd8".friendly_name = "l_bett";
|
|
|
|
"0x0017880108327622".friendly_name = "l_essen";
|
|
|
|
"0x0017880106ee2865".friendly_name = "l_arbeit";
|
|
|
|
"0x00178801082e9f2f".friendly_name = "l_nass";
|
2020-04-21 12:21:17 +00:00
|
|
|
|
2023-07-23 21:08:27 +00:00
|
|
|
# switches https://www.zigbee2mqtt.io/devices/324131092621.html#philips-324131092621
|
|
|
|
"0x00178801086ac38c".friendly_name = "i_bett";
|
|
|
|
"0x00178801086ad1fb".friendly_name = "i_essen";
|
|
|
|
"0x00178801086ac373".friendly_name = "i_nass";
|
|
|
|
|
|
|
|
# sensors https://www.zigbee2mqtt.io/devices/9290012607.html#philips-9290012607
|
|
|
|
"0x0017880106f772f2".friendly_name = "s_essen";
|
|
|
|
"0x0017880106f77f30".friendly_name = "s_nass";
|
|
|
|
|
|
|
|
# heat https://www.zigbee2mqtt.io/devices/701721.html#popp-701721
|
|
|
|
"0x842e14fffe27109a".friendly_name = "t_bett";
|
|
|
|
"0x842e14fffe269a73".friendly_name = "t_nass";
|
|
|
|
"0x842e14fffe269a56".friendly_name = "t_arbeit";
|
|
|
|
|
|
|
|
# rotation https://www.zigbee2mqtt.io/devices/E1744.html
|
|
|
|
"0x8cf681fffe065493" = {
|
|
|
|
friendly_name = "r_test";
|
|
|
|
device_id = "r_test";
|
|
|
|
simulated_brightness = {
|
|
|
|
delta = 2;
|
|
|
|
interval = 100;
|
|
|
|
};
|
2020-04-21 12:21:17 +00:00
|
|
|
};
|
|
|
|
|
2023-07-23 21:08:27 +00:00
|
|
|
};
|
2020-04-21 12:21:17 +00:00
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|