aboutsummaryrefslogtreecommitdiff
path: root/nixos
diff options
context:
space:
mode:
Diffstat (limited to 'nixos')
-rw-r--r--nixos/machine/errol.nix28
-rw-r--r--nixos/modules/home-assistant.nix19
2 files changed, 42 insertions, 5 deletions
diff --git a/nixos/machine/errol.nix b/nixos/machine/errol.nix
index 8609956..74901f9 100644
--- a/nixos/machine/errol.nix
+++ b/nixos/machine/errol.nix
@@ -86,6 +86,7 @@ with lib; {
};
met = {};
default_config = {};
+ automation = "!include automations.yaml";
};
extraComponents = [];
package = pkgs.home-assistant.override {
@@ -95,5 +96,32 @@ with lib; {
];
};
};
+
+ services.zigbee2mqtt = {
+ enable = true;
+ settings = {
+ serial.port = "/dev/serial/by-id/usb-ITEAD_SONOFF_Zigbee_3.0_USB_Dongle_Plus_V2_20220812153849-if00";
+ mqtt = {
+ server = "mqtt://${config.cynerd.hosts.spt.mox}:1883";
+ user = "zigbee2mqtt";
+ password = "!secret.yaml mqtt_password";
+ };
+ advanced = {
+ network_key = "!secret.yaml network_key";
+ homeassistant_legacy_entity_attributes = false;
+ legacy_api = false;
+ legacy_availability_payload = false;
+ last_seen = "epoch";
+ };
+ frontend = true;
+ availability = true;
+ homeassistant = {
+ legacy_triggers = false;
+ };
+ device_options.legacy = false;
+ permit_join = false;
+ devices = config.secrets.zigbee2mqttDevices;
+ };
+ };
};
}
diff --git a/nixos/modules/home-assistant.nix b/nixos/modules/home-assistant.nix
index 0aac9be..545cec8 100644
--- a/nixos/modules/home-assistant.nix
+++ b/nixos/modules/home-assistant.nix
@@ -21,21 +21,29 @@ in {
acl = ["readwrite #"];
passwordFile = "/run/secrets/mosquitto.cynerd.pass";
};
- bigclown = {
- acl = ["readwrite bigclown/#"];
- passwordFile = "/run/secrets/mosquitto.bigclown.pass";
- };
telegraf = {
acl = ["read bigclown/node/#"];
passwordFile = "/run/secrets/mosquitto.telegraf.pass";
};
homeassistant = {
acl = [
- "readwrite bigclown/#"
"readwrite homeassistant/#"
+ "readwrite bigclown/#"
+ "readwrite zigbee2mqtt/#"
];
passwordFile = "/run/secrets/mosquitto.homeassistant.pass";
};
+ bigclown = {
+ acl = ["readwrite bigclown/#"];
+ passwordFile = "/run/secrets/mosquitto.bigclown.pass";
+ };
+ zigbee2mqtt = {
+ acl = [
+ "readwrite homeassistant/#"
+ "readwrite zigbee2mqtt/#"
+ ];
+ passwordFile = "/run/secrets/mosquitto.zigbee2mqtt.pass";
+ };
};
}
];
@@ -137,6 +145,7 @@ in {
};
met = {};
default_config = {};
+ automation = "!include automations.yaml";
};
extraComponents = [];
package = pkgs.home-assistant.override {