diff --git a/configurations/homie/modules/home-assistant/default.nix b/configurations/homie/modules/home-assistant/default.nix index 7a9e76b6..d0517a00 100644 --- a/configurations/homie/modules/home-assistant/default.nix +++ b/configurations/homie/modules/home-assistant/default.nix @@ -8,6 +8,7 @@ ./bluetooth.nix ./firmware.nix ./frontend.nix + ./zigbee.nix ./netdaemon ./spotify diff --git a/configurations/homie/modules/home-assistant/frontend.nix b/configurations/homie/modules/home-assistant/frontend.nix index 6df9bdd2..1a6b558c 100644 --- a/configurations/homie/modules/home-assistant/frontend.nix +++ b/configurations/homie/modules/home-assistant/frontend.nix @@ -92,6 +92,7 @@ in { inherit (pkgs.home-assistant-custom-lovelace-modules) card-mod + light-entity-card universal-remote-card ; @@ -105,6 +106,7 @@ in { themes = "!include_dir_merge_named themes"; extra_module_url = map (p: "/local/nixos-lovelace-modules/${p}.js") [ "card-mod" + "light-entity-card" "custom-sidebar-yaml" ]; }; @@ -142,6 +144,34 @@ in { ]; } + { + type = "custom:light-entity-card"; + entity = "light.tz3210_katchgxy_ts0505b_light"; + + shorten_cards = false; + consolidate_entities = false; + child_card = false; + hide_header = false; + show_header_icon = false; + header = ""; + color_wheel = true; + persist_features = true; + brightness = true; + color_temp = true; + white_value = true; + color_picker = true; + speed = true; + intensity = false; + force_features = false; + show_slider_percent = true; + full_width_sliders = true; + brightness_icon = "weather-sunny"; + white_icon = "file-word-box"; + temperature_icon = "thermometer"; + speed_icon = "speedometer"; + intensity_icon = "transit-connection-horizontal"; + } + { type = "custom:android-tv-card"; diff --git a/configurations/homie/modules/home-assistant/zigbee.nix b/configurations/homie/modules/home-assistant/zigbee.nix new file mode 100644 index 00000000..4e836df9 --- /dev/null +++ b/configurations/homie/modules/home-assistant/zigbee.nix @@ -0,0 +1,51 @@ +{...}: let + zigbeeUser = "moskit"; +in { + services = { + home-assistant = { + extraComponents = [ + "mqtt" + "smlight" + "zha" + ]; + }; + + mosquitto = { + enable = true; + listeners = [ + { + acl = ["topic readwrite #"]; + port = 1883; + + settings.allow_anonymous = true; + + users."${zigbeeUser}".acl = ["readwrite #"]; + } + ]; + }; + + zigbee2mqtt = { + enable = true; + settings = { + serial = { + port = "tcp://192.168.0.129:6638"; + baudrate = 115200; + adapter = "zstack"; + disable_led = false; + }; + + mqtt = { + server = "mqtt://localhost/1883"; + user = zigbeeUser; + }; + + frontend = { + port = 8080; + host = "100.64.0.10"; + }; + + advanced.transmit_power = 20; + }; + }; + }; +}