summaryrefslogtreecommitdiffstats
path: root/lass/2configs/hass
diff options
context:
space:
mode:
Diffstat (limited to 'lass/2configs/hass')
-rw-r--r--lass/2configs/hass/default.nix2
-rw-r--r--lass/2configs/hass/rooms/bett.nix62
-rw-r--r--lass/2configs/hass/rooms/essen.nix2
-rw-r--r--lass/2configs/hass/rooms/nass.nix2
-rw-r--r--lass/2configs/hass/zigbee.nix58
5 files changed, 63 insertions, 63 deletions
diff --git a/lass/2configs/hass/default.nix b/lass/2configs/hass/default.nix
index 66d430cd1..78379ba1c 100644
--- a/lass/2configs/hass/default.nix
+++ b/lass/2configs/hass/default.nix
@@ -26,7 +26,7 @@ with import ./lib.nix { inherit lib; };
lovelaceConfigWritable = true;
};
- lass.hass.config = let
+ services.home-assistant.config = let
tasmota_s20 = name: topic: {
platform = "mqtt";
inherit name;
diff --git a/lass/2configs/hass/rooms/bett.nix b/lass/2configs/hass/rooms/bett.nix
index 16227fcb6..48a1f72d7 100644
--- a/lass/2configs/hass/rooms/bett.nix
+++ b/lass/2configs/hass/rooms/bett.nix
@@ -2,38 +2,38 @@
with import ../lib.nix { inherit lib; };
{
- lass.hass.config = lib.mkMerge [
+ services.home-assistant.config = lib.mkMerge [
(lightswitch switches.dimmer.bett lights.bett)
];
- lass.hass.love = {
- resources = [{
- url = "https://raw.githubusercontent.com/ljmerza/light-entity-card/master/dist/light-entity-card.js.map";
- type = "js";
- }];
- views = [{
- title = "bett";
- cards = [
- {
- type = "markdown";
- title = "hello world";
- content = "This is just a test";
- }
- {
- type = "light";
- entity = "light.${lights.bett}";
- }
- {
- type = "custom:light-entity-card";
- entity = "light.${lights.bett}";
- }
- {
- type = "history-graph";
- entities = [
- "light.${lights.bett}"
- ];
- }
- ];
- }];
- };
+ # lass.hass.love = {
+ # resources = [{
+ # url = "https://raw.githubusercontent.com/ljmerza/light-entity-card/master/dist/light-entity-card.js.map";
+ # type = "js";
+ # }];
+ # views = [{
+ # title = "bett";
+ # cards = [
+ # {
+ # type = "markdown";
+ # title = "hello world";
+ # content = "This is just a test";
+ # }
+ # {
+ # type = "light";
+ # entity = "light.${lights.bett}";
+ # }
+ # {
+ # type = "custom:light-entity-card";
+ # entity = "light.${lights.bett}";
+ # }
+ # {
+ # type = "history-graph";
+ # entities = [
+ # "light.${lights.bett}"
+ # ];
+ # }
+ # ];
+ # }];
+ # };
}
diff --git a/lass/2configs/hass/rooms/essen.nix b/lass/2configs/hass/rooms/essen.nix
index f74996154..eeb3d30d2 100644
--- a/lass/2configs/hass/rooms/essen.nix
+++ b/lass/2configs/hass/rooms/essen.nix
@@ -2,7 +2,7 @@
with import ../lib.nix { inherit lib; };
{
- lass.hass.config = lib.mkMerge [
+ services.home-assistant.config = lib.mkMerge [
(detect_movement sensors.movement.essen lights.essen 10)
(lightswitch switches.dimmer.essen lights.essen)
];
diff --git a/lass/2configs/hass/rooms/nass.nix b/lass/2configs/hass/rooms/nass.nix
index 163f4fc48..7e6298738 100644
--- a/lass/2configs/hass/rooms/nass.nix
+++ b/lass/2configs/hass/rooms/nass.nix
@@ -2,7 +2,7 @@
with import ../lib.nix { inherit lib; };
{
- lass.hass.config = lib.mkMerge [
+ services.home-assistant.config = lib.mkMerge [
(detect_movement sensors.movement.nass lights.nass 100)
(lightswitch switches.dimmer.nass lights.nass)
];
diff --git a/lass/2configs/hass/zigbee.nix b/lass/2configs/hass/zigbee.nix
index 6d091066e..789a7fb92 100644
--- a/lass/2configs/hass/zigbee.nix
+++ b/lass/2configs/hass/zigbee.nix
@@ -1,41 +1,43 @@
{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;
+ };
+ };
};
- lass.hass.config = {
+ services.home-assistant.config = {
sensor = [
# Sensor for monitoring the bridge state
{
@@ -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";