From 9afd0ac2bdea1c2962b6b75cc52a10769524e8d7 Mon Sep 17 00:00:00 2001 From: arcnmx Date: Fri, 7 Oct 2022 09:24:44 -0700 Subject: [PATCH 1/4] fix: hass UI scripts --- nixos/systems/tewi/home-assistant.nix | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/nixos/systems/tewi/home-assistant.nix b/nixos/systems/tewi/home-assistant.nix index 5d426ad9..f30fb662 100644 --- a/nixos/systems/tewi/home-assistant.nix +++ b/nixos/systems/tewi/home-assistant.nix @@ -66,8 +66,8 @@ in { preStart = lib.mkBefore '' cp --no-preserve=mode ${config.secrets.files.home-assistant-secrets.path} ${config.services.home-assistant.configDir}/secrets.yaml cp --no-preserve=mode ${config.secrets.files.ha-integration.path} ${config.services.home-assistant.configDir}/integration.yaml - touch ${config.services.home-assistant.configDir}/automations.yaml - touch ${config.services.home-assistant.configDir}/scenes.yaml + # UI-editable config files + touch ${config.services.home-assistant.configDir}/{automations,scenes,scripts}.yaml ''; }; @@ -138,6 +138,7 @@ in { report_state = true; exposed_domains = [ "scene" + "script" "climate" #"sensor" ]; @@ -202,6 +203,8 @@ in { # https://nixos.wiki/wiki/Home_Assistant#Combine_declarative_and_UI_defined_scenes "scene manual" = []; "scene ui" = "!include scenes.yaml"; + "script manual" = []; + "script ui" = "!include scripts.yaml"; counter = {}; device_tracker = {}; energy = {}; @@ -219,7 +222,6 @@ in { mobile_app = {}; my = {}; person = {}; - script = {}; ssdp = {}; switch = {}; stream = {}; @@ -260,6 +262,7 @@ in { extraComponents = [ "automation" "scene" + "script" "zha" "esphome" "apple_tv" From dbef8e896d8ed874bf1c6e8e2031fbb44eb14441 Mon Sep 17 00:00:00 2001 From: arcnmx Date: Fri, 7 Oct 2022 09:26:01 -0700 Subject: [PATCH 2/4] fix: remove duplicate light clusters from HomeKit --- nixos/systems/tewi/home-assistant.nix | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/nixos/systems/tewi/home-assistant.nix b/nixos/systems/tewi/home-assistant.nix index f30fb662..407d18a1 100644 --- a/nixos/systems/tewi/home-assistant.nix +++ b/nixos/systems/tewi/home-assistant.nix @@ -184,9 +184,14 @@ in { ip_address = "10.1.1.38"; filter = let inherit (config.services.home-assistant.config) google_assistant; + entities = filterAttrs (_: entity: entity.expose or true) google_assistant.entity_config; in { include_domains = google_assistant.exposed_domains; - include_entities = attrNames (filterAttrs (_: entity: entity.expose or true) google_assistant.entity_config); + include_entities = attrNames (removeAttrs entities [ + # HomeKit is able to group lights together, no need to use the google hack here + "light.living_cluster" + "light.bedroom_overhead" + ]); }; entity_config = { "switch.swb1_relay_3".type = "outlet"; From 9bd12cf310f7cd8edd5dfc73d2f7fd7c1c5030da Mon Sep 17 00:00:00 2001 From: arcnmx Date: Fri, 7 Oct 2022 09:26:26 -0700 Subject: [PATCH 3/4] feat: track nue --- nixos/systems/tewi/home-assistant.nix | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/nixos/systems/tewi/home-assistant.nix b/nixos/systems/tewi/home-assistant.nix index 407d18a1..c24104d6 100644 --- a/nixos/systems/tewi/home-assistant.nix +++ b/nixos/systems/tewi/home-assistant.nix @@ -255,6 +255,10 @@ in { device_id = "name:galaxy-watch-active"; name = "Galaxy Watch Active"; }) + (mkESPresenceBeacon { + device_id = "3003c8383b6c"; + name = "Nue"; + }) ]; }; extraPackages = python3Packages: with python3Packages; [ From c266122a027a77da656801dc48114698a7daa6dc Mon Sep 17 00:00:00 2001 From: arcnmx Date: Fri, 7 Oct 2022 09:27:44 -0700 Subject: [PATCH 4/4] fix: add missing hass helpers --- nixos/systems/tewi/home-assistant.nix | 2 ++ 1 file changed, 2 insertions(+) diff --git a/nixos/systems/tewi/home-assistant.nix b/nixos/systems/tewi/home-assistant.nix index c24104d6..2cdd67d5 100644 --- a/nixos/systems/tewi/home-assistant.nix +++ b/nixos/systems/tewi/home-assistant.nix @@ -217,11 +217,13 @@ in { history = {}; image = {}; input_boolean = {}; + input_button = {}; input_datetime = {}; input_number = {}; input_select = {}; input_text = {}; logbook = {}; + schedule = {}; map = {}; media_source = {}; mobile_app = {};