summaryrefslogtreecommitdiffstats
path: root/krebs/2configs
diff options
context:
space:
mode:
authormakefu <github@syntax-fehler.de>2019-09-19 21:31:21 +0200
committermakefu <github@syntax-fehler.de>2019-09-19 21:31:21 +0200
commit4bb7a52e98c1297655d77af661637545de906493 (patch)
tree68f2f4b269e39375e1ac9c2049cc241c03b5ba60 /krebs/2configs
parent8901bab8ad2f1db1ac7a1fabec091be3a14a1c20 (diff)
shack/glados: update automations
Diffstat (limited to 'krebs/2configs')
-rw-r--r--krebs/2configs/shack/glados/default.nix25
-rw-r--r--krebs/2configs/shack/glados/multi/wasser.nix9
2 files changed, 19 insertions, 15 deletions
diff --git a/krebs/2configs/shack/glados/default.nix b/krebs/2configs/shack/glados/default.nix
index 54e7aef5c..dc345cc4e 100644
--- a/krebs/2configs/shack/glados/default.nix
+++ b/krebs/2configs/shack/glados/default.nix
@@ -3,18 +3,21 @@ let
shackopen = import ./multi/shackopen.nix;
wasser = import ./multi/wasser.nix;
in {
- services.nginx.virtualHosts."hass.shack".locations."/" = {
- proxyPass = "http://localhost:8123";
- extraConfig = ''
- proxy_http_version 1.1;
- proxy_set_header Upgrade $http_upgrade;
- proxy_set_header Connection "upgrade";
- proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
- proxy_set_header Host $host;
- proxy_set_header X-Real-IP $remote_addr;
+ services.nginx.virtualHosts."hass.shack" = {
+ serverAliases = [ "glados.shack" ];
+ locations."/" = {
+ proxyPass = "http://localhost:8123";
+ extraConfig = ''
+ proxy_http_version 1.1;
+ proxy_set_header Upgrade $http_upgrade;
+ proxy_set_header Connection "upgrade";
+ proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
+ proxy_set_header Host $host;
+ proxy_set_header X-Real-IP $remote_addr;
- proxy_buffering off;
- '';
+ proxy_buffering off;
+ '';
+ };
};
services.home-assistant = let
dwd_pollen = pkgs.fetchFromGitHub {
diff --git a/krebs/2configs/shack/glados/multi/wasser.nix b/krebs/2configs/shack/glados/multi/wasser.nix
index a2c80851b..da5cac36d 100644
--- a/krebs/2configs/shack/glados/multi/wasser.nix
+++ b/krebs/2configs/shack/glados/multi/wasser.nix
@@ -12,6 +12,7 @@ let
retain = false;
qos = 1;
};
+ seconds = 30;
in
{
switch = [
@@ -19,7 +20,7 @@ in
];
automation =
[
- { alias = "Water the plant for 10 seconds";
+ { alias = "Water the plant for ${toString seconds} seconds";
trigger = [
{ # trigger at 20:00 no matter what
# TODO: retry or run only if switch.wasser is available
@@ -35,7 +36,7 @@ in
"switch.wasser"
];
}
- { delay.seconds = 10; }
+ { delay.seconds = seconds; }
{
service = "homeassistant.turn_off";
entity_id = [
@@ -44,13 +45,13 @@ in
}
];
}
- { alias = "Always turn off water after 15 seconds";
+ { alias = "Always turn off water after ${toString (seconds * 2)}seconds";
trigger = [
{
platform = "state";
entity_id = "switch.wasser";
to = "on";
- for.seconds = 15;
+ for.seconds = seconds*2;
}
];
action =