diff options
author | lassulus <lassulus@lassul.us> | 2020-12-24 22:00:21 +0100 |
---|---|---|
committer | lassulus <lassulus@lassul.us> | 2020-12-24 22:00:21 +0100 |
commit | 2cbed4cab9bf40fa6d712375b740bfcd41503470 (patch) | |
tree | 016f8ea0584e871b1326ff6aa90cab39f1fe2c6e /lass/2configs | |
parent | 4fcf00d9bb7a8417f6f4028a8eaaa616ad28a166 (diff) |
l hass zigbee: update with new adapter
Diffstat (limited to 'lass/2configs')
-rw-r--r-- | lass/2configs/hass/zigbee.nix | 56 |
1 files changed, 28 insertions, 28 deletions
diff --git a/lass/2configs/hass/zigbee.nix b/lass/2configs/hass/zigbee.nix index b2a221e49..789a7fb92 100644 --- a/lass/2configs/hass/zigbee.nix +++ b/lass/2configs/hass/zigbee.nix @@ -1,38 +1,40 @@ {config, pkgs, lib, ...}: let - zigbee2mqtt_cfg = pkgs.writeText "zigbee2mqtt.json" (builtins.toJSON { - homeassistant = true; - permit_join = false; - mqtt = { - discovery = true; - base_topic = "zigbee"; - server = "mqtt://10.42.0.1"; - user = "gg23"; - password = "gg23-mqtt"; - }; - serial.port = "/dev/cc2531"; - }); + unstable-pkgs = import <nixpkgs-unstable> {}; in { # symlink the zigbee controller services.udev.extraRules = '' - SUBSYSTEM=="tty", ATTRS{idVendor}=="0451", ATTRS{idProduct}=="16a8", SYMLINK+="cc2531", MODE="0660", GROUP="dailout" - ''; - - system.activationScripts.installZigbee = '' - install -d /var/lib/zigbee2mqtt - install ${zigbee2mqtt_cfg} /var/lib/zigbee2mqtt/configuration.yaml + 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" ''; - # hack to restart docker container on config change - systemd.services.docker-zigbee2mqtt.environment.cfg = zigbee2mqtt_cfg; + # needed to use unstable package + systemd.services.zigbee2mqtt.environment.ZIGBEE2MQTT_DATA = "/var/lib/zigbee2mqtt"; - docker-containers.zigbee2mqtt = { - image = "koenkk/zigbee2mqtt"; - extraDockerOptions = [ - "--device=/dev/cc2531:/dev/cc2531" - ]; - volumes = ["/var/lib/zigbee2mqtt:/app/data"]; + services.zigbee2mqtt = { + enable = true; + package = unstable-pkgs.zigbee2mqtt; + config = { + 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; + }; + }; }; services.home-assistant.config = { @@ -93,7 +95,6 @@ in { { id = "zigbee_join_enabled"; alias = ""; - hide_entity = "true"; trigger = { platform = "state"; entity_id = "switch.zigbee2mqtt_join"; @@ -107,7 +108,6 @@ in { # Automation to stop timer when switch turned off and turn off switch when timer finished { id = "zigbee_join_disabled"; - hide_entity = "true"; trigger = [ { platform = "event"; |