diff --git a/systems/LoutreOS/services.nix b/systems/LoutreOS/services.nix index a5aa63daa..5fec541c4 100644 --- a/systems/LoutreOS/services.nix +++ b/systems/LoutreOS/services.nix @@ -237,6 +237,97 @@ in kresd = { enable = true; }; + + home-assistant = { + enable = true; + # package = pkgs.home-assistant.override { + # extraPackages = ps: with ps; [ aiohttp-cors netdisco zeroconf ]; + # }; + config = { + default_config = null; + yeelight.devices = { + "10.40.249.0".name = "Chambre"; + "10.40.249.1".name = "Bureau"; + "10.40.249.2".name = "Cuisine"; + }; + light = [ + { + platform = "group"; + name = "Salon"; + entities = [ + "light.bureau" + "light.cuisine" + ]; + } + ]; + media_player = [ + { + platform = "squeezebox"; + host = "10.30.0.1"; + } + ]; + switch = [ + { + platform = "wake_on_lan"; + name = "PC Fixe"; + mac = "b4:2e:99:ed:24:26"; + host = "10.30.135.71"; + broadcast_address = "10.30.255.255"; + } + ]; + automation = [ + { + alias = "Aziz lumière"; + trigger = [ + { + platform = "sun"; + event = "sunset"; + offset = "-01:00:00"; + } + { + platform = "state"; + entity_id = "person.paul"; + to = "home"; + } + ]; + condition = [ + { + condition = "state"; + entity_id = "person.paul"; + state = "home"; + } + { + condition = "time"; + after = "16:00:00"; + before = "23:00:00"; + } + ]; + action = { + service = "light.turn_on"; + entity_id = "light.salon"; + }; + } + { + alias = "Adios"; + trigger = { + platform = "state"; + entity_id = "person.paul"; + to = "not_home"; + }; + action = [ + { + service = "light.turn_off"; + entity_id = "all"; + } + { + service = "media_player.media_pause"; + entity_id = "all"; + } + ]; + } + ]; + }; + }; }; systemd.services.dogetipbot-telegram = let diff --git a/systems/LoutreOS/web.nix b/systems/LoutreOS/web.nix index a8f339995..f771e8947 100644 --- a/systems/LoutreOS/web.nix +++ b/systems/LoutreOS/web.nix @@ -184,6 +184,11 @@ in "emby.nyanlout.re" = simpleReverse 8096; "ci.nyanlout.re" = simpleReverse 52350; "gitea.nyanlout.re" = simpleReverse config.services.gitea.httpPort; + "apart.nyanlout.re" = recursiveUpdate (simpleReverse config.services.home-assistant.port) { + locations."/" = { + proxyWebsockets = true; + }; + }; }; appendConfig = let rootLocation = config.services.nginx.virtualHosts."stream.nyanlout.re".locations."/".root;