Use home-assistant from latest, move zigbee2mqtt port to 8081
This commit is contained in:
parent
e44fad0057
commit
b5118aa1d4
|
@ -3,15 +3,22 @@
|
|||
config,
|
||||
options,
|
||||
pkgs,
|
||||
inputs,
|
||||
...
|
||||
}:
|
||||
with lib; let
|
||||
cfg = config.pub-solar.home-assistant;
|
||||
unstable = import <nixos-unstable> {};
|
||||
in {
|
||||
imports = [
|
||||
./home-assistant.nix
|
||||
./mqtt.nix
|
||||
./zigbee.nix
|
||||
(inputs.latest + "/nixos/modules/services/home-automation/home-assistant.nix")
|
||||
];
|
||||
|
||||
disabledModules = [
|
||||
"services/home-automation/home-assistant.nix"
|
||||
];
|
||||
|
||||
options.pub-solar.home-assistant = {
|
||||
|
|
|
@ -8,6 +8,8 @@ with lib; let
|
|||
cfg = config.pub-solar.home-assistant;
|
||||
in {
|
||||
config = mkIf cfg.enable {
|
||||
networking.firewall.allowedUDPPorts = [1900];
|
||||
|
||||
services.home-assistant = {
|
||||
enable = true;
|
||||
openFirewall = true;
|
||||
|
|
|
@ -10,17 +10,21 @@ with lib; let
|
|||
in {
|
||||
config = mkIf (haCfg.enable && cfg.enable) {
|
||||
networking.firewall.allowedTCPPorts = [
|
||||
8080 # zigbee2mqtt
|
||||
8081 # zigbee2mqtt
|
||||
];
|
||||
|
||||
#services.udev.extraRules = ''KERNEL=="${cfg.device}", OWNER="zigbee2mqtt", GROUP="zigbee2mqtt"'';
|
||||
|
||||
services.zigbee2mqtt = {
|
||||
enable = true;
|
||||
settings = {
|
||||
frontend = true;
|
||||
frontend = {
|
||||
port = 8081;
|
||||
};
|
||||
permit_join = false;
|
||||
homeassistant = true;
|
||||
availability = true;
|
||||
advanced = {
|
||||
legacy_availability_payload = false;
|
||||
};
|
||||
mqtt = {
|
||||
user = "z2m";
|
||||
password = "!secrets.yaml mqtt_password";
|
||||
|
@ -29,6 +33,7 @@ in {
|
|||
port = cfg.device;
|
||||
adapter = mkIf (cfg.adapter != null) cfg.adapter;
|
||||
};
|
||||
groups = "groups.yaml";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue