diff options
-rw-r--r-- | krebs/2configs/shack/glados/multi/wasser.nix | 48 | ||||
-rw-r--r-- | makefu/2configs/deployment/owncloud.nix | 13 |
2 files changed, 53 insertions, 8 deletions
diff --git a/krebs/2configs/shack/glados/multi/wasser.nix b/krebs/2configs/shack/glados/multi/wasser.nix index 74ce736a6..bd8252e1c 100644 --- a/krebs/2configs/shack/glados/multi/wasser.nix +++ b/krebs/2configs/shack/glados/multi/wasser.nix @@ -4,6 +4,11 @@ let glados = import ../lib; seconds = 20; wasser = "switch.crafting_giesskanne_relay"; + brotbox = { + minutes = 10; + pump = "switch.crafting_brotbox_pumpe"; + sensor = "sensor.statistics_for_sensor_crafting_brotbox_soil_moisture"; + }; in { sensor = map ( entity_id: { @@ -11,11 +16,54 @@ in name = "Statistics for ${entity_id}"; inherit entity_id; max_age.minutes = "60"; + sampling_size = 1000; }) ["sensor.crafting_brotbox_soil_moisture"]; automation = [ + ### Brotbox ##### + #{ alias = "Brotbox: water for ${toString brotbox.minutes} minutes every hour"; + # trigger = + # { # Trigger once every hour at :42 + # platform = "time_pattern"; + # minutes = 42; + # }; + # condition = { + # condition = "numeric_state"; + # entity_id = brotbox.sensor; + # value_template = "{{ state_attr('${brotbox.sensor}', 'median') }}"; + # below = 75; + # }; + # action = + # [ + # { + # service = "homeassistant.turn_on"; + # entity_id = brotbox.pump; + # } + # { delay.minutes = brotbox.minutes; } + # { + # service = "homeassistant.turn_off"; + # entity_id = brotbox.pump ; + # } + # ]; + #} + { alias = "Brotbox: Always turn off water after ${toString (brotbox.minutes * 2)} minutes"; + trigger = + { + platform = "state"; + entity_id = brotbox.pump; + to = "on"; + for.minutes = brotbox.minutes*2; + }; + action = + { + service = "homeassistant.turn_off"; + entity_id = brotbox.pump; + }; + } + + ##### Kaffeemaschine { alias = "Water the plant for ${toString seconds} seconds"; trigger = [ { # trigger at 20:00 no matter what diff --git a/makefu/2configs/deployment/owncloud.nix b/makefu/2configs/deployment/owncloud.nix index 1cfda6fc5..317e0a29f 100644 --- a/makefu/2configs/deployment/owncloud.nix +++ b/makefu/2configs/deployment/owncloud.nix @@ -98,7 +98,7 @@ let fastcgi_param PATH_INFO $fastcgi_path_info; fastcgi_param HTTPS on; fastcgi_param modHeadersAvailable true; #Avoid sending the security headers twice - fastcgi_pass unix:${socket}; + fastcgi_pass unix:${config.services.phpfpm.pools.${domain}.socket}; fastcgi_intercept_errors on; ''; @@ -126,7 +126,6 @@ let services.phpfpm.pools."${domain}" = { user = "nginx"; group = "nginx"; - listen = socket; settings = { "listen.owner" = "nginx"; "pm" = "dynamic"; @@ -135,13 +134,11 @@ let "pm.start_servers" = 2; "pm.min_spare_servers" = 2; "pm.max_spare_servers" = 5; + "php_admin_value[error_log]" = "stderr"; + "php_admin_flag[log_errors]" = "on"; + "catch_workers_output" = true; }; - extraConfig = '' - php_admin_value[error_log] = 'stderr' - php_admin_flag[log_errors] = on - env[PATH] = ${lib.makeBinPath [ pkgs.php ]} - catch_workers_output = yes - ''; + phpEnv."PATH" = lib.makeBinPath [ pkgs.php ]; }; services.phpfpm.phpOptions = '' opcache.enable=1 |