Use home-assistant from latest, move zigbee2mqtt port to 8081

This commit is contained in:
Hendrik Sokolowski 2023-10-01 22:20:38 +02:00
parent e44fad0057
commit b5118aa1d4
3 changed files with 18 additions and 4 deletions

View file

@ -3,15 +3,22 @@
config, config,
options, options,
pkgs, pkgs,
inputs,
... ...
}: }:
with lib; let with lib; let
cfg = config.pub-solar.home-assistant; cfg = config.pub-solar.home-assistant;
unstable = import <nixos-unstable> {};
in { in {
imports = [ imports = [
./home-assistant.nix ./home-assistant.nix
./mqtt.nix ./mqtt.nix
./zigbee.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 = { options.pub-solar.home-assistant = {

View file

@ -8,6 +8,8 @@ with lib; let
cfg = config.pub-solar.home-assistant; cfg = config.pub-solar.home-assistant;
in { in {
config = mkIf cfg.enable { config = mkIf cfg.enable {
networking.firewall.allowedUDPPorts = [1900];
services.home-assistant = { services.home-assistant = {
enable = true; enable = true;
openFirewall = true; openFirewall = true;

View file

@ -10,17 +10,21 @@ with lib; let
in { in {
config = mkIf (haCfg.enable && cfg.enable) { config = mkIf (haCfg.enable && cfg.enable) {
networking.firewall.allowedTCPPorts = [ networking.firewall.allowedTCPPorts = [
8080 # zigbee2mqtt 8081 # zigbee2mqtt
]; ];
#services.udev.extraRules = ''KERNEL=="${cfg.device}", OWNER="zigbee2mqtt", GROUP="zigbee2mqtt"'';
services.zigbee2mqtt = { services.zigbee2mqtt = {
enable = true; enable = true;
settings = { settings = {
frontend = true; frontend = {
port = 8081;
};
permit_join = false; permit_join = false;
homeassistant = true; homeassistant = true;
availability = true;
advanced = {
legacy_availability_payload = false;
};
mqtt = { mqtt = {
user = "z2m"; user = "z2m";
password = "!secrets.yaml mqtt_password"; password = "!secrets.yaml mqtt_password";
@ -29,6 +33,7 @@ in {
port = cfg.device; port = cfg.device;
adapter = mkIf (cfg.adapter != null) cfg.adapter; adapter = mkIf (cfg.adapter != null) cfg.adapter;
}; };
groups = "groups.yaml";
}; };
}; };
}; };