From d531577378031553d535e3d807a941cb1637dd3f Mon Sep 17 00:00:00 2001 From: arcnmx Date: Thu, 6 Oct 2022 08:58:38 -0700 Subject: [PATCH] feat: mqtt_room presence beacons --- nixos/systems/tewi/home-assistant.nix | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/nixos/systems/tewi/home-assistant.nix b/nixos/systems/tewi/home-assistant.nix index f427eeb3..150fb38c 100644 --- a/nixos/systems/tewi/home-assistant.nix +++ b/nixos/systems/tewi/home-assistant.nix @@ -110,6 +110,23 @@ # https://nixos.wiki/wiki/Home_Assistant#Combine_declarative_and_UI_defined_scenes "scene manual" = []; "scene ui" = "!include scenes.yaml"; + sensor = let + mkESPresenceBeacon = { device_id, ... }@args: { + platform = "mqtt_room"; + state_topic = "espresense/devices/${device_id}"; + } // args; + in [ + (mkESPresenceBeacon { + device_id = "irk:${secrets.arc-iphone-se-irk}"; + name = "iPhone SE"; + timeout = 2; + away_timeout = 120; + }) + (mkESPresenceBeacon { + device_id = "name:galaxy-watch-active"; + name = "Galaxy Watch Active"; + }) + ]; }; extraPackages = python3Packages: with python3Packages; [ psycopg2