From d40a3845710cfa49f240e17520d443125cabb0df Mon Sep 17 00:00:00 2001 From: arcnmx Date: Wed, 5 Oct 2022 14:18:39 -0700 Subject: [PATCH 1/2] chore: google assistant hass configuration --- nixos/systems/tewi/home-assistant.nix | 41 +++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) diff --git a/nixos/systems/tewi/home-assistant.nix b/nixos/systems/tewi/home-assistant.nix index 1585f916..a0a6cfc1 100644 --- a/nixos/systems/tewi/home-assistant.nix +++ b/nixos/systems/tewi/home-assistant.nix @@ -133,6 +133,47 @@ google_assistant = { project_id = "gensokyo-5cfaf"; service_account = "!include integration.yaml"; + report_state = true; + exposed_domains = [ + "scene" + "climate" + #"sensor" + ]; + entity_config = let + hidden = "XYZ"; + in { + # bedroom entities + "light.bedside_lamp".expose = true; + "light.bedroom_strip".expose = true; + "light.bedroom_overhead".expose = true; + "light.bed_side_overhead".room = hidden; + "light.closet_side_overhead".room = hidden; + "light.pc_side_overhead".room = hidden; + "fan.fornuftig_fan".expose = true; + "switch.swb1_relay_3".expose = true; + "switch.swb1_relay_4".expose = true; + + # living room entities + "light.dining_overhead".expose = true; + "light.living_cluster".expose = true; + "light.living_overhead".room = hidden; + "light.couch_overhead_left".room = hidden; + "light.couch_overhead_right".room = hidden; + # midea + "climate.living_ac".aliases = [ + "AC" + "Midea" + ]; + "sensor.living_ac_outdoor_temperature".expose = false; + + # shanghai systemd + "switch.graphical".expose = true; + "switch.mradio".expose = true; + "switch.vm_goliath1650".expose = true; + "switch.vm_goliath3080".expose = true; + "switch.vm_hourai1650".expose = true; + "switch.vm_hourai3080".expose = true; + }; }; homekit = { name = "Tewi"; From 3db293005025727aef2b80096e8453ed17511e43 Mon Sep 17 00:00:00 2001 From: arcnmx Date: Thu, 6 Oct 2022 09:56:01 -0700 Subject: [PATCH 2/2] chore: homekit hass entity filter --- nixos/systems/tewi/home-assistant.nix | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/nixos/systems/tewi/home-assistant.nix b/nixos/systems/tewi/home-assistant.nix index a0a6cfc1..e19f7707 100644 --- a/nixos/systems/tewi/home-assistant.nix +++ b/nixos/systems/tewi/home-assistant.nix @@ -179,6 +179,16 @@ name = "Tewi"; port = 21063; ip_address = "10.1.1.38"; + filter = let + inherit (config.services.host-assistant.config) google_assistant; + in { + include_domains = google_assistant.exposed_domains; + include_entities = attrNames (filterAttrs (_: entity: entity.expose or true) google_assistant.entity_config); + }; + entity_config = { + "switch.swb1_relay_3".type = "outlet"; + "switch.swb1_relay_4".type = "outlet"; + }; }; tts = [{ platform = "google_translate";